diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-ppc/hw_irq.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/asm-ppc/hw_irq.h')
-rw-r--r-- | include/asm-ppc/hw_irq.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/include/asm-ppc/hw_irq.h b/include/asm-ppc/hw_irq.h new file mode 100644 index 000000000000..47dc7990fb26 --- /dev/null +++ b/include/asm-ppc/hw_irq.h | |||
@@ -0,0 +1,74 @@ | |||
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 | |||
11 | extern void timer_interrupt(struct pt_regs *); | ||
12 | |||
13 | #define INLINE_IRQS | ||
14 | |||
15 | #define irqs_disabled() ((mfmsr() & MSR_EE) == 0) | ||
16 | |||
17 | #ifdef INLINE_IRQS | ||
18 | |||
19 | static inline void local_irq_disable(void) | ||
20 | { | ||
21 | unsigned long msr; | ||
22 | msr = mfmsr(); | ||
23 | mtmsr(msr & ~MSR_EE); | ||
24 | __asm__ __volatile__("": : :"memory"); | ||
25 | } | ||
26 | |||
27 | static inline void local_irq_enable(void) | ||
28 | { | ||
29 | unsigned long msr; | ||
30 | __asm__ __volatile__("": : :"memory"); | ||
31 | msr = mfmsr(); | ||
32 | mtmsr(msr | MSR_EE); | ||
33 | } | ||
34 | |||
35 | static inline void local_irq_save_ptr(unsigned long *flags) | ||
36 | { | ||
37 | unsigned long msr; | ||
38 | msr = mfmsr(); | ||
39 | *flags = msr; | ||
40 | mtmsr(msr & ~MSR_EE); | ||
41 | __asm__ __volatile__("": : :"memory"); | ||
42 | } | ||
43 | |||
44 | #define local_save_flags(flags) ((flags) = mfmsr()) | ||
45 | #define local_irq_save(flags) local_irq_save_ptr(&flags) | ||
46 | #define local_irq_restore(flags) mtmsr(flags) | ||
47 | |||
48 | #else | ||
49 | |||
50 | extern void local_irq_enable(void); | ||
51 | extern void local_irq_disable(void); | ||
52 | extern void local_irq_restore(unsigned long); | ||
53 | extern void local_save_flags_ptr(unsigned long *); | ||
54 | |||
55 | #define local_save_flags(flags) local_save_flags_ptr(&flags) | ||
56 | #define local_irq_save(flags) ({local_save_flags(flags);local_irq_disable();}) | ||
57 | |||
58 | #endif | ||
59 | |||
60 | extern void do_lost_interrupts(unsigned long); | ||
61 | |||
62 | #define mask_irq(irq) ({if (irq_desc[irq].handler && irq_desc[irq].handler->disable) irq_desc[irq].handler->disable(irq);}) | ||
63 | #define unmask_irq(irq) ({if (irq_desc[irq].handler && irq_desc[irq].handler->enable) irq_desc[irq].handler->enable(irq);}) | ||
64 | #define ack_irq(irq) ({if (irq_desc[irq].handler && irq_desc[irq].handler->ack) irq_desc[irq].handler->ack(irq);}) | ||
65 | |||
66 | /* Should we handle this via lost interrupts and IPIs or should we don't care like | ||
67 | * we do now ? --BenH. | ||
68 | */ | ||
69 | struct hw_interrupt_type; | ||
70 | static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {} | ||
71 | |||
72 | |||
73 | #endif /* _PPC_HW_IRQ_H */ | ||
74 | #endif /* __KERNEL__ */ | ||