This source file includes following definitions.
- get_ross_icr
- put_ross_icr
- hyper_flush_whole_icache
- hyper_clear_all_tags
- hyper_flush_unconditional_combined
- hyper_flush_cache_user
- hyper_flush_cache_page
1
2
3
4
5
6
7 #ifndef _SPARC_ROSS_H
8 #define _SPARC_ROSS_H
9
10 #include <asm/asi.h>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 #define HYPERSPARC_CWENABLE 0x00200000
43 #define HYPERSPARC_SBENABLE 0x00100000
44 #define HYPERSPARC_WBENABLE 0x00080000
45 #define HYPERSPARC_MIDMASK 0x00078000
46 #define HYPERSPARC_BMODE 0x00004000
47 #define HYPERSPARC_ACENABLE 0x00002000
48 #define HYPERSPARC_CSIZE 0x00001000
49 #define HYPERSPARC_MRFLCT 0x00000800
50 #define HYPERSPARC_CMODE 0x00000400
51 #define HYPERSPARC_CENABLE 0x00000100
52 #define HYPERSPARC_NFAULT 0x00000002
53 #define HYPERSPARC_MENABLE 0x00000001
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93 #define HYPERSPARC_ICCR_FTD 0x00000002
94 #define HYPERSPARC_ICCR_ICE 0x00000001
95
96 extern inline unsigned int get_ross_icr(void)
97 {
98 unsigned int icreg;
99
100 __asm__ __volatile__(".word 0x8347c000\n\t"
101 "mov %%g1, %0\n\t" :
102 "=r" (icreg) : :
103 "g1", "memory");
104
105 return icreg;
106 }
107
108 extern inline void put_ross_icr(unsigned int icreg)
109 {
110 __asm__ __volatile__("or %%g0, %0, %%g1\n\t"
111 ".word 0xbf806000\n\t"
112 "nop\n\t"
113 "nop\n\t"
114 "nop\n\t" : :
115 "r" (icreg) :
116 "g1", "memory");
117
118 return;
119 }
120
121
122
123
124 extern inline void hyper_flush_whole_icache(void)
125 {
126 __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : :
127 "i" (ASI_M_FLUSH_IWHOLE));
128 return;
129 }
130
131 extern int hyper_cache_size;
132 extern int hyper_line_size;
133
134 extern inline void hyper_clear_all_tags(void)
135 {
136 unsigned long addr;
137
138 for(addr = 0; addr < hyper_cache_size; addr += hyper_line_size)
139 __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
140 "r" (addr), "i" (ASI_M_DATAC_TAG));
141 }
142
143 extern inline void hyper_flush_unconditional_combined(void)
144 {
145 unsigned long addr;
146
147 for(addr = 0; addr < hyper_cache_size; addr += hyper_line_size)
148 __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
149 "r" (addr), "i" (ASI_M_FLUSH_CTX));
150 }
151
152 extern inline void hyper_flush_cache_user(void)
153 {
154 unsigned long addr;
155
156 for(addr = 0; addr < hyper_cache_size; addr += hyper_line_size)
157 __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
158 "r" (addr), "i" (ASI_M_FLUSH_USER));
159 }
160
161 extern inline void hyper_flush_cache_page(unsigned long page)
162 {
163 unsigned long end;
164
165 page &= PAGE_MASK;
166 end = page + PAGE_SIZE;
167 while(page < end) {
168 __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
169 "r" (page), "i" (ASI_M_FLUSH_PAGE));
170 page += hyper_line_size;
171 }
172 }
173
174 #endif