Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/x86/local_apic.c
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
CTASSERT(APIC_TIMER_INT < APIC_LOCAL_INTS); | CTASSERT(APIC_TIMER_INT < APIC_LOCAL_INTS); | ||||
CTASSERT(APIC_LOCAL_INTS == 240); | CTASSERT(APIC_LOCAL_INTS == 240); | ||||
CTASSERT(IPI_STOP < APIC_SPURIOUS_INT); | CTASSERT(IPI_STOP < APIC_SPURIOUS_INT); | ||||
/* Magic IRQ values for the timer and syscalls. */ | /* Magic IRQ values for the timer and syscalls. */ | ||||
#define IRQ_TIMER (NUM_IO_INTS + 1) | #define IRQ_TIMER (NUM_IO_INTS + 1) | ||||
#define IRQ_SYSCALL (NUM_IO_INTS + 2) | #define IRQ_SYSCALL (NUM_IO_INTS + 2) | ||||
#define IRQ_DTRACE_RET (NUM_IO_INTS + 3) | #define IRQ_DTRACE_RET (NUM_IO_INTS + 3) | ||||
#define IRQ_EVTCHN (NUM_IO_INTS + 4) | #define IRQ_HYPERVISOR (NUM_IO_INTS + 4) | ||||
/* | /* | ||||
* Support for local APICs. Local APICs manage interrupts on each | * Support for local APICs. Local APICs manage interrupts on each | ||||
* individual processor as opposed to I/O APICs which receive interrupts | * individual processor as opposed to I/O APICs which receive interrupts | ||||
* from I/O devices and then forward them on to the local APICs. | * from I/O devices and then forward them on to the local APICs. | ||||
* | * | ||||
* Local APICs can also send interrupts to each other thus providing the | * Local APICs can also send interrupts to each other thus providing the | ||||
* mechanism for IPIs. | * mechanism for IPIs. | ||||
▲ Show 20 Lines • Show All 413 Lines • ▼ Show 20 Lines | for (i = 0; i <= APIC_NUM_IOINTS; i++) | ||||
lapics[apic_id].la_ioint_irqs[i] = -1; | lapics[apic_id].la_ioint_irqs[i] = -1; | ||||
lapics[apic_id].la_ioint_irqs[IDT_SYSCALL - APIC_IO_INTS] = IRQ_SYSCALL; | lapics[apic_id].la_ioint_irqs[IDT_SYSCALL - APIC_IO_INTS] = IRQ_SYSCALL; | ||||
lapics[apic_id].la_ioint_irqs[APIC_TIMER_INT - APIC_IO_INTS] = | lapics[apic_id].la_ioint_irqs[APIC_TIMER_INT - APIC_IO_INTS] = | ||||
IRQ_TIMER; | IRQ_TIMER; | ||||
#ifdef KDTRACE_HOOKS | #ifdef KDTRACE_HOOKS | ||||
lapics[apic_id].la_ioint_irqs[IDT_DTRACE_RET - APIC_IO_INTS] = | lapics[apic_id].la_ioint_irqs[IDT_DTRACE_RET - APIC_IO_INTS] = | ||||
IRQ_DTRACE_RET; | IRQ_DTRACE_RET; | ||||
#endif | #endif | ||||
#ifdef XENHVM | #if defined(XENHVM) || defined(HYPERV) | ||||
lapics[apic_id].la_ioint_irqs[IDT_EVTCHN - APIC_IO_INTS] = IRQ_EVTCHN; | lapics[apic_id].la_ioint_irqs[IDT_HYPERVISOR - APIC_IO_INTS] = IRQ_HYPERVISOR; | ||||
#endif | #endif | ||||
#ifdef SMP | #ifdef SMP | ||||
cpu_add(apic_id, boot_cpu); | cpu_add(apic_id, boot_cpu); | ||||
#endif | #endif | ||||
} | } | ||||
▲ Show 20 Lines • Show All 841 Lines • ▼ Show 20 Lines | for (apic_id = 0; apic_id <= MAX_APIC_ID; apic_id++) { | ||||
for (i = 0; i < APIC_NUM_IOINTS + 1 && !db_pager_quit; i++) { | for (i = 0; i < APIC_NUM_IOINTS + 1 && !db_pager_quit; i++) { | ||||
irq = lapics[apic_id].la_ioint_irqs[i]; | irq = lapics[apic_id].la_ioint_irqs[i]; | ||||
if (irq == -1 || irq == IRQ_SYSCALL) | if (irq == -1 || irq == IRQ_SYSCALL) | ||||
continue; | continue; | ||||
#ifdef KDTRACE_HOOKS | #ifdef KDTRACE_HOOKS | ||||
if (irq == IRQ_DTRACE_RET) | if (irq == IRQ_DTRACE_RET) | ||||
continue; | continue; | ||||
#endif | #endif | ||||
#ifdef XENHVM | #if defined(XENHVM) || defined(HYPERV) | ||||
if (irq == IRQ_EVTCHN) | if (irq == IRQ_HYPERVISOR) | ||||
continue; | continue; | ||||
#endif | #endif | ||||
db_printf("vec 0x%2x -> ", i + APIC_IO_INTS); | db_printf("vec 0x%2x -> ", i + APIC_IO_INTS); | ||||
if (irq == IRQ_TIMER) | if (irq == IRQ_TIMER) | ||||
db_printf("lapic timer\n"); | db_printf("lapic timer\n"); | ||||
else if (irq < NUM_IO_INTS) { | else if (irq < NUM_IO_INTS) { | ||||
isrc = intr_lookup_source(irq); | isrc = intr_lookup_source(irq); | ||||
if (isrc == NULL || verbose == 0) | if (isrc == NULL || verbose == 0) | ||||
▲ Show 20 Lines • Show All 442 Lines • Show Last 20 Lines |