DMA mask

Hi all!

My device for which I am porting a driver supports only addresses below 512 MB (29 bits). I want to allocate physically continous memory for DMA, but this memory because of the device have to be under 512MB. In linux there is pci_set_dma_mask() function used to handle this. How could I do this in QNX?

Thanks in advance.


As far as I know not a mask but you can have it below 1M. Check the flags available for mmap.

Yes you are right, it can be done using mmap flags, but actually you can set it only under 16M or 64K with flags MAP_BELOW16M and MAP_NOX64K. I have found also mallopt() function, which can control memory allocation, but its M_MMAP_THRESHOLD flag is not working and is present only for compatibility reasons :frowning: