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