This source file includes following definitions.
- sun4c_enable_vac
- sun4c_disable_vac
- sun4c_flush_context
- sun4c_flush_segment
- sun4c_flush_page
1
2 #ifndef _SPARC_VAC_OPS_H
3 #define _SPARC_VAC_OPS_H
4
5
6
7
8
9
10
11 #include <asm/sysen.h>
12 #include <asm/contregs.h>
13 #include <asm/asi.h>
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56 #define S4CVACTAG_CID 0x01c00000
57 #define S4CVACTAG_W 0x00200000
58 #define S4CVACTAG_P 0x00100000
59 #define S4CVACTAG_V 0x00080000
60 #define S4CVACTAG_TID 0x0000fffc
61
62
63 #define S4CVACVA_TID 0x3fff0000
64 #define S4CVACVA_LINE 0x0000fff0
65 #define S4CVACVA_BIL 0x0000000f
66
67
68
69
70
71
72
73
74
75
76 #define S4CVAC_BADBITS 0x0000f000
77
78
79
80
81 #define S4CVAC_BADALIAS(vaddr1, vaddr2) \
82 (((unsigned long) (vaddr1)) ^ ((unsigned long) (vaddr2)) & \
83 (S4CVAC_BADBITS))
84
85
86
87
88 struct sun4c_vac_props {
89 unsigned int num_bytes;
90 unsigned int num_lines;
91 unsigned int do_hwflushes;
92 unsigned int linesize;
93 unsigned int log2lsize;
94 unsigned int on;
95 };
96
97 extern struct sun4c_vac_props sun4c_vacinfo;
98
99 extern void sun4c_flush_all(void);
100
101
102 extern __inline__ void sun4c_enable_vac(void)
103 {
104 __asm__ __volatile__("lduba [%0] %1, %%g1\n\t"
105 "or %%g1, %2, %%g1\n\t"
106 "stba %%g1, [%0] %1\n\t" : :
107 "r" ((unsigned int) AC_SENABLE),
108 "i" (ASI_CONTROL), "i" (SENABLE_CACHE) :
109 "g1");
110 sun4c_vacinfo.on = 1;
111 }
112
113
114 extern __inline__ void sun4c_disable_vac(void)
115 {
116 __asm__ __volatile__("lduba [%0] %1, %%g1\n\t"
117 "andn %%g1, %2, %%g1\n\t"
118 "stba %%g1, [%0] %1\n\t" : :
119 "r" ((unsigned int) AC_SENABLE),
120 "i" (ASI_CONTROL), "i" (SENABLE_CACHE) :
121 "g1");
122 sun4c_vacinfo.on = 0;
123 }
124
125 extern unsigned long sun4c_ctxflush;
126 extern unsigned long sun4c_segflush;
127 extern unsigned long sun4c_pgflush;
128
129 extern void sun4c_ctxflush_hw64KB16B(void);
130 extern void sun4c_ctxflush_hw64KB32B(void);
131 extern void sun4c_ctxflush_sw64KB16B(void);
132 extern void sun4c_ctxflush_sw64KB32B(void);
133
134 extern void sun4c_segflush_hw64KB16B(void);
135 extern void sun4c_segflush_hw64KB32B(void);
136 extern void sun4c_segflush_sw64KB16B(void);
137 extern void sun4c_segflush_sw64KB32B(void);
138
139 extern void sun4c_pgflush_hw64KB16B(void);
140 extern void sun4c_pgflush_hw64KB32B(void);
141 extern void sun4c_pgflush_sw64KB16B(void);
142 extern void sun4c_pgflush_sw64KB32B(void);
143
144
145
146
147 extern inline void sun4c_flush_context(void)
148 {
149 __asm__ __volatile__("jmpl %0, %%l4\n\t"
150 "nop\n\t" : :
151 "r" (sun4c_ctxflush) :
152 "l4", "l6", "l7", "memory");
153 }
154
155 extern inline void sun4c_flush_segment(unsigned long segment)
156 {
157 __asm__ __volatile__("jmpl %0, %%l4\n\t"
158 "or %1, %%g0, %%l2\n\t" : :
159 "r" (sun4c_segflush), "r" (segment) :
160 "l2", "l4", "l6", "l7", "memory");
161 }
162
163 extern inline void sun4c_flush_page(unsigned long page)
164 {
165 __asm__ __volatile__("jmpl %0, %%l4\n\t"
166 "or %1, %%g0, %%l2\n\t" : :
167 "r" (sun4c_pgflush), "r" (page) :
168 "l2", "l4", "l6", "l7", "memory");
169 }
170
171 #endif