summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/local_apic.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-11-14 19:10:13 +0000
committerjhb <jhb@FreeBSD.org>2003-11-14 19:10:13 +0000
commit97b2405ad5f3fa180e58b14034ad2770115404d5 (patch)
treeb2a31e6bc77203dd36c1b80cfb3608775750e0fe /sys/amd64/amd64/local_apic.c
parent29f07789b1fc26f60bc1c931437f78725f1bc994 (diff)
downloadFreeBSD-src-97b2405ad5f3fa180e58b14034ad2770115404d5.zip
FreeBSD-src-97b2405ad5f3fa180e58b14034ad2770115404d5.tar.gz
Shuffle the APIC interrupt vectors around a bit:
- Move the IPI and local APIC interrupt vectors up into the 0xf0 - 0xff range. The pmap lazyfix IPI was reordered down next to the TLB shootdowns to avoid conflicting with the spurious interrupt vector. - Move the base of APIC interrupts up 16 so that the first 16 APIC interrupts do not overlap the vectors used by the ATPIC. - Remove bogus interrupt vector reservations for LINT[01]. - Now that 0xc0 - 0xef are available, use them for device interrupts. This increases the number of APIC device interrupts to 191. - Increase the system-wide number of global interrupts to 191 to catch up to more APIC interrupts. Requested by: peter (2)
Diffstat (limited to 'sys/amd64/amd64/local_apic.c')
-rw-r--r--sys/amd64/amd64/local_apic.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/amd64/amd64/local_apic.c b/sys/amd64/amd64/local_apic.c
index 3fb7f76..6f942bf 100644
--- a/sys/amd64/amd64/local_apic.c
+++ b/sys/amd64/amd64/local_apic.c
@@ -59,6 +59,10 @@ __FBSDID("$FreeBSD$");
*/
#define MAX_APICID 16
+/* Sanity checks on IDT vectors. */
+CTASSERT(APIC_IO_INTS + APIC_NUM_IOINTS <= APIC_LOCAL_INTS);
+CTASSERT(IPI_STOP < APIC_SPURIOUS_INT);
+
/*
* Support for local APICs. Local APICs manage interrupts on each
* individual processor as opposed to I/O APICs which receive interrupts
@@ -104,8 +108,8 @@ static inthand_t *ioint_handlers[] = {
IDTVEC(apic_isr3), /* 96 - 127 */
IDTVEC(apic_isr4), /* 128 - 159 */
IDTVEC(apic_isr5), /* 160 - 191 */
- NULL, /* 192 - 223 */
- NULL /* 224 - 255 */
+ IDTVEC(apic_isr6), /* 192 - 223 */
+ IDTVEC(apic_isr7), /* 224 - 255 */
};
volatile lapic_t *lapic;
@@ -491,7 +495,7 @@ apic_irq_to_idt(u_int irq)
u_int vector;
KASSERT(irq < NUM_IO_INTS, ("Invalid IRQ %u", irq));
- vector = irq + IDT_IO_INTS;
+ vector = irq + APIC_IO_INTS;
if (vector >= IDT_SYSCALL)
vector++;
return (vector);
@@ -501,12 +505,12 @@ u_int
apic_idt_to_irq(u_int vector)
{
- KASSERT(vector >= IDT_IO_INTS && vector != IDT_SYSCALL &&
- vector <= IDT_IO_INTS + NUM_IO_INTS,
+ KASSERT(vector >= APIC_IO_INTS && vector != IDT_SYSCALL &&
+ vector <= APIC_IO_INTS + NUM_IO_INTS,
("Vector %u does not map to an IRQ line", vector));
if (vector > IDT_SYSCALL)
vector--;
- return (vector - IDT_IO_INTS);
+ return (vector - APIC_IO_INTS);
}
/*
OpenPOWER on IntegriCloud