]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
powerpc/32: add helper to write into segment registers
authorChristophe Leroy <christophe.leroy@c-s.fr>
Thu, 21 Feb 2019 19:08:44 +0000 (19:08 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 23 Feb 2019 10:04:32 +0000 (21:04 +1100)
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>
arch/powerpc/include/asm/reg.h

index 1f79e1d8fb0bbb473a5c6db16e25c0814b364451..c25880e6a16afeacc07869884fc39e7a09443a89 100644 (file)
@@ -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")