More #define magic for ISRs
This commit is contained in:
parent
2424ecaa30
commit
4e715c10af
1 changed files with 16 additions and 10 deletions
26
src/isr.S
26
src/isr.S
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue