[TG3]: Add tagged status support.
[linux-2.6/verdex.git] / include / asm-ppc / hw_irq.h
blob47dc7990fb26e35645bc4637fc80e3af25049a3b
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
8 #include <asm/ptrace.h>
9 #include <asm/reg.h>
11 extern void timer_interrupt(struct pt_regs *);
13 #define INLINE_IRQS
15 #define irqs_disabled() ((mfmsr() & MSR_EE) == 0)
17 #ifdef INLINE_IRQS
19 static inline void local_irq_disable(void)
21 unsigned long msr;
22 msr = mfmsr();
23 mtmsr(msr & ~MSR_EE);
24 __asm__ __volatile__("": : :"memory");
27 static inline void local_irq_enable(void)
29 unsigned long msr;
30 __asm__ __volatile__("": : :"memory");
31 msr = mfmsr();
32 mtmsr(msr | MSR_EE);
35 static inline void local_irq_save_ptr(unsigned long *flags)
37 unsigned long msr;
38 msr = mfmsr();
39 *flags = msr;
40 mtmsr(msr & ~MSR_EE);
41 __asm__ __volatile__("": : :"memory");
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)
48 #else
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 *);
55 #define local_save_flags(flags) local_save_flags_ptr(&flags)
56 #define local_irq_save(flags) ({local_save_flags(flags);local_irq_disable();})
58 #endif
60 extern void do_lost_interrupts(unsigned long);
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);})
66 /* Should we handle this via lost interrupts and IPIs or should we don't care like
67 * we do now ? --BenH.
69 struct hw_interrupt_type;
70 static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
73 #endif /* _PPC_HW_IRQ_H */
74 #endif /* __KERNEL__ */