Files
novaos/kernel/arch/idt/idt_src.s

102 lines
1.6 KiB
ArmAsm

extern exception_handler
extern exception_handler_err
%macro isr_err_stub 1
isr_stub_%+%1:
push dword %1 ; push the interrupt number
jmp common_interrupt_handler
%endmacro
%macro isr_no_err_stub 1
isr_stub_%+%1:
push dword 0
push dword %1
jmp common_interrupt_handler
%endmacro
common_interrupt_handler:
; lets save the registers
push eax
push ebx
push ecx
push edx
push esi
push edi
push ebp
call exception_handler
; restore the registers
pop ebp
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop eax
; lets move the stack before the error code and interrupt number
; since we don't want these to be popped anywhere
add esp, 8
iret
isr_no_err_stub 0
isr_no_err_stub 1
isr_no_err_stub 2
isr_no_err_stub 3
isr_no_err_stub 4
isr_no_err_stub 5
isr_no_err_stub 6
isr_no_err_stub 7
isr_err_stub 8
isr_no_err_stub 9
isr_err_stub 10
isr_err_stub 11
isr_err_stub 12
isr_err_stub 13
isr_err_stub 14
isr_no_err_stub 15
isr_no_err_stub 16
isr_err_stub 17
isr_no_err_stub 18
isr_no_err_stub 19
isr_no_err_stub 20
isr_no_err_stub 21
isr_no_err_stub 22
isr_no_err_stub 23
isr_no_err_stub 24
isr_no_err_stub 25
isr_no_err_stub 26
isr_no_err_stub 27
isr_no_err_stub 28
isr_no_err_stub 29
isr_err_stub 30
isr_no_err_stub 31
isr_no_err_stub 32
isr_no_err_stub 33
isr_no_err_stub 34
isr_no_err_stub 35
isr_no_err_stub 36
isr_no_err_stub 37
isr_no_err_stub 38
isr_no_err_stub 39
isr_no_err_stub 40
isr_no_err_stub 41
isr_no_err_stub 42
isr_no_err_stub 43
isr_no_err_stub 44
isr_no_err_stub 45
isr_no_err_stub 46
isr_no_err_stub 47
global isr_stub_table
isr_stub_table:
%assign i 0
%rep 48
dd isr_stub_%+i
%assign i i+1
%endrep