dynamic memory manager (malloc & free)
[lunaix-os.git] / lunaix-os / kernel / asm / x86 / interrupt.S
1 .macro isr_template vector, no_error_code=1
2     .global _asm_isr\vector
3     .type _asm_isr\vector, @function
4     _asm_isr\vector:
5         .if \no_error_code
6             pushl $0x0
7         .endif
8         pushl $\vector
9         jmp interrupt_wrapper
10 .endm
11
12 .section .text
13     isr_template 0
14     isr_template 13, no_error_code=0
15
16     interrupt_wrapper:
17
18         movl %esp, %eax
19         andl $0xfffffff0, %esp
20         subl $16, %esp
21         movl %eax, (%esp)
22
23         call interrupt_handler
24         pop %eax
25         movl %eax, %esp
26         addl $8, %esp
27
28         iret