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


  

SetProcessorCacheMode

OSStatus SetProcessorCacheMode(
                     AddressSpaceID theAddressSpace,
                     void *theBase,
                     ByteCount theLength,
                     ProcessorCacheMode theMode);
--> theAddressSpace
Address space ID of address space.
--> theBase
Pointer to the starting address in address space.
--> theLength
Length of address range, in bytes.
--> theMode
Cache mode to be set, as defined in ProcessorCacheMode.
typedef unsigned long ProcessorCacheMode;
enum {
    kProcessorCacheModeDefault                  = 0,
    kProcessorCacheModeInhibited                = 1,
    kProcessorCacheModeWriteThrough             = 2,
    kProcessorCacheModeCopyBack                 = 3
};
DESCRIPTION

The SetProcessorCacheMode function sets the cache mode of a specified range of address space. The theAddressSpace parameter specifies the address space containing the logical ranges to be set. Current versions of the Mac OS provide only one address space, which it automatically passes to native drivers through DoDriverIO. In general, a driver should always pass the address space it received as a parameter to its DoDriverIO routine in this field. Otherwise, the address space must be specified as kCurrentAddressSpaceID.

In early versions of the PCI-based Mac OS, SetProcessorCacheMode can be used on only one card in any given 256 MB segment of the effective address space above 0x7FFF FFFF. For example, if two PCI cards were configured at addresses 0x8001 2000 and 0x8034 5000, SetProcessorCacheMode could set the cache mode of only one card's address space. However, it could also set the mode of a card at 0xA001 0000, because that card's space lies in a different 256 MB segment of the system's effective address space. This restriction will be relaxed in future versions of Mac OS.

EXECUTION CONTEXT

SetProcessorCacheMode may be called only from task level, not from secondary or hardware interrupt level.

RESULT CODES
noErr 0 No error
paramErr -50 Bad parameter

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