I have a problem:
I need to allocate some memory in my driver, that can be mapped to physical
addresses for DMA (well, AGP actually), but can be addressed normally by
user-level programs after mmapping.
Normally, I would think of using ddi_dma_buf_bind_handle(), except that
the user is not passing in a struct buf with a userland memory
address; I have to allocate the memory in my driver.
So the fallback I know of is ddi_dma_mem_alloc() ....
except that the manpage says "
The data access handle is returned in handlep. handlep is
opaque - drivers may not attempt to interpret its value. To
access the data content, the driver must invoke ddi_get8(9F)
or ddi_put8(9F) (depending on the data transfer direction)
with the data access handle."
That implies to me that I'm not supposed to mmap it and let the user
read/write to it "directly".
Am I being overly paranoid, and mmaping is still allowed?
Or should I be using a different alloc strategy altogether?
[Trim the no-bots from my address to reply to me by email!]
[ Do NOT email-CC me on posts. Pick one or the other.]
The word of the day is mispergitude