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