2 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
4 #ifndef _ASM_POWERPC_RUNLATCH_H
5 #define _ASM_POWERPC_RUNLATCH_H
9 extern void __ppc64_runlatch_on(void);
10 extern void __ppc64_runlatch_off(void);
13 * We manually hard enable-disable, this is called
14 * in the idle loop and we don't want to mess up
15 * with soft-disable/enable & interrupt replay.
17 #define ppc64_runlatch_off() \
19 if (cpu_has_feature(CPU_FTR_CTRL) && \
20 test_thread_local_flags(_TLF_RUNLATCH)) { \
21 unsigned long msr = mfmsr(); \
22 __hard_irq_disable(); \
23 __ppc64_runlatch_off(); \
25 __hard_irq_enable(); \
29 #define ppc64_runlatch_on() \
31 if (cpu_has_feature(CPU_FTR_CTRL) && \
32 !test_thread_local_flags(_TLF_RUNLATCH)) { \
33 unsigned long msr = mfmsr(); \
34 __hard_irq_disable(); \
35 __ppc64_runlatch_on(); \
37 __hard_irq_enable(); \
41 #define ppc64_runlatch_on()
42 #define ppc64_runlatch_off()
43 #endif /* CONFIG_PPC64 */
45 #endif /* _ASM_POWERPC_RUNLATCH_H */