.macro EXCEPTION_NO_ERROR vector .global exception_\vector .type exception_\vector, @function exception_\vector: pushq $0 pushq $\vector jmp exception_common .endm .macro EXCEPTION_ERROR vector .global exception_\vector .type exception_\vector, @function exception_\vector: pushq $\vector jmp exception_common .endm .macro IRQ vector .global irq_\vector .type irq_\vector, @function irq_\vector: pushq $0 pushq $\vector jmp exception_common .endm .section .text EXCEPTION_NO_ERROR 0 EXCEPTION_NO_ERROR 1 EXCEPTION_NO_ERROR 2 EXCEPTION_NO_ERROR 3 EXCEPTION_NO_ERROR 4 EXCEPTION_NO_ERROR 5 EXCEPTION_NO_ERROR 6 EXCEPTION_NO_ERROR 7 EXCEPTION_ERROR 8 EXCEPTION_NO_ERROR 9 EXCEPTION_ERROR 10 EXCEPTION_ERROR 11 EXCEPTION_ERROR 12 EXCEPTION_ERROR 13 EXCEPTION_ERROR 14 EXCEPTION_NO_ERROR 15 EXCEPTION_NO_ERROR 16 EXCEPTION_ERROR 17 EXCEPTION_NO_ERROR 18 EXCEPTION_NO_ERROR 19 EXCEPTION_NO_ERROR 20 EXCEPTION_ERROR 21 EXCEPTION_NO_ERROR 22 EXCEPTION_NO_ERROR 23 EXCEPTION_NO_ERROR 24 EXCEPTION_NO_ERROR 25 EXCEPTION_NO_ERROR 26 EXCEPTION_NO_ERROR 27 EXCEPTION_NO_ERROR 28 EXCEPTION_ERROR 29 EXCEPTION_ERROR 30 EXCEPTION_NO_ERROR 31 IRQ 32 .type exception_common, @function exception_common: cld pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %r11 pushq %r10 pushq %r9 pushq %r8 pushq %rbp pushq %rdi pushq %rsi pushq %rdx pushq %rcx pushq %rbx pushq %rax movq %rsp, %rdi call trap_dispatch addq $120, %rsp addq $16, %rsp iretq