Commit ee41eea947ebe2f1f627fafe0e429b5dcaaab944

Authored by Benjamin Herrenschmidt
Committed by Josh Boyer
1 parent d23f509929

[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>

Showing 1 changed file with 8 additions and 0 deletions Side-by-side Diff

arch/powerpc/boot/reg.h
... ... @@ -16,6 +16,14 @@
16 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 +
19 27 register void *__stack_pointer asm("r1");
20 28 #define get_sp() (__stack_pointer)
21 29