From a40a953d9a73703c660e3c9a6d7d856543e90a3f Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Fri, 21 Dec 2007 15:39:32 +1100 Subject: [PATCH] --- yaml --- r: 81177 b: refs/heads/master c: ee41eea947ebe2f1f627fafe0e429b5dcaaab944 h: refs/heads/master i: 81175: 2a9878b8490e376adb5b1b942731995663af8d80 v: v3 --- [refs] | 2 +- trunk/arch/powerpc/boot/reg.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 1830d3f1cf26..b2fe1d14d541 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d23f5099297c0f017ba4fb165dc9879bda11f9ce +refs/heads/master: ee41eea947ebe2f1f627fafe0e429b5dcaaab944 diff --git a/trunk/arch/powerpc/boot/reg.h b/trunk/arch/powerpc/boot/reg.h index d3cd9ee98afb..9c2c9978e0eb 100644 --- a/trunk/arch/powerpc/boot/reg.h +++ b/trunk/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)