aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/reg.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-02-29 20:45:27 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-03-08 18:55:02 -0500
commitfe1952fc0afb9a2e4c79f103c08aef5d13db1873 (patch)
treeea1fc050910844e3c72d8fa576e7bf429c09d788 /arch/powerpc/include/asm/reg.h
parent7450f6f03e9d6dc95d2014c4cceac8adf98560e8 (diff)
powerpc: Rework runlatch code
This moves the inlines into system.h and changes the runlatch code to use the thread local flags (non-atomic) rather than the TIF flags (atomic) to keep track of the latch state. The code to turn it back on in an asynchronous interrupt is now simplified and partially inlined. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/reg.h')
-rw-r--r--arch/powerpc/include/asm/reg.h22
1 files changed, 2 insertions, 20 deletions
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 7fdc2c0b7fa0..b1a215eabef6 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -1079,30 +1079,12 @@
1079 1079
1080#define proc_trap() asm volatile("trap") 1080#define proc_trap() asm volatile("trap")
1081 1081
1082#ifdef CONFIG_PPC64 1082#define __get_SP() ({unsigned long sp; \
1083 1083 asm volatile("mr %0,1": "=r" (sp)); sp;})
1084extern void ppc64_runlatch_on(void);
1085extern void __ppc64_runlatch_off(void);
1086
1087#define ppc64_runlatch_off() \
1088 do { \
1089 if (cpu_has_feature(CPU_FTR_CTRL) && \
1090 test_thread_flag(TIF_RUNLATCH)) \
1091 __ppc64_runlatch_off(); \
1092 } while (0)
1093 1084
1094extern unsigned long scom970_read(unsigned int address); 1085extern unsigned long scom970_read(unsigned int address);
1095extern void scom970_write(unsigned int address, unsigned long value); 1086extern void scom970_write(unsigned int address, unsigned long value);
1096 1087
1097#else
1098#define ppc64_runlatch_on()
1099#define ppc64_runlatch_off()
1100
1101#endif /* CONFIG_PPC64 */
1102
1103#define __get_SP() ({unsigned long sp; \
1104 asm volatile("mr %0,1": "=r" (sp)); sp;})
1105
1106struct pt_regs; 1088struct pt_regs;
1107 1089
1108extern void ppc_save_regs(struct pt_regs *regs); 1090extern void ppc_save_regs(struct pt_regs *regs);