diff options
Diffstat (limited to 'arch/powerpc/include/asm/system.h')
-rw-r--r-- | arch/powerpc/include/asm/system.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/system.h b/arch/powerpc/include/asm/system.h index c377457d1b89..a02883d5af43 100644 --- a/arch/powerpc/include/asm/system.h +++ b/arch/powerpc/include/asm/system.h | |||
@@ -550,5 +550,43 @@ extern void reloc_got2(unsigned long); | |||
550 | 550 | ||
551 | extern struct dentry *powerpc_debugfs_root; | 551 | extern struct dentry *powerpc_debugfs_root; |
552 | 552 | ||
553 | #ifdef CONFIG_PPC64 | ||
554 | |||
555 | extern void __ppc64_runlatch_on(void); | ||
556 | extern void __ppc64_runlatch_off(void); | ||
557 | |||
558 | /* | ||
559 | * We manually hard enable-disable, this is called | ||
560 | * in the idle loop and we don't want to mess up | ||
561 | * with soft-disable/enable & interrupt replay. | ||
562 | */ | ||
563 | #define ppc64_runlatch_off() \ | ||
564 | do { \ | ||
565 | if (cpu_has_feature(CPU_FTR_CTRL) && \ | ||
566 | test_thread_local_flags(_TLF_RUNLATCH)) { \ | ||
567 | unsigned long msr = mfmsr(); \ | ||
568 | __hard_irq_disable(); \ | ||
569 | __ppc64_runlatch_off(); \ | ||
570 | if (msr & MSR_EE) \ | ||
571 | __hard_irq_enable(); \ | ||
572 | } \ | ||
573 | } while (0) | ||
574 | |||
575 | #define ppc64_runlatch_on() \ | ||
576 | do { \ | ||
577 | if (cpu_has_feature(CPU_FTR_CTRL) && \ | ||
578 | !test_thread_local_flags(_TLF_RUNLATCH)) { \ | ||
579 | unsigned long msr = mfmsr(); \ | ||
580 | __hard_irq_disable(); \ | ||
581 | __ppc64_runlatch_on(); \ | ||
582 | if (msr & MSR_EE) \ | ||
583 | __hard_irq_enable(); \ | ||
584 | } \ | ||
585 | } while (0) | ||
586 | #else | ||
587 | #define ppc64_runlatch_on() | ||
588 | #define ppc64_runlatch_off() | ||
589 | #endif /* CONFIG_PPC64 */ | ||
590 | |||
553 | #endif /* __KERNEL__ */ | 591 | #endif /* __KERNEL__ */ |
554 | #endif /* _ASM_POWERPC_SYSTEM_H */ | 592 | #endif /* _ASM_POWERPC_SYSTEM_H */ |