aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlan Mayer <ajm@sgi.com>2008-04-15 15:36:56 -0500
committerIngo Molnar <mingo@elte.hu>2008-05-12 21:28:06 +0200
commit305b92a2323eeaa4b481f409d54f778dd7e21a46 (patch)
tree0f32832b033de27b2ae5909bb06d4eabdd1a9b0b /include
parent1a331957efd214fc3a84f70956dfaec65e70c031 (diff)
x86: change FIRST_SYSTEM_VECTOR to a variable
The SGI UV system needs several more system vectors than a vanilla x86_64 system. Rather than burden the other archs with extra system vectors that they don't use, change FIRST_SYSTEM_VECTOR to a variable, so that it can be dynamic. Signed-off-by: Alan Mayer <ajm@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/desc.h22
-rw-r--r--include/asm-x86/irq_vectors.h2
2 files changed, 22 insertions, 2 deletions
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
index 268a012bcd7..b3875d4b4fa 100644
--- a/include/asm-x86/desc.h
+++ b/include/asm-x86/desc.h
@@ -311,6 +311,28 @@ static inline void set_intr_gate(unsigned int n, void *addr)
_set_gate(n, GATE_INTERRUPT, addr, 0, 0, __KERNEL_CS);
}
+#define SYS_VECTOR_FREE 0
+#define SYS_VECTOR_ALLOCED 1
+
+extern int first_system_vector;
+extern char system_vectors[];
+
+static inline void alloc_system_vector(int vector)
+{
+ if (system_vectors[vector] == SYS_VECTOR_FREE) {
+ system_vectors[vector] = SYS_VECTOR_ALLOCED;
+ if (first_system_vector > vector)
+ first_system_vector = vector;
+ } else
+ BUG();
+}
+
+static inline void alloc_intr_gate(unsigned int n, void *addr)
+{
+ alloc_system_vector(n);
+ set_intr_gate(n, addr);
+}
+
/*
* This routine sets up an interrupt gate at directory privilege level 3.
*/
diff --git a/include/asm-x86/irq_vectors.h b/include/asm-x86/irq_vectors.h
index daceaaf0a3a..3cb6d8c77b3 100644
--- a/include/asm-x86/irq_vectors.h
+++ b/include/asm-x86/irq_vectors.h
@@ -96,8 +96,6 @@
# define FIRST_DEVICE_VECTOR (IRQ15_VECTOR + 2)
#endif
-#define FIRST_SYSTEM_VECTOR 0xef
-
#define NR_VECTORS 256
#define FPU_IRQ 13