aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/reg.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/boot/reg.h')
-rw-r--r--arch/powerpc/boot/reg.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/boot/reg.h b/arch/powerpc/boot/reg.h
index d3cd9ee98afb..9c2c9978e0eb 100644
--- a/arch/powerpc/boot/reg.h
+++ b/arch/powerpc/boot/reg.h
@@ -16,6 +16,14 @@ static inline u32 mfpvr(void)
16 return pvr; 16 return pvr;
17} 17}
18 18
19#define __stringify_1(x) #x
20#define __stringify(x) __stringify_1(x)
21
22#define mfspr(rn) ({unsigned long rval; \
23 asm volatile("mfspr %0," __stringify(rn) \
24 : "=r" (rval)); rval; })
25#define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v))
26
19register void *__stack_pointer asm("r1"); 27register void *__stack_pointer asm("r1");
20#define get_sp() (__stack_pointer) 28#define get_sp() (__stack_pointer)
21 29