/*---------------------------------------------------------------------------* Project: OS - High Level Cache Operations File: OSCache.h Copyright (C) Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. *---------------------------------------------------------------------------*/ #ifndef __OSCACHE_H__ #define __OSCACHE_H__ #include #ifdef __cplusplus extern "C" { #endif /*---------------------------------------------------------------------------* L1 Data Cache Operations *---------------------------------------------------------------------------*/ void DCInvalidateRange ( void* addr, u32 nBytes ); void DCFlushRange ( const void* addr, u32 nBytes ); void DCStoreRange ( const void* addr, u32 nBytes ); void DCFlushRangeNoSync ( const void* addr, u32 nBytes ); void DCStoreRangeNoSync ( const void* addr, u32 nBytes ); void DCZeroRange ( void* addr, u32 nBytes ); void DCTouchRange ( const void* addr, u32 nBytes ); /*---------------------------------------------------------------------------* Locked Cache Operations *---------------------------------------------------------------------------*/ // maximum size of a single DMA transaction #define LC_MAX_DMA_BLOCKS (128) #define LC_MAX_DMA_BYTES (LC_MAX_DMA_BLOCKS * 32) #define LC_MAX_BYTES 0x4000 // 16KB LC #define LC_MIN_ALLOC 512 // in bytes u32 LCGetMaxSize (void); u32 LCGetUnallocated (void); u32 LCGetAllocatableSize(void); void* LCAlloc (u32 nBytes); void LCDealloc (void *lcAddr); BOOL LCEnableDMA (void); void LCDisableDMA (void); BOOL LCIsDMAEnabled (void); void LCLoadDMABlocks (void* lcDestAddr, const void* memSrcAddr, u32 numBlocks); void LCStoreDMABlocks (void* memDestAddr, const void* lcSrcAddr, u32 numBlocks); u32 LCGetDMAQueueLength (void); void LCWaitDMAQueue (u32 len); BOOL OSIsAddressRangeDCValid(const void *addr, u32 nBytes); BOOL DCCoreFlushAll(void *flush_buf, u32 size); #ifdef __cplusplus } #endif #endif // __OSCACHE_H__