LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to the the PhysicalMemory Address of a buffer, or Allocate a buffer return with PhysicalMemory Address.

I need a  physically contiguous page-locked buffer and its PhysicalMemory Address (not the pointer) for a DMA function.

But I do not fine a function could help with that.

I know a function called "get_free_page" in Linux, but there is no similar function in Windows and CVI

But I already found that in CVI ,there is WriteToPhysicalMemoryEx/ReadFrome.... direct Physical Memory access function, and I think there should be same direct Physical Memory allocate function that I do not know.

So, please help me with  allocate a Physical Memory or get the Physial Memory address of a buffer allocated by malloc().

 

Futian

China

0 Kudos
Message 1 of 2
(3,113 Views)

have a look at the Windows SDK, it defines a bunch of memory management functions, including AllocateUserPhysicalPages().

 

there is no problem to use those functions to target a standard windows environment as long as you use them consistently: free the memory with the counterpart of the function that was used to allocate it.

0 Kudos
Message 2 of 2
(3,070 Views)