2 * This file should contain #defines for all of the interrupt vector
3 * numbers used by this architecture.
5 * In addition, there are some standard defines:
7 * FIRST_EXTERNAL_VECTOR:
8 * The first free place for external interrupts
11 * The IRQ vector a syscall makes the user to kernel transition
15 * The IRQ number the timer interrupt comes in at.
18 * The total number of interrupt vectors (including all the
19 * architecture specific interrupts) needed.
22 #ifndef _ASM_IRQ_VECTORS_H
23 #define _ASM_IRQ_VECTORS_H
26 * IDT vectors usable for external interrupt sources start
29 #define FIRST_EXTERNAL_VECTOR 0x20
31 #define SYSCALL_VECTOR 0x80
34 * Vectors 0x20-0x2f are used for ISA interrupts.
39 * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
41 * some of the following vectors are 'rare', they are merged
42 * into a single vector (CALL_FUNCTION_VECTOR) to save vector space.
43 * TLB, reschedule and local APIC vectors are performance-critical.
45 * Vectors 0xf0-0xfa are free (reserved for future Linux use).
47 #define SPURIOUS_APIC_VECTOR 0xff
48 #define ERROR_APIC_VECTOR 0xfe
49 #define INVALIDATE_TLB_VECTOR 0xfd
50 #define RESCHEDULE_VECTOR 0xfc
51 #define CALL_FUNCTION_VECTOR 0xfb
53 #define THERMAL_APIC_VECTOR 0xf0
55 * Local APIC timer IRQ vector is on a different priority level,
56 * to work around the 'lost local interrupt if more than 2 IRQ
57 * sources per level' errata.
59 #define LOCAL_TIMER_VECTOR 0xef
63 * First APIC vector available to drivers: (vectors 0x30-0xee)
64 * we start at 0x31 to spread out vectors evenly between priority
65 * levels. (0x80 is the syscall vector)
67 #define FIRST_DEVICE_VECTOR 0x31
68 #define FIRST_SYSTEM_VECTOR 0xef
71 * 16 8259A IRQ's, 208 potential APIC interrupt sources.
72 * Right now the APIC is mostly only used for SMP.
73 * 256 vectors is an architectural limit. (we can have
74 * more than 256 devices theoretically, but they will
75 * have to use shared interrupts)
76 * Since vectors 0x00-0x1f are used/reserved for the CPU,
77 * the usable vector space is 0x20-0xff (224 vectors)
82 #define RESCHEDULE_VECTOR 1
83 #define INVALIDATE_TLB_VECTOR 2
84 #define CALL_FUNCTION_VECTOR 3
87 * The maximum number of vectors supported by i386 processors
88 * is limited to 256. For processors other than i386, NR_VECTORS
89 * should be changed accordingly.
91 #define NR_VECTORS 256
95 #define FIRST_VM86_IRQ 3
96 #define LAST_VM86_IRQ 15
97 #define invalid_vm86_irq(irq) ((irq) < 3 || (irq) > 15)
100 * The flat IRQ space is divided into two regions:
101 * 1. A one-to-one mapping of real physical IRQs. This space is only used
102 * if we have physical device-access privilege. This region is at the
103 * start of the IRQ space so that existing device drivers do not need
104 * to be modified to translate physical IRQ numbers into our IRQ space.
105 * 3. A dynamic mapping of inter-domain and Xen-sourced virtual IRQs. These
106 * are bound using the provided bind/unbind functions.
112 #define DYNIRQ_BASE (PIRQ_BASE + NR_PIRQS)
113 #define NR_DYNIRQS 256
115 #define NR_IRQS (NR_PIRQS + NR_DYNIRQS)
116 #define NR_IRQ_VECTORS NR_IRQS
118 #define pirq_to_irq(_x) ((_x) + PIRQ_BASE)
119 #define irq_to_pirq(_x) ((_x) - PIRQ_BASE)
121 #define dynirq_to_irq(_x) ((_x) + DYNIRQ_BASE)
122 #define irq_to_dynirq(_x) ((_x) - DYNIRQ_BASE)
125 /* Dynamic binding of event channels and VIRQ sources to Linux IRQ space. */
126 extern int bind_virq_to_irq(int virq);
127 extern void unbind_virq_from_irq(int virq);
128 extern int bind_ipi_on_cpu_to_irq(int cpu, int ipi);
129 extern void unbind_ipi_on_cpu_from_irq(int cpu, int ipi);
130 extern int bind_evtchn_to_irq(int evtchn);
131 extern void unbind_evtchn_from_irq(int evtchn);
133 extern void irq_suspend(void);
134 extern void irq_resume(void);
135 #endif /* __ASSEMBLY__ */
137 #endif /* _ASM_IRQ_VECTORS_H */