Changeset View
Changeset View
Standalone View
Standalone View
sys/i386/i386/apic_vector.s
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | */ | ||||
.globl X\()\vec_name\()_pti, X\()\vec_name | .globl X\()\vec_name\()_pti, X\()\vec_name | ||||
X\()\vec_name\()_pti: | X\()\vec_name\()_pti: | ||||
X\()\vec_name: | X\()\vec_name: | ||||
PUSH_FRAME | PUSH_FRAME | ||||
SET_KERNEL_SREGS | SET_KERNEL_SREGS | ||||
cld | cld | ||||
KENTER | KENTER | ||||
FAKE_MCOUNT(TF_EIP(%esp)) | |||||
cmpl $0,x2apic_mode | cmpl $0,x2apic_mode | ||||
je 2f | je 2f | ||||
movl $(MSR_APIC_ISR0 + \index),%ecx | movl $(MSR_APIC_ISR0 + \index),%ecx | ||||
rdmsr | rdmsr | ||||
jmp 3f | jmp 3f | ||||
2: | 2: | ||||
movl lapic_map, %edx /* pointer to local APIC */ | movl lapic_map, %edx /* pointer to local APIC */ | ||||
movl LA_ISR + 16 * \index(%edx), %eax /* load ISR */ | movl LA_ISR + 16 * \index(%edx), %eax /* load ISR */ | ||||
3: | 3: | ||||
bsrl %eax, %eax /* index of highest set bit in ISR */ | bsrl %eax, %eax /* index of highest set bit in ISR */ | ||||
jz 4f | jz 4f | ||||
addl $(32 * \index),%eax | addl $(32 * \index),%eax | ||||
pushl %esp | pushl %esp | ||||
pushl %eax /* pass the IRQ */ | pushl %eax /* pass the IRQ */ | ||||
movl $lapic_handle_intr, %eax | movl $lapic_handle_intr, %eax | ||||
call *%eax | call *%eax | ||||
addl $8, %esp /* discard parameter */ | addl $8, %esp /* discard parameter */ | ||||
4: | 4: | ||||
MEXITCOUNT | |||||
jmp doreti | jmp doreti | ||||
.endm | .endm | ||||
/* | /* | ||||
* Handle "spurious INTerrupts". | * Handle "spurious INTerrupts". | ||||
* Notes: | * Notes: | ||||
* This is different than the "spurious INTerrupt" generated by an | * This is different than the "spurious INTerrupt" generated by an | ||||
* 8259 PIC for missing INTs. See the APIC documentation for details. | * 8259 PIC for missing INTs. See the APIC documentation for details. | ||||
Show All 21 Lines | */ | ||||
.text | .text | ||||
SUPERALIGN_TEXT | SUPERALIGN_TEXT | ||||
IDTVEC(timerint_pti) | IDTVEC(timerint_pti) | ||||
IDTVEC(timerint) | IDTVEC(timerint) | ||||
PUSH_FRAME | PUSH_FRAME | ||||
SET_KERNEL_SREGS | SET_KERNEL_SREGS | ||||
cld | cld | ||||
KENTER | KENTER | ||||
FAKE_MCOUNT(TF_EIP(%esp)) | |||||
pushl %esp | pushl %esp | ||||
movl $lapic_handle_timer, %eax | movl $lapic_handle_timer, %eax | ||||
call *%eax | call *%eax | ||||
add $4, %esp | add $4, %esp | ||||
MEXITCOUNT | |||||
jmp doreti | jmp doreti | ||||
/* | /* | ||||
* Local APIC CMCI handler. | * Local APIC CMCI handler. | ||||
*/ | */ | ||||
.text | .text | ||||
SUPERALIGN_TEXT | SUPERALIGN_TEXT | ||||
IDTVEC(cmcint_pti) | IDTVEC(cmcint_pti) | ||||
IDTVEC(cmcint) | IDTVEC(cmcint) | ||||
PUSH_FRAME | PUSH_FRAME | ||||
SET_KERNEL_SREGS | SET_KERNEL_SREGS | ||||
cld | cld | ||||
KENTER | KENTER | ||||
FAKE_MCOUNT(TF_EIP(%esp)) | |||||
movl $lapic_handle_cmc, %eax | movl $lapic_handle_cmc, %eax | ||||
call *%eax | call *%eax | ||||
MEXITCOUNT | |||||
jmp doreti | jmp doreti | ||||
/* | /* | ||||
* Local APIC error interrupt handler. | * Local APIC error interrupt handler. | ||||
*/ | */ | ||||
.text | .text | ||||
SUPERALIGN_TEXT | SUPERALIGN_TEXT | ||||
IDTVEC(errorint_pti) | IDTVEC(errorint_pti) | ||||
IDTVEC(errorint) | IDTVEC(errorint) | ||||
PUSH_FRAME | PUSH_FRAME | ||||
SET_KERNEL_SREGS | SET_KERNEL_SREGS | ||||
cld | cld | ||||
KENTER | KENTER | ||||
FAKE_MCOUNT(TF_EIP(%esp)) | |||||
movl $lapic_handle_error, %eax | movl $lapic_handle_error, %eax | ||||
call *%eax | call *%eax | ||||
MEXITCOUNT | |||||
jmp doreti | jmp doreti | ||||
#ifdef XENHVM | #ifdef XENHVM | ||||
/* | /* | ||||
* Xen event channel upcall interrupt handler. | * Xen event channel upcall interrupt handler. | ||||
* Only used when the hypervisor supports direct vector callbacks. | * Only used when the hypervisor supports direct vector callbacks. | ||||
*/ | */ | ||||
.text | .text | ||||
SUPERALIGN_TEXT | SUPERALIGN_TEXT | ||||
IDTVEC(xen_intr_upcall) | IDTVEC(xen_intr_upcall) | ||||
PUSH_FRAME | PUSH_FRAME | ||||
SET_KERNEL_SREGS | SET_KERNEL_SREGS | ||||
cld | cld | ||||
KENTER | KENTER | ||||
FAKE_MCOUNT(TF_EIP(%esp)) | |||||
pushl %esp | pushl %esp | ||||
movl $xen_intr_handle_upcall, %eax | movl $xen_intr_handle_upcall, %eax | ||||
call *%eax | call *%eax | ||||
add $4, %esp | add $4, %esp | ||||
MEXITCOUNT | |||||
jmp doreti | jmp doreti | ||||
#endif | #endif | ||||
#ifdef SMP | #ifdef SMP | ||||
/* | /* | ||||
* Global address space TLB shootdown. | * Global address space TLB shootdown. | ||||
*/ | */ | ||||
.text | .text | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | */ | ||||
.text | .text | ||||
SUPERALIGN_TEXT | SUPERALIGN_TEXT | ||||
IDTVEC(ipi_intr_bitmap_handler) | IDTVEC(ipi_intr_bitmap_handler) | ||||
PUSH_FRAME | PUSH_FRAME | ||||
SET_KERNEL_SREGS | SET_KERNEL_SREGS | ||||
cld | cld | ||||
KENTER | KENTER | ||||
call as_lapic_eoi | call as_lapic_eoi | ||||
FAKE_MCOUNT(TF_EIP(%esp)) | |||||
movl $ipi_bitmap_handler, %eax | movl $ipi_bitmap_handler, %eax | ||||
call *%eax | call *%eax | ||||
MEXITCOUNT | |||||
jmp doreti | jmp doreti | ||||
/* | /* | ||||
* Executed by a CPU when it receives an IPI_STOP from another CPU. | * Executed by a CPU when it receives an IPI_STOP from another CPU. | ||||
*/ | */ | ||||
.text | .text | ||||
SUPERALIGN_TEXT | SUPERALIGN_TEXT | ||||
IDTVEC(cpustop) | IDTVEC(cpustop) | ||||
Show All 27 Lines | */ | ||||
.text | .text | ||||
SUPERALIGN_TEXT | SUPERALIGN_TEXT | ||||
IDTVEC(ipi_swi) | IDTVEC(ipi_swi) | ||||
PUSH_FRAME | PUSH_FRAME | ||||
SET_KERNEL_SREGS | SET_KERNEL_SREGS | ||||
cld | cld | ||||
KENTER | KENTER | ||||
call as_lapic_eoi | call as_lapic_eoi | ||||
FAKE_MCOUNT(TF_EIP(%esp)) | |||||
movl $ipi_swi_handler, %eax | movl $ipi_swi_handler, %eax | ||||
call *%eax | call *%eax | ||||
MEXITCOUNT | |||||
jmp doreti | jmp doreti | ||||
/* | /* | ||||
* Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU. | * Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU. | ||||
* | * | ||||
* - Calls the generic rendezvous action function. | * - Calls the generic rendezvous action function. | ||||
*/ | */ | ||||
.text | .text | ||||
Show All 17 Lines |