RE: In general, what kind of situation would I use "HalAllocateCommonB by LucaCalligaris
LucaCalligaris
Tue Apr 11 02:47:02 CDT 2006
DMA_ADAPTER_OBJECT structure ( defined like HalAllocate... in Windows NTDDK
but the function is deprecated in XP DDK ) abstracts the concept of Direct
Memory Access from the underlying HW.
Using this function you get a virtual address which maps to a buffer of
locked, physically contiguous pages. Your driver can use the VA to
read/write data which are involved in the DMA transfer while 'LogicalAddress'
can be be used to program the 'DMA controller'. Please note that 'DMA' does
not -only- refer to standard PC DMA controller. The same concept applies to
PCI devices which have bus mastering
capabilities as well
"shortstop" wrote:
> When I try to write a driver with DMA access, I find the function:
>
> PVOID HalAllocateCommonBuffer(
> PDMA_ADAPTER_OBJECT DmaAdapter,
> ULONG Length,
> PPHYSICAL_ADDRESS LogicalAddress,
> BOOLEAN CacheEnabled
> );
>
> But I do not clearly comprehend how to use it!
>
> 1. What is the concept about DMA adapter object?
> 2. Does the function provide a physical address for manipulating the
> allocated DMA Bufefer by the 3rd parameter?
>
> Thanks in advance.
>
>