Direct Calls to Kernel Functions (Compact 2013)
3/26/2014
You can make direct calls to kernel functions to allocate physical memory for direct memory access (DMA) to use. Direct calls are useful when you need a finer degree of control over DMA operations than is possible by using the DMA functions in CEDDK.dll. For example, by using kernel functions you can change the default memory alignment of a DMA transfer. Because CEDDK.dll functions use a default memory alignment of 64 KB, you may need to use direct kernel calls if your device requires a smaller memory alignment. When you use direct calls to kernel functions to manage DMA transfers, you must handle any platform-specific address translations. You can call HalTranslateSystemAddress to translate these addresses.
The following table lists the kernel functions that you call to allocate and deallocate a physical memory buffer for DMA transfers.
Function |
Description |
---|---|
Allocates a section of physically contiguous memory. |
|
Releases physical memory back to the system. |
For a DMA example that uses these kernel functions, see the sample device driver source that is located in %_WINCEROOT%\public\COMMON\oak\drivers\usb\hcd.