aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-30 20:48:17 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-30 22:21:23 -0500
commit9fc2e79d4f239c1c1dfdab7b10854c7588b39d9a (patch)
treea2dfed0244c60a74495e9b7a2008f3f1df50e6d8 /arch/x86/include/asm
parent3e92ab3d7e2edef5dccd8b0db21528699c81d2c0 (diff)
x86, irq: add IRQ layout comments
Describe the layout of x86 trap/exception/IRQ vectors and clean up indentation and other small details. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r--arch/x86/include/asm/irq_vectors.h92
1 files changed, 58 insertions, 34 deletions
diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h
index 81fc883b3c05..5f7d6a1e3d28 100644
--- a/arch/x86/include/asm/irq_vectors.h
+++ b/arch/x86/include/asm/irq_vectors.h
@@ -3,45 +3,69 @@
3 3
4#include <linux/threads.h> 4#include <linux/threads.h>
5 5
6#define NMI_VECTOR 0x02 6/*
7 * Linux IRQ vector layout.
8 *
9 * There are 256 IDT entries (per CPU - each entry is 8 bytes) which can
10 * be defined by Linux. They are used as a jump table by the CPU when a
11 * given vector is triggered - by a CPU-external, CPU-internal or
12 * software-triggered event.
13 *
14 * Linux sets the kernel code address each entry jumps to early during
15 * bootup, and never changes them. This is the general layout of the
16 * IDT entries:
17 *
18 * Vectors 0 ... 31 : system traps and exceptions - hardcoded events
19 * Vectors 32 ... 127 : device interrupts
20 * Vector 128 : legacy int80 syscall interface
21 * Vectors 129 ... 237 : device interrupts
22 * Vectors 238 ... 255 : special interrupts
23 *
24 * 64-bit x86 has per CPU IDT tables, 32-bit has one shared IDT table.
25 *
26 * This file enumerates the exact layout of them:
27 */
28
29#define NMI_VECTOR 0x02
7 30
8/* 31/*
9 * IDT vectors usable for external interrupt sources start 32 * IDT vectors usable for external interrupt sources start
10 * at 0x20: 33 * at 0x20:
11 */ 34 */
12#define FIRST_EXTERNAL_VECTOR 0x20 35#define FIRST_EXTERNAL_VECTOR 0x20
13 36
14#ifdef CONFIG_X86_32 37#ifdef CONFIG_X86_32
15# define SYSCALL_VECTOR 0x80 38# define SYSCALL_VECTOR 0x80
16#else 39#else
17# define IA32_SYSCALL_VECTOR 0x80 40# define IA32_SYSCALL_VECTOR 0x80
18#endif 41#endif
19 42
20/* 43/*
21 * Reserve the lowest usable priority level 0x20 - 0x2f for triggering 44 * Reserve the lowest usable priority level 0x20 - 0x2f for triggering
22 * cleanup after irq migration. 45 * cleanup after irq migration.
23 */ 46 */
24#define IRQ_MOVE_CLEANUP_VECTOR FIRST_EXTERNAL_VECTOR 47#define IRQ_MOVE_CLEANUP_VECTOR FIRST_EXTERNAL_VECTOR
25 48
26/* 49/*
27 * Vectors 0x30-0x3f are used for ISA interrupts. 50 * Vectors 0x30-0x3f are used for ISA interrupts.
28 */ 51 */
29#define IRQ0_VECTOR (FIRST_EXTERNAL_VECTOR + 0x10) 52#define IRQ0_VECTOR (FIRST_EXTERNAL_VECTOR + 0x10)
30#define IRQ1_VECTOR (IRQ0_VECTOR + 1) 53
31#define IRQ2_VECTOR (IRQ0_VECTOR + 2) 54#define IRQ1_VECTOR (IRQ0_VECTOR + 1)
32#define IRQ3_VECTOR (IRQ0_VECTOR + 3) 55#define IRQ2_VECTOR (IRQ0_VECTOR + 2)
33#define IRQ4_VECTOR (IRQ0_VECTOR + 4) 56#define IRQ3_VECTOR (IRQ0_VECTOR + 3)
34#define IRQ5_VECTOR (IRQ0_VECTOR + 5) 57#define IRQ4_VECTOR (IRQ0_VECTOR + 4)
35#define IRQ6_VECTOR (IRQ0_VECTOR + 6) 58#define IRQ5_VECTOR (IRQ0_VECTOR + 5)
36#define IRQ7_VECTOR (IRQ0_VECTOR + 7) 59#define IRQ6_VECTOR (IRQ0_VECTOR + 6)
37#define IRQ8_VECTOR (IRQ0_VECTOR + 8) 60#define IRQ7_VECTOR (IRQ0_VECTOR + 7)
38#define IRQ9_VECTOR (IRQ0_VECTOR + 9) 61#define IRQ8_VECTOR (IRQ0_VECTOR + 8)
39#define IRQ10_VECTOR (IRQ0_VECTOR + 10) 62#define IRQ9_VECTOR (IRQ0_VECTOR + 9)
40#define IRQ11_VECTOR (IRQ0_VECTOR + 11) 63#define IRQ10_VECTOR (IRQ0_VECTOR + 10)
41#define IRQ12_VECTOR (IRQ0_VECTOR + 12) 64#define IRQ11_VECTOR (IRQ0_VECTOR + 11)
42#define IRQ13_VECTOR (IRQ0_VECTOR + 13) 65#define IRQ12_VECTOR (IRQ0_VECTOR + 12)
43#define IRQ14_VECTOR (IRQ0_VECTOR + 14) 66#define IRQ13_VECTOR (IRQ0_VECTOR + 13)
44#define IRQ15_VECTOR (IRQ0_VECTOR + 15) 67#define IRQ14_VECTOR (IRQ0_VECTOR + 14)
68#define IRQ15_VECTOR (IRQ0_VECTOR + 15)
45 69
46/* 70/*
47 * Special IRQ vectors used by the SMP architecture, 0xf0-0xff 71 * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
@@ -75,36 +99,36 @@
75/* f0-f7 used for spreading out TLB flushes: */ 99/* f0-f7 used for spreading out TLB flushes: */
76#define INVALIDATE_TLB_VECTOR_END 0xf7 100#define INVALIDATE_TLB_VECTOR_END 0xf7
77#define INVALIDATE_TLB_VECTOR_START 0xf0 101#define INVALIDATE_TLB_VECTOR_START 0xf0
78#define NUM_INVALIDATE_TLB_VECTORS 8 102#define NUM_INVALIDATE_TLB_VECTORS 8
79 103
80/* 104/*
81 * Local APIC timer IRQ vector is on a different priority level, 105 * Local APIC timer IRQ vector is on a different priority level,
82 * to work around the 'lost local interrupt if more than 2 IRQ 106 * to work around the 'lost local interrupt if more than 2 IRQ
83 * sources per level' errata. 107 * sources per level' errata.
84 */ 108 */
85#define LOCAL_TIMER_VECTOR 0xef 109#define LOCAL_TIMER_VECTOR 0xef
86 110
87/* 111/*
88 * Performance monitoring interrupt vector: 112 * Performance monitoring interrupt vector:
89 */ 113 */
90#define LOCAL_PERF_VECTOR 0xee 114#define LOCAL_PERF_VECTOR 0xee
91 115
92/* 116/*
93 * First APIC vector available to drivers: (vectors 0x30-0xee) we 117 * First APIC vector available to drivers: (vectors 0x30-0xee) we
94 * start at 0x31(0x41) to spread out vectors evenly between priority 118 * start at 0x31(0x41) to spread out vectors evenly between priority
95 * levels. (0x80 is the syscall vector) 119 * levels. (0x80 is the syscall vector)
96 */ 120 */
97#define FIRST_DEVICE_VECTOR (IRQ15_VECTOR + 2) 121#define FIRST_DEVICE_VECTOR (IRQ15_VECTOR + 2)
98 122
99#define NR_VECTORS 256 123#define NR_VECTORS 256
100 124
101#define FPU_IRQ 13 125#define FPU_IRQ 13
102 126
103#define FIRST_VM86_IRQ 3 127#define FIRST_VM86_IRQ 3
104#define LAST_VM86_IRQ 15 128#define LAST_VM86_IRQ 15
105#define invalid_vm86_irq(irq) ((irq) < 3 || (irq) > 15) 129#define invalid_vm86_irq(irq) ((irq) < 3 || (irq) > 15)
106 130
107#define NR_IRQS_LEGACY 16 131#define NR_IRQS_LEGACY 16
108 132
109#ifdef CONFIG_X86_IO_APIC 133#ifdef CONFIG_X86_IO_APIC
110 134
@@ -112,9 +136,9 @@
112 136
113#ifndef CONFIG_SPARSE_IRQ 137#ifndef CONFIG_SPARSE_IRQ
114# if NR_CPUS < MAX_IO_APICS 138# if NR_CPUS < MAX_IO_APICS
115# define NR_IRQS (NR_VECTORS + (32 * NR_CPUS)) 139# define NR_IRQS (NR_VECTORS + (32 * NR_CPUS))
116# else 140# else
117# define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS)) 141# define NR_IRQS (NR_VECTORS + (32 * MAX_IO_APICS))
118# endif 142# endif
119#else 143#else
120# define NR_IRQS \ 144# define NR_IRQS \
@@ -124,7 +148,7 @@
124#endif 148#endif
125 149
126#else /* !CONFIG_X86_IO_APIC: */ 150#else /* !CONFIG_X86_IO_APIC: */
127# define NR_IRQS 16 151# define NR_IRQS 16
128#endif 152#endif
129 153
130#endif /* _ASM_X86_IRQ_VECTORS_H */ 154#endif /* _ASM_X86_IRQ_VECTORS_H */