1 /* SPDX-License-Identifier: GPL-2.0 */
5 #ifndef _ASM_POWERPC_RUNLATCH_H
6 #define _ASM_POWERPC_RUNLATCH_H
10 extern void __ppc64_runlatch_on(void);
11 extern void __ppc64_runlatch_off(void);
14 * We manually hard enable-disable, this is called
15 * in the idle loop and we don't want to mess up
16 * with soft-disable/enable & interrupt replay.
18 #define ppc64_runlatch_off() \
20 if (cpu_has_feature(CPU_FTR_CTRL) && \
21 test_thread_local_flags(_TLF_RUNLATCH)) { \
22 __hard_irq_disable(); \
23 __ppc64_runlatch_off(); \
24 if (!(local_paca->irq_happened & PACA_IRQ_HARD_DIS)) \
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 __hard_irq_disable(); \
34 __ppc64_runlatch_on(); \
35 if (!(local_paca->irq_happened & PACA_IRQ_HARD_DIS)) \
36 __hard_irq_enable(); \
40 #define ppc64_runlatch_on()
41 #define ppc64_runlatch_off()
42 #endif /* CONFIG_PPC64 */
44 #endif /* _ASM_POWERPC_RUNLATCH_H */