RetroArch
cache.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------
2 
3 
4 cache.h -- Cache interface
5 
6 Copyright (C) 2004
7 Michael Wiedenbauer (shagkur)
8 Dave Murphy (WinterMute)
9 
10 This software is provided 'as-is', without any express or implied
11 warranty. In no event will the authors be held liable for any
12 damages arising from the use of this software.
13 
14 Permission is granted to anyone to use this software for any
15 purpose, including commercial applications, and to alter it and
16 redistribute it freely, subject to the following restrictions:
17 
18 1. The origin of this software must not be misrepresented; you
19 must not claim that you wrote the original software. If you use
20 this software in a product, an acknowledgment in the product
21 documentation would be appreciated but is not required.
22 
23 2. Altered source versions must be plainly marked as such, and
24 must not be misrepresented as being the original software.
25 
26 3. This notice may not be removed or altered from any source
27 distribution.
28 
29 
30 -------------------------------------------------------------*/
31 
32 
33 #ifndef __CACHE_H__
34 #define __CACHE_H__
35 
41 #include <gctypes.h>
42 
43 #define LC_BASEPREFIX 0xe000
44 #define LC_BASE (LC_BASEPREFIX<<16)
45 
46 #ifdef __cplusplus
47  extern "C" {
48 #endif /* __cplusplus */
49 
50 
57 void DCEnable();
58 
59 
66 void DCDisable();
67 
68 
78 void DCFreeze();
79 
80 
90 void DCUnfreeze();
91 
92 
102 void DCFlashInvalidate();
103 
104 
116 void DCInvalidateRange(void *startaddress,u32 len);
117 
118 
131 void DCFlushRange(void *startaddress,u32 len);
132 
144 void DCStoreRange(void *startaddress,u32 len);
145 
146 
159 void DCFlushRangeNoSync(void *startaddress,u32 len);
160 
161 
173 void DCStoreRangeNoSync(void *startaddress,u32 len);
174 
175 
185 void DCZeroRange(void *startaddress,u32 len);
186 
187 
197 void DCTouchRange(void *startaddress,u32 len);
198 
199 
208 void ICSync();
209 
210 
220 void ICFlashInvalidate();
221 
222 
229 void ICEnable();
230 
231 
238 void ICDisable();
239 
240 
250 void ICFreeze();
251 
252 
262 void ICUnfreeze();
263 
264 
275 void ICBlockInvalidate(void *startaddress);
276 
277 
289 void ICInvalidateRange(void *startaddress,u32 len);
290 
303 #ifdef HW_RVL
304 void L2Enhance();
305 #endif
306 
307 void LCEnable();
308 void LCDisable();
309 void LCLoadBlocks(void *,void *,u32);
310 void LCStoreBlocks(void *,void *,u32);
311 u32 LCLoadData(void *,void *,u32);
312 u32 LCStoreData(void *,void *,u32);
315 void LCFlushQueue();
316 void LCAlloc(void *,u32);
317 void LCAllocNoInvalidate(void *,u32);
318 void LCAllocOneTag(BOOL,void *);
319 void LCAllocTags(BOOL,void *,u32);
320 
321 #define LCGetBase() ((void*)LC_BASE)
322 #ifdef __cplusplus
323  }
324 #endif /* __cplusplus */
325 
326 #endif
void DCFlushRange(void *startaddress, u32 len)
Flushes a given range.
void LCEnable()
Definition: cache.c:44
void DCInvalidateRange(void *startaddress, u32 len)
Invalidates a given range of the d-cache.
void DCStoreRange(void *startaddress, u32 len)
Ensures a range of memory is updated with any modified data in the cache.
void ICFreeze()
Current contents of the L1 i-cache are locked down and will not be cast out.
Data type definitions.
GLenum GLsizei len
Definition: glext.h:7389
void LCLoadBlocks(void *, void *, u32)
void ICUnfreeze()
Undoes actions of ICFreeze().
void DCZeroRange(void *startaddress, u32 len)
Loads a range of memory into cache and zeroes all the cache lines.
void LCStoreBlocks(void *, void *, u32)
void DCFlashInvalidate()
Invalidate L1 d-cache.
u32 LCQueueLength()
Definition: cache.c:97
void ICEnable()
Enable L1 i-cache.
void LCAlloc(void *, u32)
Definition: cache.c:117
u32 LCLoadData(void *, void *, u32)
Definition: cache.c:53
void LCFlushQueue()
Definition: cache.c:110
void LCDisable()
void DCEnable()
Enable L1 d-cache.
void LCAllocTags(BOOL, void *, u32)
void ICFlashInvalidate()
Invalidate the L1 i-cache.
void DCUnfreeze()
Undoes actions of DCFreeze().
void DCFlushRangeNoSync(void *startaddress, u32 len)
Flushes a given range.
void LCAllocNoInvalidate(void *, u32)
Definition: cache.c:130
void ICInvalidateRange(void *startaddress, u32 len)
Invalidate a range in the L1 i-cache.
void ICSync()
Performs an instruction cache synchronization.
void DCTouchRange(void *startaddress, u32 len)
Loads a range of memory into cache.
void LCAllocOneTag(BOOL, void *)
void DCStoreRangeNoSync(void *startaddress, u32 len)
Ensures a range of memory is updated with any modified data in the cache.
void DCDisable()
Disable L1 d-cache.
unsigned int BOOL
Definition: gctypes.h:51
u32 LCQueueWait(u32)
Definition: cache.c:103
void DCFreeze()
Current contents of the L1 d-cache are locked down and will not be cast out.
void ICDisable()
Disable L1 i-cache.
void ICBlockInvalidate(void *startaddress)
Invalidates a block in the i-cache.
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19
u32 LCStoreData(void *, void *, u32)
Definition: cache.c:75