memory allocation for DMA

I’m trying to use DMA to speed up memory transfer.
In an interrupt I need to transfer data between system RAM and a dual ported memory.

I’m using a MPC8540 processor and dealing with DMA means that I have to know physical address of source and destination buffers.
For the dual ported memory it is no problem since a known the physical memory address and map it with mmap_device_memory().

The problem is for the system RAM:
I need to allocate a buffer which uses contiguous physical memory and get the physical base address of this buffer. Getting physical base address seems to be possible with mem_offset64() but I didn’t find a way to allocate contiguous physical memory in system RAM.

Any input would help!

Armand

mmap(0, size, PROT_READ | PROT_WRITE | PROT_NOCACHE, MAP_PHYS | MAP_ANON, NOFD, 0)

OK, it was then a misunderstanding of the mmap() documentation.

Everything clear now,

Thanks,

Armand