k-chow/k/events/isr.S
Julien CLEMENT ac1b1f5376 Rework architecture
Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
2021-07-26 08:50:31 +02:00

48 lines
1.5 KiB
ArmAsm

.section .text
isr:
pushal
pushl %esp
addl $32, (%esp)
call interrupt_handler
add $4, %esp
popal
add $8, %esp
iret
#define isr_callback_error(NAME, VECTOR)\
.global NAME; \
NAME: \
pushl $VECTOR; \
jmp isr
#define isr_callback_no_error(NAME, VECTOR)\
.global NAME ; \
NAME: \
pushl $0; \
pushl $VECTOR; \
jmp isr
isr_callback_no_error(isr_divide, 0)
isr_callback_no_error(isr_debug, 1)
isr_callback_no_error(isr_nmi, 2)
isr_callback_no_error(isr_breakpoint, 3)
isr_callback_no_error(isr_overflow, 4)
isr_callback_no_error(isr_bound_range_exceeded, 5)
isr_callback_no_error(isr_invalid_opcode, 6)
isr_callback_no_error(isr_device_not_available, 7)
isr_callback_no_error(isr_double_fault, 8)
isr_callback_no_error(isr_coprocessor_segment_overrun, 9)
isr_callback_error(isr_invalid_tss, 10)
isr_callback_error(isr_segment_not_present, 11)
isr_callback_error(isr_stack_segment_fault, 12)
isr_callback_error(isr_general_protection, 13)
isr_callback_error(isr_page_fault, 14)
isr_callback_no_error(isr_fpu_floating_point_error, 16)
isr_callback_error(isr_alignment_check, 17)
isr_callback_no_error(isr_machine_check, 18)
isr_callback_no_error(isr_simd_floating_point_exception, 19)
isr_callback_no_error(isr_virtualization_exception, 20)
isr_callback_error(isr_control_protection_exception, 21)
isr_callback_no_error(isr_keyboard, 33)