k-tana-zero/k/isr.S

52 lines
1.2 KiB
ArmAsm

.section .text
isr:
pushal // save registers
pushl %esp
add $32, (%esp)
call handle_interrupt
add $4, %esp
popal // restore registers
add $8, %esp
iret
#define ISR_ERRCODE(ISR_NAME, INT_CODE) \
.global ISR_NAME; \
ISR_NAME:; \
pushl $INT_CODE; \
jmp isr; \
#define ISR_NO_ERRCODE(ISR_NAME, INT_CODE) \
.global ISR_NAME; \
ISR_NAME:; \
pushl $0; \
pushl $INT_CODE; \
jmp isr; \
// intel-defined
ISR_NO_ERRCODE(int_de, 0)
ISR_NO_ERRCODE(int_db, 1)
ISR_NO_ERRCODE(int_nmi, 2)
ISR_NO_ERRCODE(int_bp, 3)
ISR_NO_ERRCODE(int_of, 4)
ISR_NO_ERRCODE(int_br, 5)
ISR_NO_ERRCODE(int_ud, 6)
ISR_NO_ERRCODE(int_nm, 7)
ISR_ERRCODE(int_df, 8)
ISR_ERRCODE(int_ts, 10)
ISR_ERRCODE(int_np, 11)
ISR_ERRCODE(int_ss, 12)
ISR_ERRCODE(int_gp, 13)
ISR_ERRCODE(int_pf, 14)
ISR_NO_ERRCODE(int_mf, 16)
ISR_ERRCODE(int_ac, 17)
ISR_NO_ERRCODE(int_mc, 18)
ISR_NO_ERRCODE(int_xm, 19)
ISR_NO_ERRCODE(int_ve, 20)
// user-defined
ISR_NO_ERRCODE(pic_keyboard, 33)