diff options
Diffstat (limited to 'include/asm-powerpc/hw_irq.h')
-rw-r--r-- | include/asm-powerpc/hw_irq.h | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/include/asm-powerpc/hw_irq.h b/include/asm-powerpc/hw_irq.h index d40359204aba..c4a1ab608f6f 100644 --- a/include/asm-powerpc/hw_irq.h +++ b/include/asm-powerpc/hw_irq.h | |||
@@ -7,16 +7,30 @@ | |||
7 | #ifdef __KERNEL__ | 7 | #ifdef __KERNEL__ |
8 | 8 | ||
9 | #include <linux/errno.h> | 9 | #include <linux/errno.h> |
10 | #include <linux/compiler.h> | ||
10 | #include <asm/ptrace.h> | 11 | #include <asm/ptrace.h> |
11 | #include <asm/processor.h> | 12 | #include <asm/processor.h> |
12 | 13 | ||
13 | extern void timer_interrupt(struct pt_regs *); | 14 | extern void timer_interrupt(struct pt_regs *); |
14 | 15 | ||
15 | #ifdef CONFIG_PPC_ISERIES | 16 | #ifdef CONFIG_PPC64 |
17 | #include <asm/paca.h> | ||
18 | |||
19 | static inline unsigned long local_get_flags(void) | ||
20 | { | ||
21 | return get_paca()->soft_enabled; | ||
22 | } | ||
23 | |||
24 | static inline unsigned long local_irq_disable(void) | ||
25 | { | ||
26 | unsigned long flag = get_paca()->soft_enabled; | ||
27 | get_paca()->soft_enabled = 0; | ||
28 | barrier(); | ||
29 | return flag; | ||
30 | } | ||
16 | 31 | ||
17 | extern unsigned long local_get_flags(void); | ||
18 | extern unsigned long local_irq_disable(void); | ||
19 | extern void local_irq_restore(unsigned long); | 32 | extern void local_irq_restore(unsigned long); |
33 | extern void iseries_handle_interrupts(void); | ||
20 | 34 | ||
21 | #define local_irq_enable() local_irq_restore(1) | 35 | #define local_irq_enable() local_irq_restore(1) |
22 | #define local_save_flags(flags) ((flags) = local_get_flags()) | 36 | #define local_save_flags(flags) ((flags) = local_get_flags()) |
@@ -24,17 +38,14 @@ extern void local_irq_restore(unsigned long); | |||
24 | 38 | ||
25 | #define irqs_disabled() (local_get_flags() == 0) | 39 | #define irqs_disabled() (local_get_flags() == 0) |
26 | 40 | ||
41 | #define hard_irq_enable() __mtmsrd(mfmsr() | MSR_EE, 1) | ||
42 | #define hard_irq_disable() __mtmsrd(mfmsr() & ~MSR_EE, 1) | ||
43 | |||
27 | #else | 44 | #else |
28 | 45 | ||
29 | #if defined(CONFIG_BOOKE) | 46 | #if defined(CONFIG_BOOKE) |
30 | #define SET_MSR_EE(x) mtmsr(x) | 47 | #define SET_MSR_EE(x) mtmsr(x) |
31 | #define local_irq_restore(flags) __asm__ __volatile__("wrtee %0" : : "r" (flags) : "memory") | 48 | #define local_irq_restore(flags) __asm__ __volatile__("wrtee %0" : : "r" (flags) : "memory") |
32 | #elif defined(__powerpc64__) | ||
33 | #define SET_MSR_EE(x) __mtmsrd(x, 1) | ||
34 | #define local_irq_restore(flags) do { \ | ||
35 | __asm__ __volatile__("": : :"memory"); \ | ||
36 | __mtmsrd((flags), 1); \ | ||
37 | } while(0) | ||
38 | #else | 49 | #else |
39 | #define SET_MSR_EE(x) mtmsr(x) | 50 | #define SET_MSR_EE(x) mtmsr(x) |
40 | #define local_irq_restore(flags) mtmsr(flags) | 51 | #define local_irq_restore(flags) mtmsr(flags) |
@@ -81,7 +92,7 @@ static inline void local_irq_save_ptr(unsigned long *flags) | |||
81 | #define local_irq_save(flags) local_irq_save_ptr(&flags) | 92 | #define local_irq_save(flags) local_irq_save_ptr(&flags) |
82 | #define irqs_disabled() ((mfmsr() & MSR_EE) == 0) | 93 | #define irqs_disabled() ((mfmsr() & MSR_EE) == 0) |
83 | 94 | ||
84 | #endif /* CONFIG_PPC_ISERIES */ | 95 | #endif /* CONFIG_PPC64 */ |
85 | 96 | ||
86 | #define mask_irq(irq) \ | 97 | #define mask_irq(irq) \ |
87 | ({ \ | 98 | ({ \ |