PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

DMA Alignment Requirements

A variation on the physical transfer of data occurs when the client's buffer does not meet the alignment requirements of the DMA hardware. In this case, the driver needs to supply a logical mapping table in addition to the physical mapping table, so that programmed I/O can be performed in the unaligned beginning and/or end of the buffer. Otherwise, the driver would have to prepare the beginning and end separately from the middle portion.

Because only the beginning and the end of the buffer will be transferred with programmed I/O, only the first and last logical mapping table entries are actually needed--the middle entries are page aligned, which is usually sufficient for any DMA engine. To reduce memory usage, the driver may limit the size of the logical mapping table to just two entries per range and may specify the kIOMinimalLogicalMapping option. PrepareMemoryForIO will fill in the first logical mapping table entry of each range as usual and will fill the second entry with the static logical mapping of the last page in the range. Two entries per range are used, regardless of the range sizes. However, the value of the second entry of the pair is undefined if the range is contained within a single page.


© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)