My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cache.h
Go to the documentation of this file.
1 /*
2  * OpenVirtualization:
3  * For additional details and support contact developer@sierraware.com.
4  * Additional documentation can be found at www.openvirtualization.org
5  *
6  * Copyright (C) 2010-2014 SierraWare
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  *
22  */
23 #ifndef __CACHE_H__
24 #define __CACHE_H__
25 
26 #define MAX_CACHE_LEVEL 0x7
27 
28 #define CACHE_WAY_SHIFT 3
29 #define CACHE_WAY_MASK 0x3FF
30 #define CACHE_NUMSET_SHIFT 13
31 #define CACHE_NUMSET_MASK 0x7FFF
32 #define CACHE_LINESIZE_MASK 0x7
33 
34 #define CACHE_TYPE_NOCACHE 0x0 //No cache at this level
35 #define CACHE_TYPE_ICACHE 0x1 //Instruction cache present
36 #define CACHE_TYPE_DCACHE 0x2 //Data cache present
37 #define CACHE_TYPE_SCACHE 0x3 //Seperate Cache for Instruction and Data
38 #define CACHE_TYPE_UCACHE 0x4 //Unified Cache for both
39 
40 #define ICACHE_PRESENT (CACHE_TYPE_ICACHE | CACHE_TYPE_UCACHE)
41 #define DCACHE_PRESENT (CACHE_TYPE_DCACHE | CACHE_TYPE_UCACHE)
42 
43 #ifdef __CCODE__
44 extern unsigned int cache_type[];
45 
46 extern unsigned int cache_set[];
47 extern unsigned int cache_linesize[];
48 
49 extern unsigned int LoC;
50 extern unsigned int LoUIS;
51 extern unsigned int LoUU;
52 
53 void flush_cache_all(void);
54 void flush_dcache_all(void);
55 void cache_init(void);
56 #endif
57 
58 #endif
unsigned int LoUIS
Definition: ccache.c:32
void flush_cache_all(void)
unsigned int LoC
Definition: ccache.c:31
unsigned int cache_type[MAX_CACHE_LEVEL]
Definition: ccache.c:26
unsigned int LoUU
Definition: ccache.c:33
unsigned int cache_set[MAX_CACHE_LEVEL]
Definition: ccache.c:27
void cache_init(void)
cache function init
Definition: ccache.c:38
unsigned int cache_linesize[MAX_CACHE_LEVEL]
Definition: ccache.c:29