diff options
author | Kumar Gala <galak@freescale.com> | 2005-09-21 17:52:55 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-09-22 07:03:34 -0400 |
commit | b671ad2befe37131af380183760862d5cbad858d (patch) | |
tree | c6c27d4adf742f360e5056f435601254f050781d /include/asm-ppc | |
parent | fa2ac7a25f1b11c4a695c9288339d0476ecfaf38 (diff) |
[PATCH] powerpc: merged hw_irq.h
Merged hw_irq.h between ppc32 & ppc64. Added support to use the Book-E
wrtee[i] instructions that allow modifying MSR[EE] atomically.
Additionally, added get_irq_desc() macros to ppc32 to allow mask_irq(),
unmask_irq(), and ack_irq() to be common between ppc32 & ppc64.
Note: because 64-bit Book-E implementations only have a 32-bit MSR the
macro's for Book-E need to come before the PPC64 macro's to ensure the
right thing happends for 64-bit Book-E processors.
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-ppc')
-rw-r--r-- | include/asm-ppc/hw_irq.h | 59 | ||||
-rw-r--r-- | include/asm-ppc/irq.h | 6 |
2 files changed, 6 insertions, 59 deletions
diff --git a/include/asm-ppc/hw_irq.h b/include/asm-ppc/hw_irq.h deleted file mode 100644 index da0fa940adb3..000000000000 --- a/include/asm-ppc/hw_irq.h +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu> | ||
3 | */ | ||
4 | #ifdef __KERNEL__ | ||
5 | #ifndef _PPC_HW_IRQ_H | ||
6 | #define _PPC_HW_IRQ_H | ||
7 | |||
8 | #include <asm/ptrace.h> | ||
9 | #include <asm/reg.h> | ||
10 | #include <asm/irq.h> | ||
11 | |||
12 | extern void timer_interrupt(struct pt_regs *); | ||
13 | |||
14 | #define irqs_disabled() ((mfmsr() & MSR_EE) == 0) | ||
15 | |||
16 | static inline void local_irq_disable(void) | ||
17 | { | ||
18 | unsigned long msr; | ||
19 | msr = mfmsr(); | ||
20 | mtmsr(msr & ~MSR_EE); | ||
21 | __asm__ __volatile__("": : :"memory"); | ||
22 | } | ||
23 | |||
24 | static inline void local_irq_enable(void) | ||
25 | { | ||
26 | unsigned long msr; | ||
27 | __asm__ __volatile__("": : :"memory"); | ||
28 | msr = mfmsr(); | ||
29 | mtmsr(msr | MSR_EE); | ||
30 | } | ||
31 | |||
32 | static inline void local_irq_save_ptr(unsigned long *flags) | ||
33 | { | ||
34 | unsigned long msr; | ||
35 | msr = mfmsr(); | ||
36 | *flags = msr; | ||
37 | mtmsr(msr & ~MSR_EE); | ||
38 | __asm__ __volatile__("": : :"memory"); | ||
39 | } | ||
40 | |||
41 | #define local_save_flags(flags) ((flags) = mfmsr()) | ||
42 | #define local_irq_save(flags) local_irq_save_ptr(&flags) | ||
43 | #define local_irq_restore(flags) mtmsr(flags) | ||
44 | |||
45 | extern void do_lost_interrupts(unsigned long); | ||
46 | |||
47 | #define mask_irq(irq) ({if (irq_desc[irq].handler && irq_desc[irq].handler->disable) irq_desc[irq].handler->disable(irq);}) | ||
48 | #define unmask_irq(irq) ({if (irq_desc[irq].handler && irq_desc[irq].handler->enable) irq_desc[irq].handler->enable(irq);}) | ||
49 | #define ack_irq(irq) ({if (irq_desc[irq].handler && irq_desc[irq].handler->ack) irq_desc[irq].handler->ack(irq);}) | ||
50 | |||
51 | /* Should we handle this via lost interrupts and IPIs or should we don't care like | ||
52 | * we do now ? --BenH. | ||
53 | */ | ||
54 | struct hw_interrupt_type; | ||
55 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} | ||
56 | |||
57 | |||
58 | #endif /* _PPC_HW_IRQ_H */ | ||
59 | #endif /* __KERNEL__ */ | ||
diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h index bd9674807f05..137ea0cf34d3 100644 --- a/include/asm-ppc/irq.h +++ b/include/asm-ppc/irq.h | |||
@@ -24,6 +24,12 @@ | |||
24 | */ | 24 | */ |
25 | #define ARCH_HAS_IRQ_PER_CPU | 25 | #define ARCH_HAS_IRQ_PER_CPU |
26 | 26 | ||
27 | #define get_irq_desc(irq) (&irq_desc[(irq)]) | ||
28 | |||
29 | /* Define a way to iterate across irqs. */ | ||
30 | #define for_each_irq(i) \ | ||
31 | for ((i) = 0; (i) < NR_IRQS; ++(i)) | ||
32 | |||
27 | #if defined(CONFIG_40x) | 33 | #if defined(CONFIG_40x) |
28 | #include <asm/ibm4xx.h> | 34 | #include <asm/ibm4xx.h> |
29 | 35 | ||