powerpc: move set_msr() and get_msr() into .h
authorChristophe Leroy <christophe.leroy@c-s.fr>
Thu, 13 Jul 2017 13:09:52 +0000 (15:09 +0200)
committerTom Rini <trini@konsulko.com>
Sun, 23 Jul 2017 02:22:49 +0000 (22:22 -0400)
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>
arch/powerpc/include/asm/ppc.h
arch/powerpc/lib/interrupts.c
arch/powerpc/lib/kgdb.c

index c6aa2f0..89f08ec 100644 (file)
@@ -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
index 5031357..ccba829 100644 (file)
@@ -33,20 +33,6 @@ extern void timer_interrupt_cpu (struct pt_regs *);
 
 static unsigned decrementer_count; /* count value for 1e6/HZ microseconds */
 
-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));
-}
-
 static __inline__ unsigned long get_dec (void)
 {
        unsigned long val;
index 88c2af2..aa16a00 100644 (file)
@@ -38,20 +38,6 @@ kgdb_longjmp(long *buf, int val)
             : "=&r"(temp) : "r" (buf), "r" (val));
 }
 
-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));
-}
-
 /* Convert the SPARC hardware trap type code to a unix signal number. */
 /*
  * This table contains the mapping between PowerPC hardware trap types, and