powerpc/32: add helper to write into segment registers
This patch add an helper which wraps 'mtsrin' instruction to write into segment registers. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
df25f86390
commit
02d5d13b45
@ -1425,6 +1425,11 @@ static inline void msr_check_and_clear(unsigned long bits)
|
||||
#define mfsrin(v) ({unsigned int rval; \
|
||||
asm volatile("mfsrin %0,%1" : "=r" (rval) : "r" (v)); \
|
||||
rval;})
|
||||
|
||||
static inline void mtsrin(u32 val, u32 idx)
|
||||
{
|
||||
asm volatile("mtsrin %0, %1" : : "r" (val), "r" (idx));
|
||||
}
|
||||
#endif
|
||||
|
||||
#define proc_trap() asm volatile("trap")
|
||||
|
Loading…
x
Reference in New Issue
Block a user