More #define magic for ISRs

This commit is contained in:
Eryn Wells 2016-03-13 18:40:45 -04:00
parent 2424ecaa30
commit 4e715c10af

View file

@ -5,7 +5,7 @@
.section .text
.global unhandledInterrupt
.global handleDEException, handleGPException
.global handleDEException, handleDFException, handleGPException
.global handleHardwareInterrupt0, handleHardwareInterrupt1
#define SaveContext \
@ -21,6 +21,15 @@
cli; \
hlt
#define SaveContextForHardwareInterrupt(irq) \
SaveContext \
pushl $irq
#define RestoreContextForHardwareInterrupt(irq) \
addl $4, %esp; \
RestoreContext
// Generic handler
unhandledInterrupt:
SaveContext
@ -56,14 +65,11 @@ handleGPException:
*/
handleHardwareInterrupt0:
SaveContext
call handleTimerInterrupt
RestoreContext
SaveContextForHardwareInterrupt(0)
call dispatchHardwareInterrupt
RestoreContextForHardwareInterrupt(0)
handleHardwareInterrupt1:
SaveContext
call handleKeyboardInterrupt
RestoreContext
#undef RestoreContext
#undef SaveContext
SaveContextForHardwareInterrupt(1)
call dispatchHardwareInterrupt
RestoreContextForHardwareInterrupt(1)