7 #ifndef _SPARC_VIKING_H
8 #define _SPARC_VIKING_H
85 #define VIKING_MMUENABLE 0x00000001
86 #define VIKING_NOFAULT 0x00000002
87 #define VIKING_PSO 0x00000080
88 #define VIKING_DCENABLE 0x00000100
89 #define VIKING_ICENABLE 0x00000200
90 #define VIKING_SBENABLE 0x00000400
91 #define VIKING_MMODE 0x00000800
92 #define VIKING_PCENABLE 0x00001000
93 #define VIKING_BMODE 0x00002000
94 #define VIKING_SPENABLE 0x00004000
95 #define VIKING_ACENABLE 0x00008000
96 #define VIKING_TCENABLE 0x00010000
97 #define VIKING_DPENABLE 0x00040000
102 #define VIKING_ACTION_MIX 0x00001000
107 #define VIKING_PTAG_VALID 0x01000000
108 #define VIKING_PTAG_DIRTY 0x00010000
109 #define VIKING_PTAG_SHARED 0x00000100
113 static inline void viking_flush_icache(
void)
115 __asm__ __volatile__(
"sta %%g0, [%%g0] %0\n\t"
121 static inline void viking_flush_dcache(
void)
123 __asm__ __volatile__(
"sta %%g0, [%%g0] %0\n\t"
129 static inline void viking_unlock_icache(
void)
131 __asm__ __volatile__(
"sta %%g0, [%0] %1\n\t"
137 static inline void viking_unlock_dcache(
void)
139 __asm__ __volatile__(
"sta %%g0, [%0] %1\n\t"
145 static inline void viking_set_bpreg(
unsigned long regval)
147 __asm__ __volatile__(
"sta %0, [%%g0] %1\n\t"
153 static inline unsigned long viking_get_bpreg(
void)
157 __asm__ __volatile__(
"lda [%%g0] %1, %0\n\t"
163 static inline void viking_get_dcache_ptag(
int set,
int block,
166 unsigned long ptag = ((
set & 0x7f) << 5) | ((block & 0x3) << 26) |
170 __asm__ __volatile__ (
"ldda [%2] %3, %%g2\n\t"
171 "or %%g0, %%g2, %0\n\t"
172 "or %%g0, %%g3, %1\n\t"
173 :
"=r" (info),
"=r" (page)
180 static inline void viking_mxcc_turn_off_parity(
unsigned long *mregp,
181 unsigned long *mxcc_cregp)
183 unsigned long mreg = *mregp;
184 unsigned long mxcc_creg = *mxcc_cregp;
189 __asm__ __volatile__ (
"set 1f, %%g2\n\t"
190 "andcc %%g2, 4, %%g0\n\t"
194 "sta %0, [%%g0] %3\n\t"
195 "sta %1, [%2] %4\n\t"
200 "sta %0, [%%g0] %3\n\t"
204 :
"r" (mreg),
"r" (mxcc_creg),
207 :
"g2",
"memory",
"cc");
209 *mxcc_cregp = mxcc_creg;
212 static inline unsigned long viking_hwprobe(
unsigned long vaddr)
218 __asm__ __volatile__(
"lda [%1] %2, %0\n\t"
225 __asm__ __volatile__(
"lda [%1] %2, %0\n\t"
231 return val | (vaddr << 8);
235 __asm__ __volatile__(
"lda [%1] %2, %0\n\t"
241 return val | (vaddr << 8);
245 __asm__ __volatile__(
"lda [%1] %2, %0\n\t"