X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/e755eba154554d6764fb09df1086d8e995778538..f4aab93debd6eed5115c2328ada3160512027bd2:/lunaix-os/arch/x86/interrupt.S diff --git a/lunaix-os/arch/x86/interrupt.S b/lunaix-os/arch/x86/interrupt.S new file mode 100644 index 0000000..584b143 --- /dev/null +++ b/lunaix-os/arch/x86/interrupt.S @@ -0,0 +1,27 @@ +.macro isr_template vector, no_error_code=1 + .global _asm_isr\vector + .type _asm_isr\vector, @function + _asm_isr\vector: + .if \no_error_code + pushl $0x0 + .endif + pushl $\vector + jmp interrupt_wrapper +.endm + +.section .text + isr_template 0 + + interrupt_wrapper: + + movl %esp, %eax + andl $0xfffffff0, %esp + subl $16, %esp + movl %eax, (%esp) + + call interrupt_handler + pop %eax + movl %eax, %esp + addl $8, %esp + + iret \ No newline at end of file