ia64/xen-unstable

view linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/irq_vectors.h @ 2933:23aab6d318e5

bitkeeper revision 1.1159.1.402 (419237a47HFvsgYMiaOKsiwlfCoycw)

Fix prototype.
author cl349@freefall.cl.cam.ac.uk
date Wed Nov 10 15:45:40 2004 +0000 (2004-11-10)
parents cbdc0480194e
children b35c932069a7
line source
1 /*
2 * This file should contain #defines for all of the interrupt vector
3 * numbers used by this architecture.
4 *
5 * In addition, there are some standard defines:
6 *
7 * FIRST_EXTERNAL_VECTOR:
8 * The first free place for external interrupts
9 *
10 * SYSCALL_VECTOR:
11 * The IRQ vector a syscall makes the user to kernel transition
12 * under.
13 *
14 * TIMER_IRQ:
15 * The IRQ number the timer interrupt comes in at.
16 *
17 * NR_IRQS:
18 * The total number of interrupt vectors (including all the
19 * architecture specific interrupts) needed.
20 *
21 */
22 #ifndef _ASM_IRQ_VECTORS_H
23 #define _ASM_IRQ_VECTORS_H
25 /*
26 * IDT vectors usable for external interrupt sources start
27 * at 0x20:
28 */
29 #define FIRST_EXTERNAL_VECTOR 0x20
31 #define SYSCALL_VECTOR 0x80
33 /*
34 * Vectors 0x20-0x2f are used for ISA interrupts.
35 */
37 /*
38 * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
39 *
40 * some of the following vectors are 'rare', they are merged
41 * into a single vector (CALL_FUNCTION_VECTOR) to save vector space.
42 * TLB, reschedule and local APIC vectors are performance-critical.
43 *
44 * Vectors 0xf0-0xfa are free (reserved for future Linux use).
45 */
46 #define SPURIOUS_APIC_VECTOR 0xff
47 #define ERROR_APIC_VECTOR 0xfe
48 #define INVALIDATE_TLB_VECTOR 0xfd
49 #define RESCHEDULE_VECTOR 0xfc
50 #define CALL_FUNCTION_VECTOR 0xfb
52 #define THERMAL_APIC_VECTOR 0xf0
53 /*
54 * Local APIC timer IRQ vector is on a different priority level,
55 * to work around the 'lost local interrupt if more than 2 IRQ
56 * sources per level' errata.
57 */
58 #define LOCAL_TIMER_VECTOR 0xef
60 /*
61 * First APIC vector available to drivers: (vectors 0x30-0xee)
62 * we start at 0x31 to spread out vectors evenly between priority
63 * levels. (0x80 is the syscall vector)
64 */
65 #define FIRST_DEVICE_VECTOR 0x31
66 #define FIRST_SYSTEM_VECTOR 0xef
68 /* #define TIMER_IRQ _EVENT_TIMER */
70 /*
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)
78 */
80 /*
81 * The maximum number of vectors supported by i386 processors
82 * is limited to 256. For processors other than i386, NR_VECTORS
83 * should be changed accordingly.
84 */
85 #define NR_VECTORS 256
87 #if 0
88 #ifdef CONFIG_PCI_USE_VECTOR
89 #define NR_IRQS FIRST_SYSTEM_VECTOR
90 #define NR_IRQ_VECTORS NR_IRQS
91 #else
92 #ifdef CONFIG_X86_IO_APIC
93 #define NR_IRQS 224
94 # if (224 >= 32 * NR_CPUS)
95 # define NR_IRQ_VECTORS NR_IRQS
96 # else
97 # define NR_IRQ_VECTORS (32 * NR_CPUS)
98 # endif
99 #else
100 #define NR_IRQS 16
101 #define NR_IRQ_VECTORS NR_IRQS
102 #endif
103 #endif
104 #endif
106 #define FPU_IRQ 13
108 #define FIRST_VM86_IRQ 3
109 #define LAST_VM86_IRQ 15
110 #define invalid_vm86_irq(irq) ((irq) < 3 || (irq) > 15)
112 /*
113 * The flat IRQ space is divided into two regions:
114 * 1. A one-to-one mapping of real physical IRQs. This space is only used
115 * if we have physical device-access privilege. This region is at the
116 * start of the IRQ space so that existing device drivers do not need
117 * to be modified to translate physical IRQ numbers into our IRQ space.
118 * 3. A dynamic mapping of inter-domain and Xen-sourced virtual IRQs. These
119 * are bound using the provided bind/unbind functions.
120 */
122 #define PIRQ_BASE 0
123 #define NR_PIRQS 128
125 #define DYNIRQ_BASE (PIRQ_BASE + NR_PIRQS)
126 #define NR_DYNIRQS 128
128 #define NR_IRQS (NR_PIRQS + NR_DYNIRQS)
129 #define NR_IRQ_VECTORS NR_IRQS
131 #define pirq_to_irq(_x) ((_x) + PIRQ_BASE)
132 #define irq_to_pirq(_x) ((_x) - PIRQ_BASE)
134 #define dynirq_to_irq(_x) ((_x) + DYNIRQ_BASE)
135 #define irq_to_dynirq(_x) ((_x) - DYNIRQ_BASE)
137 #ifndef __ASSEMBLY__
138 /* Dynamic binding of event channels and VIRQ sources to Linux IRQ space. */
139 extern int bind_virq_to_irq(int virq);
140 extern void unbind_virq_from_irq(int virq);
141 extern void bind_ipi_on_cpu(int cpu, int ipi);
142 extern void unbind_ipi_on_cpu(int cpu, int ipi);
143 extern int bind_evtchn_to_irq(int evtchn);
144 extern void unbind_evtchn_from_irq(int evtchn);
146 extern void irq_suspend(void);
147 extern void irq_resume(void);
148 #endif /* __ASSEMBLY__ */
150 #endif /* _ASM_IRQ_VECTORS_H */