aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/io_apic_32.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2007-10-19 14:35:03 -0400
committerThomas Gleixner <tglx@linutronix.de>2007-10-19 14:35:03 -0400
commitdbeb2be21d678c49a8d8bbf774903df15dd55474 (patch)
treecea1b478ec3af36134aa06633be1a45787f35f75 /arch/x86/kernel/io_apic_32.c
parent39743c9ef717fd4f2b5583f010115c5f2482b8ae (diff)
i386: introduce "used_vectors" bitmap which can be used to reserve vectors.
This simplifies the io_apic.c __assign_irq_vector() logic and removes the explicit SYSCALL_VECTOR check, and also allows for vectors to be reserved by other mechanisms (ie. lguest). [ tglx: arch/x86 adaptation ] Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/io_apic_32.c')
-rw-r--r--arch/x86/kernel/io_apic_32.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
index 5f10c718953..0c55e9d86f6 100644
--- a/arch/x86/kernel/io_apic_32.c
+++ b/arch/x86/kernel/io_apic_32.c
@@ -1198,7 +1198,7 @@ static u8 irq_vector[NR_IRQ_VECTORS] __read_mostly = { FIRST_DEVICE_VECTOR , 0 }
1198static int __assign_irq_vector(int irq) 1198static int __assign_irq_vector(int irq)
1199{ 1199{
1200 static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0; 1200 static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0;
1201 int vector, offset, i; 1201 int vector, offset;
1202 1202
1203 BUG_ON((unsigned)irq >= NR_IRQ_VECTORS); 1203 BUG_ON((unsigned)irq >= NR_IRQ_VECTORS);
1204 1204
@@ -1215,11 +1215,8 @@ next:
1215 } 1215 }
1216 if (vector == current_vector) 1216 if (vector == current_vector)
1217 return -ENOSPC; 1217 return -ENOSPC;
1218 if (vector == SYSCALL_VECTOR) 1218 if (test_and_set_bit(vector, used_vectors))
1219 goto next; 1219 goto next;
1220 for (i = 0; i < NR_IRQ_VECTORS; i++)
1221 if (irq_vector[i] == vector)
1222 goto next;
1223 1220
1224 current_vector = vector; 1221 current_vector = vector;
1225 current_offset = offset; 1222 current_offset = offset;
@@ -2295,6 +2292,12 @@ static inline void __init check_timer(void)
2295 2292
2296void __init setup_IO_APIC(void) 2293void __init setup_IO_APIC(void)
2297{ 2294{
2295 int i;
2296
2297 /* Reserve all the system vectors. */
2298 for (i = FIRST_SYSTEM_VECTOR; i < NR_VECTORS; i++)
2299 set_bit(i, used_vectors);
2300
2298 enable_IO_APIC(); 2301 enable_IO_APIC();
2299 2302
2300 if (acpi_ioapic) 2303 if (acpi_ioapic)