diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2014-10-11 13:16:12 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-10-15 12:10:52 -0400 |
commit | 341f8d98a087de01326634dd8a838381e7caa1c9 (patch) | |
tree | 475e024036dd267222c016ee3c9afba8e570a357 /src/system.c | |
parent | 55215cd425d36b257104b9279541c886e7bab607 (diff) | |
download | seabios-341f8d98a087de01326634dd8a838381e7caa1c9.tar.gz |
Move a20 code from system.c and ps2port.h to x86.h
Although the a20 functionality was originally implemented in the ps2
controller, that is just a historical artifact. It's a core feature
of modern x86 cpus and the code is better located in the x86.h header.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/system.c')
-rw-r--r-- | src/system.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/system.c b/src/system.c index 756dc311..bcf7e907 100644 --- a/src/system.c +++ b/src/system.c @@ -8,28 +8,12 @@ #include "biosvar.h" // GET_GLOBAL #include "bregs.h" // struct bregs #include "hw/pic.h" // pic_reset -#include "hw/ps2port.h" // PORT_A20 #include "malloc.h" // LegacyRamSize #include "memmap.h" // E820_RAM #include "output.h" // debug_enter #include "string.h" // memcpy_far #include "util.h" // handle_1553 -#include "x86.h" // inb - -// Use PS2 System Control port A to set A20 enable -static inline u8 -set_a20(u8 cond) -{ - // get current setting first - u8 newval, oldval = inb(PORT_A20); - if (cond) - newval = oldval | A20_ENABLE_BIT; - else - newval = oldval & ~A20_ENABLE_BIT; - outb(newval, PORT_A20); - - return (oldval & A20_ENABLE_BIT) != 0; -} +#include "x86.h" // set_a20 static void handle_152400(struct bregs *regs) @@ -48,7 +32,7 @@ handle_152401(struct bregs *regs) static void handle_152402(struct bregs *regs) { - regs->al = (inb(PORT_A20) & A20_ENABLE_BIT) != 0; + regs->al = get_a20(); set_code_success(regs); } |