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


  

Cache Operations

Unlike some previous Macintosh drivers, native drivers do not need to flush the PowerPC processor cache in the case of normal I/O operations. The Power Macintosh hardware supports processor cache snooping, which guarantees that the RAM and cache memory domain is coherent. The PrepareMemoryForIO routine takes care of maintaining cache coherency inherent in PCI-based Macintosh computers.

Nevertheless, driver writers may want to perform cache manipulation to improve driver performance. The Driver Services Library provides several routines and data types, described in this section, that allow drivers to get information about cache, alter the default cache modes, and flush the processor cache.The SetProcessorCacheMode function forces the cache mode for selected pages of memory. The FlushProcessorCache function forces data from cache out to main memory. These functions lets special-purpose drivers optimize their I/O performance.

WARNING

Take care when using the SetProcessorCacheMode and FlushProcessorCache functions, because they may conflict with the cache mode operations of Mac OS. Most drivers need use only PrepareMemoryForIO and CheckPointIO.

Getting Cache Information

GetLogicalPageSize

GetDataCacheLineSize

GetPageInformation

Setting Cache Modes

SetProcessorCacheMode

Synchronizing I/O

SynchronizeIO

Flushing the Processor Cache

FlushProcessorCache


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