diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-12-21 05:39:32 +0100 |
---|---|---|
committer | Josh Boyer <jwboyer@linux.vnet.ibm.com> | 2007-12-23 20:14:22 +0100 |
commit | ee41eea947ebe2f1f627fafe0e429b5dcaaab944 (patch) | |
tree | edbd01b730cf1e8c2f836cd281ab7d5b0ad39557 /arch/powerpc/boot | |
parent | [POWERPC] 4xx: Adds decoding of 440SPE memory size to boot wrapper library (diff) | |
download | linux-ee41eea947ebe2f1f627fafe0e429b5dcaaab944.tar.xz linux-ee41eea947ebe2f1f627fafe0e429b5dcaaab944.zip |
[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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r-- | arch/powerpc/boot/reg.h | 8 |
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) 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"); #define get_sp() (__stack_pointer) |