2021-07-14 22:37:44 +00:00
|
|
|
.section .text
|
|
|
|
|
|
|
|
isr:
|
|
|
|
pushal // save registers
|
|
|
|
|
|
|
|
pushl %esp
|
2021-07-16 12:07:04 +00:00
|
|
|
add $32, (%esp)
|
2021-07-15 02:42:11 +00:00
|
|
|
call handle_interrupt
|
2021-07-14 22:37:44 +00:00
|
|
|
|
|
|
|
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; \
|
|
|
|
|
2021-07-15 14:47:56 +00:00
|
|
|
// intel-defined
|
2021-07-14 22:37:44 +00:00
|
|
|
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)
|
2021-07-15 14:47:56 +00:00
|
|
|
|
|
|
|
// user-defined
|
|
|
|
ISR_NO_ERRCODE(pic_keyboard, 33)
|