On Oct 18, 2004, at 8:01 AM, Alexey Shinkin wrote:
The goal is to make this memoty visible from user level application. The following approach is used on õ86 and works :
I'm kinda surprised it works anywhere. You have taken a rather complex approach to achieving your results.
- to use remap_page_range() instead of vm_ops .
This is all you should have to do. Use the physical (dma_addr_t) address
returned from pci_alloc_consistent() as the 'offset' parameter, use the VMA
allocated and provided to you, call remap_page_range() and you are done.
An alternative is to have an ioctl() in your driver that returns the physical
address of the buffer (as provided by pci_alloc_consistent()), then use
/dev/mem to do the mmap(). The only problem with this is coordination
with your driver, you have to ensure you release the /dev/mem mmap
in your application when the driver also does the same for the dma
buffer space.
-- Dan