diff options
-rw-r--r-- | sys/amd64/amd64/apic_vector.S | 10 | ||||
-rw-r--r-- | sys/i386/i386/apic_vector.s | 10 | ||||
-rw-r--r-- | sys/x86/x86/local_apic.c | 2 |
3 files changed, 8 insertions, 14 deletions
diff --git a/sys/amd64/amd64/apic_vector.S b/sys/amd64/amd64/apic_vector.S index e4c4ddf..96c778d 100644 --- a/sys/amd64/amd64/apic_vector.S +++ b/sys/amd64/amd64/apic_vector.S @@ -58,17 +58,15 @@ IDTVEC(vec_name) ; \ FAKE_MCOUNT(TF_RIP(%rsp)) ; \ movq lapic, %rdx ; /* pointer to local APIC */ \ movl LA_ISR + 16 * (index)(%rdx), %eax ; /* load ISR */ \ - bsrl %eax, %eax ; /* index of highset set bit in ISR */ \ - jz 2f ; \ + bsrl %eax, %eax ; /* index of highest set bit in ISR */ \ + jz 1f ; \ addl $(32 * index),%eax ; \ -1: ; \ movq %rsp, %rsi ; \ movl %eax, %edi ; /* pass the IRQ */ \ call lapic_handle_intr ; \ +1: ; \ MEXITCOUNT ; \ - jmp doreti ; \ -2: movl $-1, %eax ; /* send a vector of -1 */ \ - jmp 1b + jmp doreti /* * Handle "spurious INTerrupts". diff --git a/sys/i386/i386/apic_vector.s b/sys/i386/i386/apic_vector.s index 100ce90..86e78c4 100644 --- a/sys/i386/i386/apic_vector.s +++ b/sys/i386/i386/apic_vector.s @@ -60,18 +60,16 @@ IDTVEC(vec_name) ; \ FAKE_MCOUNT(TF_EIP(%esp)) ; \ movl lapic, %edx ; /* pointer to local APIC */ \ movl LA_ISR + 16 * (index)(%edx), %eax ; /* load ISR */ \ - bsrl %eax, %eax ; /* index of highset set bit in ISR */ \ - jz 2f ; \ + bsrl %eax, %eax ; /* index of highest set bit in ISR */ \ + jz 1f ; \ addl $(32 * index),%eax ; \ -1: ; \ pushl %esp ; \ pushl %eax ; /* pass the IRQ */ \ call lapic_handle_intr ; \ addl $8, %esp ; /* discard parameter */ \ +1: ; \ MEXITCOUNT ; \ - jmp doreti ; \ -2: movl $-1, %eax ; /* send a vector of -1 */ \ - jmp 1b + jmp doreti /* * Handle "spurious INTerrupts". diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index d6da578..804c411 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -780,8 +780,6 @@ lapic_handle_intr(int vector, struct trapframe *frame) { struct intsrc *isrc; - if (vector == -1) - panic("Couldn't get vector from ISR!"); isrc = intr_lookup_source(apic_idt_to_irq(PCPU_GET(apic_id), vector)); intr_execute_handlers(isrc, frame); |