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