powerpc: Unify the 32 and 64 bit idle loops
[safe/jmp/linux-2.6] / include / asm-powerpc / reg.h
index 12ecc9b..bd467bf 100644 (file)
 #define proc_trap()    asm volatile("trap")
 
 #ifdef CONFIG_PPC64
-static inline void ppc64_runlatch_on(void)
-{
-       unsigned long ctrl;
-
-       if (cpu_has_feature(CPU_FTR_CTRL)) {
-               ctrl = mfspr(SPRN_CTRLF);
-               ctrl |= CTRL_RUNLATCH;
-               mtspr(SPRN_CTRLT, ctrl);
-       }
-}
-
-static inline void ppc64_runlatch_off(void)
-{
-       unsigned long ctrl;
-
-       if (cpu_has_feature(CPU_FTR_CTRL)) {
-               ctrl = mfspr(SPRN_CTRLF);
-               ctrl &= ~CTRL_RUNLATCH;
-               mtspr(SPRN_CTRLT, ctrl);
-       }
-}
+
+extern void ppc64_runlatch_on(void);
+extern void ppc64_runlatch_off(void);
 
 extern unsigned long scom970_read(unsigned int address);
 extern void scom970_write(unsigned int address, unsigned long value);
 
+#else
+#define ppc64_runlatch_on()
+#define ppc64_runlatch_off()
+
 #endif /* CONFIG_PPC64 */
 
 #define __get_SP()     ({unsigned long sp; \
                        asm volatile("mr %0,1": "=r" (sp)); sp;})
 
-#else /* __ASSEMBLY__ */
-
-#define RUNLATCH_ON(REG)                       \
-BEGIN_FTR_SECTION                              \
-       mfspr   (REG),SPRN_CTRLF;               \
-       ori     (REG),(REG),CTRL_RUNLATCH;      \
-       mtspr   SPRN_CTRLT,(REG);               \
-END_FTR_SECTION_IFSET(CPU_FTR_CTRL)
-
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_REG_H */