This source file includes following definitions.
- get_psr
- put_psr
- get_fsr
- get_v9_pstate
- put_v9_pstate
- get_v9_version
- get_v9_tstate
- get_v9_pil
- put_v9_pil
1
2
3
4
5
6
7
8
9
10
11 #ifndef __LINUX_SPARC_PSR_H
12 #define __LINUX_SPARC_PSR_H
13
14 #define __LINUX_SPARC_V8
15
16 #ifdef __LINUX_SPARC_V8
17
18
19
20
21
22
23
24
25
26 #define PSR_CWP 0x0000001f
27 #define PSR_ET 0x00000020
28 #define PSR_PS 0x00000040
29 #define PSR_S 0x00000080
30 #define PSR_PIL 0x00000f00
31 #define PSR_EF 0x00001000
32 #define PSR_EC 0x00002000
33 #define PSR_ICC 0x00f00000
34 #define PSR_C 0x00100000
35 #define PSR_V 0x00200000
36 #define PSR_Z 0x00400000
37 #define PSR_N 0x00800000
38 #define PSR_VERS 0x0f000000
39 #define PSR_IMPL 0xf0000000
40
41 #ifndef __ASSEMBLY__
42
43 extern inline unsigned int get_psr(void)
44 {
45 unsigned int psr;
46 __asm__ __volatile__("rd %%psr, %0\n\t" :
47 "=r" (psr));
48 return psr;
49 }
50
51 extern inline void put_psr(unsigned int new_psr)
52 {
53 __asm__("wr %0, 0x0, %%psr\n\t" : :
54 "r" (new_psr));
55 }
56
57
58
59
60
61
62 extern unsigned int fsr_storage;
63
64 extern inline unsigned int get_fsr(void)
65 {
66 unsigned int fsr = 0;
67
68 __asm__ __volatile__("st %%fsr, %1\n\t"
69 "ld %1, %0\n\t" :
70 "=r" (fsr) :
71 "m" (fsr_storage));
72 return fsr;
73 }
74
75 #endif
76
77 #endif
78
79 #ifdef __LINUX_SPARC_V9
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95 #define PSTATE_AG 0x001
96 #define PSTATE_IE 0x002
97 #define PSTATE_PRIV 0x004
98 #define PSTATE_AM 0x008
99
100
101 #define PSTATE_PEF 0x010
102 #define PSTATE_RED 0x020
103
104 #define PSTATE_MM 0x0c0
105
106
107 #define PSTATE_TLE 0x100
108 #define PSTATE_CLE 0x200
109
110
111 extern inline unsigned int get_v9_pstate(void)
112 {
113 unsigned int pstate;
114 __asm__ __volatile__("rdpr %pstate, %0\n\t" :
115 "=r" (pstate));
116 return pstate;
117 }
118
119 extern inline void put_v9_pstate(unsigned int pstate)
120 {
121 __asm__ __volatile__("wrpr %0, 0x0, %pstate\n\t" : :
122 "r" (pstate));
123 return;
124 }
125
126
127
128
129
130
131
132
133
134
135 #define VERS_MAXWIN 0x000000000000001f
136 #define VERS_MAXTL 0x00000000000ff000
137 #define VERS_MASK 0x0000000ff0000000
138 #define VERS_MANUF 0xffff000000000000
139
140 extern inline unsigned int get_v9_version(void)
141 {
142 unsigned int vers;
143 __asm__ __volatile__("rdpr %ver, %0\n\t" :
144 "=r" (vers));
145 return vers;
146 }
147
148 extern inline unsigned int get_v9_tstate(void)
149 {
150 unsigned int tstate;
151 __asm__ __volatile__("rdpr %tstate, %0\n\t" :
152 "=r" (pstate));
153 return tstate;
154 }
155
156 extern inline unsigned int get_v9_pil(void)
157 {
158 unsigned int pil;
159 __asm__ __volatile__("rdpr %pil, %0\n\t" :
160 "=r" (pstate));
161 return pil;
162 }
163
164 extern inline void put_v9_pil(unsigned int pil)
165 {
166 __asm__ __volatile__("wrpr %0, 0x0, %pil\n\t" : :
167 "r" (pil));
168 return;
169 }
170
171
172 #endif
173
174 #endif