aboutsummaryrefslogtreecommitdiffstats
path: root/src/kbd.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/kbd.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/kbd.c')
-rw-r--r--src/kbd.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/kbd.c b/src/kbd.c
index fdb61d47..586d57eb 100644
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -379,7 +379,7 @@ static struct scaninfo {
};
// Handle a scancode read from the ps2 port. Note that "noinline" is
-// used to make sure the call to call16_simpint in process_key doesn't
+// used to make sure the call to call16_int in process_key doesn't
// have the overhead of this function's stack.
static void noinline
__process_key(u8 scancode)
@@ -562,12 +562,14 @@ process_key(u8 key)
if (CONFIG_KBD_CALL_INT15_4F) {
// allow for keyboard intercept
- u32 eax = (0x4f << 8) | key;
- u32 flags;
- call16_simpint(0x15, &eax, &flags);
- if (!(flags & F_CF))
+ struct bregs br;
+ memset(&br, 0, sizeof(br));
+ br.eax = (0x4f << 8) | key;
+ br.flags = F_IF|F_CF;
+ call16_int(0x15, &br);
+ if (!(br.flags & F_CF))
return;
- key = eax;
+ key = br.eax;
}
__process_key(key);
}