aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/desc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/desc.h')
-rw-r--r--include/asm-x86/desc.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
index 268a012bcd79..b3875d4b4fab 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)
311 _set_gate(n, GATE_INTERRUPT, addr, 0, 0, __KERNEL_CS); 311 _set_gate(n, GATE_INTERRUPT, addr, 0, 0, __KERNEL_CS);
312} 312}
313 313
314#define SYS_VECTOR_FREE 0
315#define SYS_VECTOR_ALLOCED 1
316
317extern int first_system_vector;
318extern char system_vectors[];
319
320static inline void alloc_system_vector(int vector)
321{
322 if (system_vectors[vector] == SYS_VECTOR_FREE) {
323 system_vectors[vector] = SYS_VECTOR_ALLOCED;
324 if (first_system_vector > vector)
325 first_system_vector = vector;
326 } else
327 BUG();
328}
329
330static inline void alloc_intr_gate(unsigned int n, void *addr)
331{
332 alloc_system_vector(n);
333 set_intr_gate(n, addr);
334}
335
314/* 336/*
315 * This routine sets up an interrupt gate at directory privilege level 3. 337 * This routine sets up an interrupt gate at directory privilege level 3.
316 */ 338 */