- Update Xen patches to 3.3-rc5 and c/s 1157.
[linux-flexiantxendom0-3.2.10.git] / arch / x86 / include / mach-xen / asm / irq_vectors.h
1 #ifndef _ASM_X86_IRQ_VECTORS_H
2 #define _ASM_X86_IRQ_VECTORS_H
3
4 #define MCE_VECTOR                      0x12
5
6 #define IA32_SYSCALL_VECTOR             0x80
7 #ifdef CONFIG_X86_32
8 # define SYSCALL_VECTOR                 0x80
9 #endif
10
11 #define RESCHEDULE_VECTOR               0
12 #define CALL_FUNCTION_VECTOR            1
13 #define NMI_VECTOR                      0x02
14 #define CALL_FUNC_SINGLE_VECTOR         3
15 #define REBOOT_VECTOR                   4
16 #ifdef CONFIG_IRQ_WORK
17 #define IRQ_WORK_VECTOR                 5
18 #define NR_IPIS                         6
19 #else
20 #define NR_IPIS                         5
21 #endif
22
23 /*
24  * The maximum number of vectors supported by i386 processors
25  * is limited to 256. For processors other than i386, NR_VECTORS
26  * should be changed accordingly.
27  */
28 #define NR_VECTORS                       256
29
30 #define FIRST_VM86_IRQ                     3
31 #define LAST_VM86_IRQ                     15
32
33 #ifndef __ASSEMBLY__
34 static inline int invalid_vm86_irq(int irq)
35 {
36         return irq < FIRST_VM86_IRQ || irq > LAST_VM86_IRQ;
37 }
38 #endif
39
40 /*
41  * Size the maximum number of interrupts.
42  *
43  * If the irq_desc[] array has a sparse layout, we can size things
44  * generously - it scales up linearly with the maximum number of CPUs,
45  * and the maximum number of IO-APICs, whichever is higher.
46  *
47  * In other cases we size more conservatively, to not create too large
48  * static arrays.
49  */
50
51 #define NR_IRQS_LEGACY                    16
52
53 /*
54  * The flat IRQ space is divided into two regions:
55  *  1. A one-to-one mapping of real physical IRQs. This space is only used
56  *     if we have physical device-access privilege. This region is at the
57  *     start of the IRQ space so that existing device drivers do not need
58  *     to be modified to translate physical IRQ numbers into our IRQ space.
59  *  3. A dynamic mapping of inter-domain and Xen-sourced virtual IRQs. These
60  *     are bound using the provided bind/unbind functions.
61  */
62 #define PIRQ_BASE                       0
63 /* PHYSDEVOP_pirq_eoi_gmfn restriction: */
64 #define PIRQ_MAX(n) ((n) < (1 << (PAGE_SHIFT + 3)) - NR_VECTORS \
65                    ? (n) : (1 << (PAGE_SHIFT + 3)) - NR_VECTORS)
66
67 #define IO_APIC_VECTOR_LIMIT            PIRQ_MAX(32 * MAX_IO_APICS)
68 #define CPU_VECTOR_LIMIT                PIRQ_MAX(64 * NR_CPUS)
69
70 #if defined(CONFIG_X86_IO_APIC)
71 # define NR_PIRQS                                       \
72         (CPU_VECTOR_LIMIT > IO_APIC_VECTOR_LIMIT ?      \
73                 (NR_VECTORS + CPU_VECTOR_LIMIT)  :      \
74                 (NR_VECTORS + IO_APIC_VECTOR_LIMIT))
75 #elif defined(CONFIG_XEN_PCIDEV_FRONTEND)
76 # define NR_PIRQS                       (NR_VECTORS + CPU_VECTOR_LIMIT)
77 #else /* !CONFIG_X86_IO_APIC: */
78 # define NR_PIRQS                       NR_IRQS_LEGACY
79 #endif
80
81 #ifndef __ASSEMBLY__
82 #ifdef CONFIG_SPARSE_IRQ
83 extern int nr_pirqs;
84 #else
85 # define nr_pirqs                       NR_PIRQS
86 #endif
87 #endif
88
89 #define DYNIRQ_BASE                     (PIRQ_BASE + nr_pirqs)
90 #ifdef CONFIG_SPARSE_IRQ
91 #define NR_DYNIRQS                      (CPU_VECTOR_LIMIT + CONFIG_XEN_NR_GUEST_DEVICES)
92 #else
93 #define NR_DYNIRQS                      (64 + CONFIG_XEN_NR_GUEST_DEVICES)
94 #endif
95
96 #define NR_IRQS                         (NR_PIRQS + NR_DYNIRQS)
97
98 #endif /* _ASM_X86_IRQ_VECTORS_H */