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
|
.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
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue