summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2017-07-13 15:09:52 +0200
committerTom Rini <trini@konsulko.com>2017-07-22 22:22:49 -0400
commitf1cd73674ff19e62c69c942f23abb061c0a26072 (patch)
tree81123a9dc778db85f233dc23c69993eaffac9cde /arch/powerpc/include/asm
parentf0eda3cb89813c49d90fec7ee5fa69d3fe3d6daa (diff)
powerpc: move set_msr() and get_msr() into .h
set_msr() and get_msr() are defined and used twice. This patch moves them into ppc.h Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r--arch/powerpc/include/asm/ppc.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h
index c6aa2f0dfb..89f08eccc7 100644
--- a/arch/powerpc/include/asm/ppc.h
+++ b/arch/powerpc/include/asm/ppc.h
@@ -96,6 +96,20 @@ static inline ulong get_ddr_freq(ulong dummy)
ulong get_ddr_freq(ulong);
#endif
+static inline unsigned long get_msr(void)
+{
+ unsigned long msr;
+
+ asm volatile ("mfmsr %0" : "=r" (msr) : );
+
+ return msr;
+}
+
+static inline void set_msr(unsigned long msr)
+{
+ asm volatile ("mtmsr %0" : : "r" (msr));
+}
+
#endif /* !__ASSEMBLY__ */
#ifdef CONFIG_PPC