1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
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 unsigned long msr = mfmsr(); \
23 __hard_irq_disable(); \
24 __ppc64_runlatch_off(); \
26 __hard_irq_enable(); \
30 #define ppc64_runlatch_on() \
32 if (cpu_has_feature(CPU_FTR_CTRL) && \
33 !test_thread_local_flags(_TLF_RUNLATCH)) { \
34 unsigned long msr = mfmsr(); \
35 __hard_irq_disable(); \
36 __ppc64_runlatch_on(); \
38 __hard_irq_enable(); \
42 #define ppc64_runlatch_on()
43 #define ppc64_runlatch_off()
44 #endif /* CONFIG_PPC64 */
46 #endif /* _ASM_POWERPC_RUNLATCH_H */