diff options
| author | 2026-08-18 12:15:05 +0200 | |
|---|---|---|
| committer | 2026-08-18 12:15:05 +0200 | |
| commit | 132d3236bb884433bf94e961f6d32264e0334aec (patch) | |
| tree | 06638976b06f019ea4037175ff228f8271057c44 /kernel/interrupts/common.s | |
Diffstat (limited to '')
| -rw-r--r-- | kernel/interrupts/common.s | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/kernel/interrupts/common.s b/kernel/interrupts/common.s new file mode 100644 index 0000000..a03fb1c --- /dev/null +++ b/kernel/interrupts/common.s @@ -0,0 +1,94 @@ +extern generic_interrupt +global asm_generic_interrupt +global s_trap_start +global s_trap_end + +section .text +align 4 + +s_trap_start: + push r15 + push r14 + push r13 + push r12 + push r11 + push r10 + push r9 + push r8 + push rdi + push rsi + push rbp + push rdx + push rcx + push rbx + push rax + + mov rdi, rsp + call generic_interrupt + +s_trap_end: + pop rax + pop rbx + pop rcx + pop rdx + pop rbp + pop rsi + pop rdi + pop r8 + pop r9 + pop r10 + pop r11 + pop r12 + pop r13 + pop r14 + pop r15 + + add rsp, 16 + + iretq + +asm_generic_interrupt: + ;push 0x0 ; + ;push 0xE ; <- need to create the individual interrupts pushing the specific values to the stack (how to pop them?) + push r15 + push r14 + push r13 + push r12 + push r11 + push r10 + push r9 + push r8 + push rdi + push rsi + push rbp + push rdx + push rcx + push rbx + push rax + + ; ?? + ; cld + mov rdi, rsp + call generic_interrupt + + pop rax + pop rbx + pop rcx + pop rdx + pop rbp + pop rsi + pop rdi + pop r8 + pop r9 + pop r10 + pop r11 + pop r12 + pop r13 + pop r14 + pop r15 + ;pop + ;pop + + add rsp, 16 + + iretq |
