d306b75bc77f00323ce26a14558ddd0e98d9e127
[linux-3.10.git] / arch / parisc / include / asm / special_insns.h
1 #ifndef __PARISC_SPECIAL_INSNS_H
2 #define __PARISC_SPECIAL_INSNS_H
3
4 #define mfctl(reg)      ({              \
5         unsigned long cr;               \
6         __asm__ __volatile__(           \
7                 "mfctl " #reg ",%0" :   \
8                  "=r" (cr)              \
9         );                              \
10         cr;                             \
11 })
12
13 #define mtctl(gr, cr) \
14         __asm__ __volatile__("mtctl %0,%1" \
15                 : /* no outputs */ \
16                 : "r" (gr), "i" (cr) : "memory")
17
18 /* these are here to de-mystefy the calling code, and to provide hooks */
19 /* which I needed for debugging EIEM problems -PB */
20 #define get_eiem() mfctl(15)
21 static inline void set_eiem(unsigned long val)
22 {
23         mtctl(val, 15);
24 }
25
26 #define mfsp(reg)       ({              \
27         unsigned long cr;               \
28         __asm__ __volatile__(           \
29                 "mfsp " #reg ",%0" :    \
30                  "=r" (cr)              \
31         );                              \
32         cr;                             \
33 })
34
35 #define mtsp(gr, cr) \
36         __asm__ __volatile__("mtsp %0,%1" \
37                 : /* no outputs */ \
38                 : "r" (gr), "i" (cr) : "memory")
39
40 #endif /* __PARISC_SPECIAL_INSNS_H */