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


  

Reducing Memory Usage

PrepareMemoryForIO normally keeps its own copy of the mapping tables in addition to the tables the driver has allocated. Hence, memory usage can be reduced if the driver shares its mapping tables with the operating system. The kIOShareMappingTables option specifies that PrepareMemoryForIO can use the driver's mapping tables rather than maintain its own copies. The shared mapping tables must be located in logical memory that cannot page fault until the final CheckpointIO call finishes (that is, the memory is locked). In addition, the mapping tables must remain allocated and the entries unaltered until after the final CheckpointIO call. It is not necessary for the driver to provide both tables.

A full-sized mapping table contains as many entries as there are pages in the client buffer. However, the driver can use a smaller table if it calls PrepareMemoryForIO more than once for a given client buffer. This technique is discussed in Partial Preparation.

The granularity specification can reduce memory usage in the event of a partial preparation. Granularity is discussed in Partial Preparation.

Certain DMA transactions require both mapping tables. However, the size of the logical mapping table can be easily reduced. The kIOMinimalLogicalMapping option is discussed in DMA Alignment Requirements.


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