sysCacheLockLib [sp7xx] - Cache locking support routines.
sysCacheLock( ) - locks specified data/instruction region
sysCacheUnlock( ) - Unlocks the previous locked cache
sysL2CacheLock( ) - lock L2 cache
sysL2CacheUnlock( ) - unlock the L2 cache
This module contains code to lock and unlock L1 and L2 cache. The routines sysCacheLock/Unlock can be used to lock and unlock the L1 cache while the routines sysL2CacheLock/Unlock can be used to lock and unlock the L2 cache.
This module supports PPC processors that support separate data and instruction caches (harward-style) for the L1. The lock routine will lock the entire cache, after loading it with specified code or data region. When the cache is locked, data/instruction access to regions not locked in the cache will not hit the cache.
L1 locking routines can be used to lock only one region of memory. Multiple calls to lock a region will result in unlocking the previous regionn. The region being locked must be aligned on a 32-byte boundary, and must not be larger than the L1 cache size.
L2 cache locking is currently supported only for 74X0 and 755 CPUs. These CPU implement a unified L2 cache that cannot be locked for separately for data and instruction. The implementation therefore supports locking the entire L2 cache for either data or instruction. While locking the L2 cache, the corresponding L1 cache must have been enabled, but not locked. Multiple calls to the L2 cache locking will silently unlock the region previously locked.
Just as the L1 cache, the region being locked in the L2 cache must be aligned on a 32-byte boundary.
sysCacheLock( ) - locks specified data/instruction region
STATUS sysCacheLock ( CACHE_TYPE cacheType, void * adrs, UINT32 bytes )
This routine locks the specified region into the cache, cacheType. The region to be locked is specified by the start address, adrs, and the size, bytes. The region -- the start address, and size -- must be aligned on a 32-byte boundary.
Multiple calls to this routine will silently unlock the specified cache to lock the new region.
RETURN - OK or error if cache is locked, or if cache is not supported.
sysCacheUnlock( ) - Unlocks the previous locked cache
STATUS sysCacheUnlock ( CACHE_TYPE cacheType )
This routines unlocks the specified cache, cacheType
RETURN - OK or error if cache is not supported.
sysL2CacheLock( ) - lock L2 cache
STATUS sysL2CacheLock ( CACHE_TYPE cacheType, void * adrs, size_t bytes )
The routine locks the L2 cache with specified region. L2 is implemented as a unified cache and supports locking only one region regardless of whether it is data or instruction.
A region of data or instruction can be locked in L2 cache only when the corresponding L1 cache is enabled but not locked.
The region of memory being locked must be aligned on a 32-byte boundary.
On consequtive calls, this routine will silently unlock the previous locked region.
OK on success, and ERROR otherwise.
sysCacheLockLib, sysL2CacheUnlock, sysCacheLock, sysCacheUnlock
sysL2CacheUnlock( ) - unlock the L2 cache
STATUS sysL2CacheUnlock (void)
This routine unlocks the L2 cache.
OK, always.
sysCacheLockLib, sysL2CacheLock, sysCacheLock, sysCacheUnlock