aboutsummaryrefslogtreecommitdiffstats
path: root/src/misc.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2012-05-28 14:25:15 -0400
committerKevin O'Connor <kevin@koconnor.net>2012-05-30 21:04:52 -0400
commitecdc655a867480b938652d52a0880853595e2976 (patch)
treebb05ef9488ce19343b805ef246ca95636a6f5fb2 /src/misc.c
parentbeeabd63df5ad76c74360626549b0be2f6bbad91 (diff)
downloadseabios-ecdc655a867480b938652d52a0880853595e2976.tar.gz
Run all hardware irq handlers on the extra stack.
Jump into the extra stack for all hardware irq handlers. This reduces the overall stack requirements of SeaBIOS. Replace all users of call16_simpint with call16_int. Only the hardware irq handlers used the old call, and they need to use the new call to ensure the extra stack is properly re-entrant. Also, pass in a 'struct bregs' to the hardware irq handlers now. It was not done previously to save stack space. Now that the extra stack is used, that is no longer an issue. Note that should an old OS invoke a hardware irq in 16bit protected mode, then this patch could break that OS. However, the chances of this causing a regression seem small as several existing hardware irq handlers already do not work in 16bit protected mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/misc.c b/src/misc.c
index 9db49e38..d0d66656 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -55,9 +55,9 @@ handle_10(struct bregs *regs)
// NMI handler
void VISIBLE16
-handle_02(void)
+handle_02(struct bregs *regs)
{
- debug_isr(DEBUG_ISR_02);
+ debug_enter(regs, DEBUG_ISR_02);
}
void
@@ -71,17 +71,19 @@ mathcp_setup(void)
// INT 75 - IRQ13 - MATH COPROCESSOR EXCEPTION
void VISIBLE16
-handle_75(void)
+handle_75(struct bregs *regs)
{
- debug_isr(DEBUG_ISR_75);
+ debug_enter(regs, DEBUG_ISR_75);
// clear irq13
outb(0, PORT_MATH_CLEAR);
// clear interrupt
eoi_pic2();
// legacy nmi call
- u32 eax=0, flags;
- call16_simpint(0x02, &eax, &flags);
+ struct bregs br;
+ memset(&br, 0, sizeof(br));
+ br.flags = F_IF;
+ call16_int(0x02, &br);
}