diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-08 09:53:57 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 09:53:57 +0200 |
commit | 1b8ba39a3fad9c58532f6dad12c94d6e675be656 (patch) | |
tree | 9ae9b4c4545b4c91f5dbb3a1085c4c721961c4f2 /include/asm-x86/desc.h | |
parent | 58cf35228fec541418cc3bd781d6c069d904815e (diff) | |
parent | cbd6712406a3ea861b49fbfd46e23cbf5f8e073f (diff) |
Merge branch 'x86/irq' into x86/devel
Conflicts:
arch/x86/kernel/i8259.c
arch/x86/kernel/irqinit_64.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/desc.h')
-rw-r--r-- | include/asm-x86/desc.h | 22 |
1 files changed, 22 insertions, 0 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. */ |