ia64/linux-2.6.18-xen.hg

view include/asm-i386/mach-xen/irq_vectors.h @ 661:7886619f623e

linux/pci-msi: translate Xen-provided PIRQs (take 2)

Previously, the kernel depended upon Xen's NR_IRQS to be no larger
than the kernel's NR_PIRQS.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Sep 08 13:13:35 2008 +0100 (2008-09-08)
parents ad374a7a9f3e
children 0ba49e9e74f9
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 #if 0
38 /*
39 * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
40 *
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.
44 *
45 * Vectors 0xf0-0xfa are free (reserved for future Linux use).
46 */
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
54 /*
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.
58 */
59 #define LOCAL_TIMER_VECTOR 0xef
60 #endif
62 #define SPURIOUS_APIC_VECTOR 0xff
63 #define ERROR_APIC_VECTOR 0xfe
65 /*
66 * First APIC vector available to drivers: (vectors 0x30-0xee)
67 * we start at 0x31 to spread out vectors evenly between priority
68 * levels. (0x80 is the syscall vector)
69 */
70 #define FIRST_DEVICE_VECTOR 0x31
71 #define FIRST_SYSTEM_VECTOR 0xef
73 /*
74 * 16 8259A IRQ's, 208 potential APIC interrupt sources.
75 * Right now the APIC is mostly only used for SMP.
76 * 256 vectors is an architectural limit. (we can have
77 * more than 256 devices theoretically, but they will
78 * have to use shared interrupts)
79 * Since vectors 0x00-0x1f are used/reserved for the CPU,
80 * the usable vector space is 0x20-0xff (224 vectors)
81 */
83 #define RESCHEDULE_VECTOR 0
84 #define CALL_FUNCTION_VECTOR 1
85 #define NR_IPIS 2
87 /*
88 * The maximum number of vectors supported by i386 processors
89 * is limited to 256. For processors other than i386, NR_VECTORS
90 * should be changed accordingly.
91 */
92 #define NR_VECTORS 256
94 #define FPU_IRQ 13
96 #define FIRST_VM86_IRQ 3
97 #define LAST_VM86_IRQ 15
98 #define invalid_vm86_irq(irq) ((irq) < 3 || (irq) > 15)
100 /*
101 * The flat IRQ space is divided into two regions:
102 * 1. A one-to-one mapping of real physical IRQs. This space is only used
103 * if we have physical device-access privilege. This region is at the
104 * start of the IRQ space so that existing device drivers do not need
105 * to be modified to translate physical IRQ numbers into our IRQ space.
106 * 3. A dynamic mapping of inter-domain and Xen-sourced virtual IRQs. These
107 * are bound using the provided bind/unbind functions.
108 */
110 #define PIRQ_BASE 0
111 #if !defined(MAX_IO_APICS)
112 # define NR_PIRQS (NR_VECTORS + 32 * NR_CPUS)
113 #elif NR_CPUS < MAX_IO_APICS
114 # define NR_PIRQS (NR_VECTORS + 32 * NR_CPUS)
115 #else
116 # define NR_PIRQS (NR_VECTORS + 32 * MAX_IO_APICS)
117 #endif
119 #define DYNIRQ_BASE (PIRQ_BASE + NR_PIRQS)
120 #define NR_DYNIRQS 256
122 #define NR_IRQS (NR_PIRQS + NR_DYNIRQS)
123 #define NR_IRQ_VECTORS NR_IRQS
125 #define pirq_to_irq(_x) ((_x) + PIRQ_BASE)
126 #define irq_to_pirq(_x) ((_x) - PIRQ_BASE)
128 #define dynirq_to_irq(_x) ((_x) + DYNIRQ_BASE)
129 #define irq_to_dynirq(_x) ((_x) - DYNIRQ_BASE)
131 #endif /* _ASM_IRQ_VECTORS_H */