.section .text .global idt_load .type idt_load @function idt_load: lidt (%rdi) sti retq .size idt_load, . - idt_load .include "arch/x86_64/savestate.s" .extern isr_handle .type __isr_head @function __isr_head: pushall movq %rsp, %rdi cld call isr_handle popall addq $16, %rsp iretq .extern __isr_err .extern __isr_num .macro defn_isr_err num:req .type __isr\num @function __isr\num: pushq $\num jmp __isr_head .size __isr\num, . - __isr\num .endm .macro defn_isr num:req .type __isr\num @function __isr\num: pushq $0 pushq $\num jmp __isr_head .size __isr\num, . - __isr\num .endm .macro decl_isr num:req .quad __isr\num .endm defn_isr 0 defn_isr 1 defn_isr 2 defn_isr 3 defn_isr 4 defn_isr 5 defn_isr 6 defn_isr 7 defn_isr_err 8 defn_isr 9 defn_isr_err 10 defn_isr_err 11 defn_isr_err 12 defn_isr_err 13 defn_isr_err 14 defn_isr 15 defn_isr 16 defn_isr_err 17 defn_isr 18 defn_isr 19 defn_isr 20 defn_isr_err 21 .altmacro .set i, 22 .rept 256-22 defn_isr %i .set i, i+1 .endr .section .data .global __ivt .type __ivt @object __ivt: .set i, 0 .rept 256 decl_isr %i .set i, i+1 .endr .size __ivt, . - __ivt