aboutsummaryrefslogtreecommitdiff
path: root/src/system.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2014-10-11 13:16:12 -0400
committerKevin O'Connor <kevin@koconnor.net>2014-10-15 12:10:52 -0400
commit341f8d98a087de01326634dd8a838381e7caa1c9 (patch)
tree475e024036dd267222c016ee3c9afba8e570a357 /src/system.c
parent55215cd425d36b257104b9279541c886e7bab607 (diff)
downloadseabios-hppa-341f8d98a087de01326634dd8a838381e7caa1c9.zip
seabios-hppa-341f8d98a087de01326634dd8a838381e7caa1c9.tar.gz
seabios-hppa-341f8d98a087de01326634dd8a838381e7caa1c9.tar.bz2
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.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/system.c b/src/system.c
index 756dc31..bcf7e90 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);
}