Commit ee41eea9 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Josh Boyer

[POWERPC] 4xx: Add mfspr/mtspr inline macros to 4xx bootwrapper

The 4xx bootwrapper occasionally needs to access SPR registers,
this adds mfspr/mtspr wrappers to it.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarJosh Boyer <jwboyer@linux.vnet.ibm.com>
parent d23f5099
...@@ -16,6 +16,14 @@ static inline u32 mfpvr(void) ...@@ -16,6 +16,14 @@ static inline u32 mfpvr(void)
return pvr; return pvr;
} }
#define __stringify_1(x) #x
#define __stringify(x) __stringify_1(x)
#define mfspr(rn) ({unsigned long rval; \
asm volatile("mfspr %0," __stringify(rn) \
: "=r" (rval)); rval; })
#define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v))
register void *__stack_pointer asm("r1"); register void *__stack_pointer asm("r1");
#define get_sp() (__stack_pointer) #define get_sp() (__stack_pointer)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment