Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02d5d13b authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman
Browse files

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: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent df25f863
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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")