09-01-2009 07:11 AM
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
09-04-2009 05:11 AM
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.