Linux kernel device driver to DMA from a device into user-space memory

前端 未结 6 535
清歌不尽
清歌不尽 2020-12-12 12:00

I want to get data from a DMA enabled, PCIe hardware device into user-space as quickly as possible.

Q: How do I combine \"direct I/O to user-space with/and/via a DMA

6条回答
  •  轮回少年
    2020-12-12 12:21

    first_page_offset = udata & PAGE_MASK; 
    

    It seems wrong. It should be either:

    first_page_offset = udata & ~PAGE_MASK;
    

    or

    first_page_offset = udata & (PAGE_SIZE - 1)
    

提交回复
热议问题