0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef __LINUX_SPARC_PSR_H
0012 #define __LINUX_SPARC_PSR_H
0013
0014 #include <uapi/asm/psr.h>
0015
0016
0017 #ifndef __ASSEMBLY__
0018
0019 static inline unsigned int get_psr(void)
0020 {
0021 unsigned int psr;
0022 __asm__ __volatile__(
0023 "rd %%psr, %0\n\t"
0024 "nop\n\t"
0025 "nop\n\t"
0026 "nop\n\t"
0027 : "=r" (psr)
0028 :
0029 : "memory");
0030
0031 return psr;
0032 }
0033
0034 static inline void put_psr(unsigned int new_psr)
0035 {
0036 __asm__ __volatile__(
0037 "wr %0, 0x0, %%psr\n\t"
0038 "nop\n\t"
0039 "nop\n\t"
0040 "nop\n\t"
0041 :
0042 : "r" (new_psr)
0043 : "memory", "cc");
0044 }
0045
0046
0047
0048
0049
0050
0051 extern unsigned int fsr_storage;
0052
0053 static inline unsigned int get_fsr(void)
0054 {
0055 unsigned int fsr = 0;
0056
0057 __asm__ __volatile__(
0058 "st %%fsr, %1\n\t"
0059 "ld %1, %0\n\t"
0060 : "=r" (fsr)
0061 : "m" (fsr_storage));
0062
0063 return fsr;
0064 }
0065
0066 #endif
0067
0068 #endif