KallistiOS  2.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
cache.h
Go to the documentation of this file.
1 /* KallistiOS 2.0.0
2 
3  arch/dreamcast/include/cache.h
4  (c)2001 Dan Potter
5 
6 */
7 
8 /** \file arch/cache.h
9  \brief Cache management functionality.
10 
11  This file contains definitions for functions that manage the cache in the
12  Dreamcast, including functions to flush and invalidate the caches.
13 
14  \author Dan Potter
15 */
16 
17 #ifndef __ARCH_CACHE_H
18 #define __ARCH_CACHE_H
19 
20 #include <sys/cdefs.h>
21 __BEGIN_DECLS
22 
23 #include <arch/types.h>
24 
25 /** \brief Flush the instruction cache.
26 
27  This function flushes a range of the instruction cache.
28 
29  \param start The physical address to begin flushing at.
30  \param count The number of bytes to flush.
31 */
32 void icache_flush_range(uint32 start, uint32 count);
33 
34 /** \brief Invalidate the data/operand cache.
35 
36  This function invalidates a range of the data/operand cache. If you care
37  about the contents of the cache that have not been written back yet, use
38  dcache_flush_range() before using this function.
39 
40  \param start The physical address to begin invalidating at.
41  \param count The number of bytes to invalidate.
42 */
43 void dcache_inval_range(uint32 start, uint32 count);
44 
45 /** \brief Flush the data/operand cache.
46 
47  This function flushes a range of the data/operand cache, forcing a write-
48  back on all of the data in the specified range. This does not invalidate the
49  cache in the process (meaning the blocks will still be in the cache, just
50  not marked as dirty after this has completed). If you wish to invalidate the
51  cache as well, call dcache_inval_range() after calling this function.
52 
53  \param start The physical address to begin flushing at.
54  \param count The number of bytes to flush.
55 */
56 void dcache_flush_range(uint32 start, uint32 count);
57 
58 __END_DECLS
59 
60 #endif /* __ARCH_CACHE_H */
61