Files
cleonos/clks/arch/x86_64/interrupt_stubs.S
2026-04-09 22:12:29 +08:00

117 lines
1.5 KiB
ArmAsm

.intel_syntax noprefix
.global clks_isr_stub_default
.extern clks_interrupt_dispatch
.macro ISR_NOERR num
.global clks_isr_stub_\num
clks_isr_stub_\num:
push 0
push \num
jmp clks_isr_common
.endm
.macro ISR_ERR num
.global clks_isr_stub_\num
clks_isr_stub_\num:
push \num
jmp clks_isr_common
.endm
clks_isr_stub_default:
push 0
push 255
jmp clks_isr_common
ISR_NOERR 0
ISR_NOERR 1
ISR_NOERR 2
ISR_NOERR 3
ISR_NOERR 4
ISR_NOERR 5
ISR_NOERR 6
ISR_NOERR 7
ISR_ERR 8
ISR_NOERR 9
ISR_ERR 10
ISR_ERR 11
ISR_ERR 12
ISR_ERR 13
ISR_ERR 14
ISR_NOERR 15
ISR_NOERR 16
ISR_ERR 17
ISR_NOERR 18
ISR_NOERR 19
ISR_NOERR 20
ISR_ERR 21
ISR_NOERR 22
ISR_NOERR 23
ISR_NOERR 24
ISR_NOERR 25
ISR_NOERR 26
ISR_NOERR 27
ISR_NOERR 28
ISR_ERR 29
ISR_ERR 30
ISR_NOERR 31
ISR_NOERR 32
ISR_NOERR 33
ISR_NOERR 34
ISR_NOERR 35
ISR_NOERR 36
ISR_NOERR 37
ISR_NOERR 38
ISR_NOERR 39
ISR_NOERR 40
ISR_NOERR 41
ISR_NOERR 42
ISR_NOERR 43
ISR_NOERR 44
ISR_NOERR 45
ISR_NOERR 46
ISR_NOERR 47
clks_isr_common:
cld
push r15
push r14
push r13
push r12
push r11
push r10
push r9
push r8
push rbp
push rdi
push rsi
push rdx
push rcx
push rbx
push rax
mov rdi, rsp
sub rsp, 8
call clks_interrupt_dispatch
add rsp, 8
pop rax
pop rbx
pop rcx
pop rdx
pop rsi
pop rdi
pop rbp
pop r8
pop r9
pop r10
pop r11
pop r12
pop r13
pop r14
pop r15
add rsp, 16
iretq