2 * Copyright (C) 1996 Paul Mackerras.
4 #include <linux/config.h>
7 static inline int get_ ## reg (void) \
8 { int ret; asm volatile ("mf" #reg " %0" : "=r" (ret) :); return ret; }
11 static inline void set_ ## reg (int val) \
12 { asm volatile ("mt" #reg " %0" : : "r" (val)); }
18 #define GSETSPR(n, name) \
19 static inline int get_ ## name (void) \
20 { int ret; asm volatile ("mfspr %0," #n : "=r" (ret) : ); return ret; } \
21 static inline void set_ ## name (int val) \
22 { asm volatile ("mtspr " #n ",%0" : : "r" (val)); }
64 static inline int get_sr(int n
)
68 asm (" mfsrin %0,%1" : "=r" (ret
) : "r" (n
<< 28));
72 static inline void set_sr(int n
, int val
)
74 asm ("mtsrin %0,%1" : : "r" (val
), "r" (n
<< 28));
77 static inline void store_inst(void *p
)
79 asm volatile ("dcbst 0,%0; sync; icbi 0,%0; isync" : : "r" (p
));
82 static inline void cflush(void *p
)
84 asm volatile ("dcbf 0,%0; icbi 0,%0" : : "r" (p
));
87 static inline void cinval(void *p
)
89 asm volatile ("dcbi 0,%0; icbi 0,%0" : : "r" (p
));