diff options
Diffstat (limited to 'include/asm-powerpc/hw_irq.h')
-rw-r--r-- | include/asm-powerpc/hw_irq.h | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/include/asm-powerpc/hw_irq.h b/include/asm-powerpc/hw_irq.h index d40359204ab..d604863d72f 100644 --- a/include/asm-powerpc/hw_irq.h +++ b/include/asm-powerpc/hw_irq.h | |||
@@ -7,16 +7,40 @@ | |||
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 | unsigned long flags; | ||
22 | |||
23 | __asm__ __volatile__("lbz %0,%1(13)" | ||
24 | : "=r" (flags) | ||
25 | : "i" (offsetof(struct paca_struct, soft_enabled))); | ||
26 | |||
27 | return flags; | ||
28 | } | ||
29 | |||
30 | static inline unsigned long local_irq_disable(void) | ||
31 | { | ||
32 | unsigned long flags, zero; | ||
33 | |||
34 | __asm__ __volatile__("li %1,0; lbz %0,%2(13); stb %1,%2(13)" | ||
35 | : "=r" (flags), "=&r" (zero) | ||
36 | : "i" (offsetof(struct paca_struct, soft_enabled)) | ||
37 | : "memory"); | ||
38 | |||
39 | return flags; | ||
40 | } | ||
16 | 41 | ||
17 | extern unsigned long local_get_flags(void); | ||
18 | extern unsigned long local_irq_disable(void); | ||
19 | extern void local_irq_restore(unsigned long); | 42 | extern void local_irq_restore(unsigned long); |
43 | extern void iseries_handle_interrupts(void); | ||
20 | 44 | ||
21 | #define local_irq_enable() local_irq_restore(1) | 45 | #define local_irq_enable() local_irq_restore(1) |
22 | #define local_save_flags(flags) ((flags) = local_get_flags()) | 46 | #define local_save_flags(flags) ((flags) = local_get_flags()) |
@@ -24,17 +48,14 @@ extern void local_irq_restore(unsigned long); | |||
24 | 48 | ||
25 | #define irqs_disabled() (local_get_flags() == 0) | 49 | #define irqs_disabled() (local_get_flags() == 0) |
26 | 50 | ||
51 | #define hard_irq_enable() __mtmsrd(mfmsr() | MSR_EE, 1) | ||
52 | #define hard_irq_disable() __mtmsrd(mfmsr() & ~MSR_EE, 1) | ||
53 | |||
27 | #else | 54 | #else |
28 | 55 | ||
29 | #if defined(CONFIG_BOOKE) | 56 | #if defined(CONFIG_BOOKE) |
30 | #define SET_MSR_EE(x) mtmsr(x) | 57 | #define SET_MSR_EE(x) mtmsr(x) |
31 | #define local_irq_restore(flags) __asm__ __volatile__("wrtee %0" : : "r" (flags) : "memory") | 58 | #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 | 59 | #else |
39 | #define SET_MSR_EE(x) mtmsr(x) | 60 | #define SET_MSR_EE(x) mtmsr(x) |
40 | #define local_irq_restore(flags) mtmsr(flags) | 61 | #define local_irq_restore(flags) mtmsr(flags) |
@@ -81,7 +102,10 @@ static inline void local_irq_save_ptr(unsigned long *flags) | |||
81 | #define local_irq_save(flags) local_irq_save_ptr(&flags) | 102 | #define local_irq_save(flags) local_irq_save_ptr(&flags) |
82 | #define irqs_disabled() ((mfmsr() & MSR_EE) == 0) | 103 | #define irqs_disabled() ((mfmsr() & MSR_EE) == 0) |
83 | 104 | ||
84 | #endif /* CONFIG_PPC_ISERIES */ | 105 | #define hard_irq_enable() local_irq_enable() |
106 | #define hard_irq_disable() local_irq_disable() | ||
107 | |||
108 | #endif /* CONFIG_PPC64 */ | ||
85 | 109 | ||
86 | #define mask_irq(irq) \ | 110 | #define mask_irq(irq) \ |
87 | ({ \ | 111 | ({ \ |