5 * linux/include/asm/hw_irq.h
7 * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
9 * moved some of the old arch/i386/kernel/irq.h to here. VY
11 * IRQ/IPI changes taken from work by Thomas Radke
12 * <tomsoft@informatik.tu-chemnitz.de>
14 * hacked by Andi Kleen for x86-64.
16 * $Id: hw_irq.h,v 1.24 2001/09/14 20:55:03 vojtech Exp $
20 #include <linux/config.h>
21 #include <asm/atomic.h>
23 #include <linux/profile.h>
24 #include <linux/smp.h>
26 struct hw_interrupt_type;
29 #define NMI_VECTOR 0x02
31 * IDT vectors usable for external interrupt sources start
34 #define FIRST_EXTERNAL_VECTOR 0x20
36 #define IA32_SYSCALL_VECTOR 0x80
40 * Vectors 0x20-0x2f are used for ISA interrupts.
44 * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
46 * some of the following vectors are 'rare', they are merged
47 * into a single vector (CALL_FUNCTION_VECTOR) to save vector space.
48 * TLB, reschedule and local APIC vectors are performance-critical.
51 #define SPURIOUS_APIC_VECTOR 0xff
52 #define ERROR_APIC_VECTOR 0xfe
53 #define RESCHEDULE_VECTOR 0xfd
54 #define CALL_FUNCTION_VECTOR 0xfc
55 /* fb free - please don't readd KDB here because it's useless
56 (hint - think what a NMI bit does to a vector) */
57 #define THERMAL_APIC_VECTOR 0xfa
58 #define THRESHOLD_APIC_VECTOR 0xf9
60 #define INVALIDATE_TLB_VECTOR_END 0xf7
61 #define INVALIDATE_TLB_VECTOR_START 0xf0 /* f0-f7 used for TLB flush */
63 #define NUM_INVALIDATE_TLB_VECTORS 8
67 * Local APIC timer IRQ vector is on a different priority level,
68 * to work around the 'lost local interrupt if more than 2 IRQ
69 * sources per level' errata.
71 #define LOCAL_TIMER_VECTOR 0xef
74 * First APIC vector available to drivers: (vectors 0x30-0xee)
75 * we start at 0x31 to spread out vectors evenly between priority
76 * levels. (0x80 is the syscall vector)
78 #define FIRST_DEVICE_VECTOR 0x31
79 #define FIRST_SYSTEM_VECTOR 0xef /* duplicated in irq.h */
83 extern u8 irq_vector[NR_IRQ_VECTORS];
84 #define IO_APIC_VECTOR(irq) (irq_vector[irq])
85 #define AUTO_ASSIGN -1
88 * Various low-level irq details needed by irq.c, process.c,
89 * time.c, io_apic.c and smp.c
91 * Interrupt entry/exit code at both C and assembly level
94 extern void disable_8259A_irq(unsigned int irq);
95 extern void enable_8259A_irq(unsigned int irq);
96 extern int i8259A_irq_pending(unsigned int irq);
97 extern void make_8259A_irq(unsigned int irq);
98 extern void init_8259A(int aeoi);
99 extern void FASTCALL(send_IPI_self(int vector));
100 extern void init_VISWS_APIC_irqs(void);
101 extern void setup_IO_APIC(void);
102 extern void disable_IO_APIC(void);
103 extern void print_IO_APIC(void);
104 extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
105 extern void send_IPI(int dest, int vector);
106 extern void setup_ioapic_dest(void);
108 extern unsigned long io_apic_irqs;
110 extern atomic_t irq_err_count;
111 extern atomic_t irq_mis_count;
113 #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
116 #define STR(x) __STR(x)
118 #include <asm/ptrace.h>
120 #define IRQ_NAME2(nr) nr##_interrupt(void)
121 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
124 * SMP has a few special interrupts for IPI messages
127 #define BUILD_IRQ(nr) \
128 asmlinkage void IRQ_NAME(nr); \
131 "IRQ" #nr "_interrupt:\n\t" \
132 "push $" #nr "-256 ; " \
133 "jmp common_interrupt");
135 extern void resend_irq_on_evtchn(struct hw_interrupt_type *h, unsigned int i);
136 static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
138 resend_irq_on_evtchn(h, i);
141 #define platform_legacy_irq(irq) ((irq) < 16)
145 #endif /* _ASM_HW_IRQ_H */