Skip to content

Commit

Permalink
[POWERPC] 4xx: Add mfspr/mtspr inline macros to 4xx bootwrapper
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Herrenschmidt authored and Josh Boyer committed Dec 23, 2007
1 parent d23f509 commit ee41eea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/powerpc/boot/reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit ee41eea

Please sign in to comment.