RE: DMA to User-Space
From: Jonathan Haws <hidden>
Date: 2009-11-04 17:50:15
1. I open /dev/mem and get a file descriptor 2. I use mmap to reserve some physical addresses for my buffers in user space. 3. I give that address to the FPGA for DMA use. 4. When I get the FPGA interrupt, I invalidate the data cache and write the data to disk =20 Does that sound like it would work? Would the address I receive from mmap() and pass to the FPGA be the actual physical address, or would I need to send the physical address to the FPGA and use the mmap() address to access and write to disk?
One more question about this approach: does the mmap() call prevent the ker= nel from using this memory for other purposes? Will the kernel be able to = "move" this memory elsewhere? I guess what I am asking is if this memory i= s locked for all other purposes?