This source file includes following definitions.
- get_psr
- put_psr
- get_fsr
1
2
3
4
5
6
7
8
9
10
11 #ifndef __LINUX_SPARC_PSR_H
12 #define __LINUX_SPARC_PSR_H
13
14 #include <uapi/asm/psr.h>
15
16
17 #ifndef __ASSEMBLY__
18
19 static inline unsigned int get_psr(void)
20 {
21 unsigned int psr;
22 __asm__ __volatile__(
23 "rd %%psr, %0\n\t"
24 "nop\n\t"
25 "nop\n\t"
26 "nop\n\t"
27 : "=r" (psr)
28 :
29 : "memory");
30
31 return psr;
32 }
33
34 static inline void put_psr(unsigned int new_psr)
35 {
36 __asm__ __volatile__(
37 "wr %0, 0x0, %%psr\n\t"
38 "nop\n\t"
39 "nop\n\t"
40 "nop\n\t"
41 :
42 : "r" (new_psr)
43 : "memory", "cc");
44 }
45
46
47
48
49
50
51 extern unsigned int fsr_storage;
52
53 static inline unsigned int get_fsr(void)
54 {
55 unsigned int fsr = 0;
56
57 __asm__ __volatile__(
58 "st %%fsr, %1\n\t"
59 "ld %1, %0\n\t"
60 : "=r" (fsr)
61 : "m" (fsr_storage));
62
63 return fsr;
64 }
65
66 #endif
67
68 #endif