This source file includes following definitions.
- flush_i_page
- flush_i_seg
- flush_i_region
- flush_i_ctx
- flush_i_user
- flush_whole_icache
- get_ross_icr
- put_ross_icr
1
2
3
4
5
6 #ifndef _SPARC_ROSS_H
7 #define _SPARC_ROSS_H
8
9
10
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 #define HYPERSPARC_CWENABLE 0x00200000
40 #define HYPERSPARC_SBENABLE 0x00100000
41 #define HYPERSPARC_WBENABLE 0x00080000
42 #define HYPERSPARC_MIDMASK 0x00078000
43 #define HYPERSPARC_BMODE 0x00004000
44 #define HYPERSPARC_ACENABLE 0x00002000
45 #define HYPERSPARC_CSIZE 0x00001000
46 #define HYPERSPARC_MRFLCT 0x00000800
47 #define HYPERSPARC_CMODE 0x00000400
48 #define HYPERSPARC_CENABLE 0x00000100
49 #define HYPERSPARC_NFAULT 0x00000002
50 #define HYPERSPARC_MENABLE 0x00000001
51
52
53 extern inline void flush_i_page(unsigned int addr)
54 {
55 __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
56 "r" (addr), "i" (ASI_M_IFLUSH_PAGE) :
57 "memory");
58 return;
59 }
60
61 extern inline void flush_i_seg(unsigned int addr)
62 {
63 __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
64 "r" (addr), "i" (ASI_M_IFLUSH_SEG) :
65 "memory");
66 return;
67 }
68
69 extern inline void flush_i_region(unsigned int addr)
70 {
71 __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
72 "r" (addr), "i" (ASI_M_IFLUSH_REGION) :
73 "memory");
74 return;
75 }
76
77 extern inline void flush_i_ctx(unsigned int addr)
78 {
79 __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
80 "r" (addr), "i" (ASI_M_IFLUSH_CTX) :
81 "memory");
82 return;
83 }
84
85 extern inline void flush_i_user(unsigned int addr)
86 {
87 __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
88 "r" (addr), "i" (ASI_M_IFLUSH_USER) :
89 "memory");
90 return;
91 }
92
93
94 extern inline void flush_whole_icache(void)
95 {
96 __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : :
97 "i" (ASI_M_FLUSH_IWHOLE));
98 return;
99 }
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127 extern inline unsigned int get_ross_icr(void)
128 {
129 unsigned int icreg;
130
131 __asm__ __volatile__(".word 0xbf402000\n\t" :
132 "=r" (icreg) : :
133 "g1", "memory");
134
135 return icreg;
136 }
137
138 extern inline void put_ross_icr(unsigned int icreg)
139 {
140 __asm__ __volatile__("or %%g0, %0, %%g1\n\t"
141 ".word 0xbf802000\n\t"
142 "nop\n\t"
143 "nop\n\t"
144 "nop\n\t" : :
145 "r" (icreg) :
146 "g1", "memory");
147
148 return;
149 }
150
151 #endif