[SeaBIOS] [PATCH 5/9] Convert ps2 code EBDA variables to VARLOW variables.

Kevin O'Connor kevin at koconnor.net
Sun May 20 19:43:45 CEST 2012


Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 src/biosvar.h |    1 -
 src/ps2port.c |   19 ++++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/biosvar.h b/src/biosvar.h
index 2458308..c19bc85 100644
--- a/src/biosvar.h
+++ b/src/biosvar.h
@@ -223,7 +223,6 @@ struct extended_bios_data_area_s {
     u8 other2[0xC4];
 
     // 0x121 - Begin custom storage.
-    u8 ps2ctr;
     struct usbkeyinfo usbkey_last;
 
     // El Torito Emulation data
diff --git a/src/ps2port.c b/src/ps2port.c
index 4b27b7a..15bce8e 100644
--- a/src/ps2port.c
+++ b/src/ps2port.c
@@ -8,7 +8,7 @@
 #include "ioport.h" // inb
 #include "util.h" // dprintf
 #include "paravirt.h" // romfile_loadint
-#include "biosvar.h" // GET_EBDA
+#include "biosvar.h" // GET_LOW
 #include "ps2port.h" // ps2_kbd_command
 #include "pic.h" // eoi_pic1
 
@@ -208,6 +208,8 @@ ps2_sendbyte(int aux, u8 command, int timeout)
     return 0;
 }
 
+u8 Ps2ctr VARLOW;
+
 static int
 __ps2_command(int aux, int command, u8 *param)
 {
@@ -216,7 +218,7 @@ __ps2_command(int aux, int command, u8 *param)
     int send = (command >> 12) & 0xf;
 
     // Disable interrupts and keyboard/mouse.
-    u8 ps2ctr = GET_EBDA(ps2ctr);
+    u8 ps2ctr = GET_LOW(Ps2ctr);
     u8 newctr = ((ps2ctr | I8042_CTR_AUXDIS | I8042_CTR_KBDDIS)
                  & ~(I8042_CTR_KBDINT|I8042_CTR_AUXINT));
     dprintf(6, "i8042 ctr old=%x new=%x\n", ps2ctr, newctr);
@@ -337,13 +339,12 @@ ps2_mouse_command(int command, u8 *param)
 
     // Update ps2ctr for mouse enable/disable.
     if (command == PSMOUSE_CMD_ENABLE || command == PSMOUSE_CMD_DISABLE) {
-        u16 ebda_seg = get_ebda_seg();
-        u8 ps2ctr = GET_EBDA2(ebda_seg, ps2ctr);
+        u8 ps2ctr = GET_LOW(Ps2ctr);
         if (command == PSMOUSE_CMD_ENABLE)
             ps2ctr = (ps2ctr | I8042_CTR_AUXINT) & ~I8042_CTR_AUXDIS;
         else
             ps2ctr = (ps2ctr | I8042_CTR_AUXDIS) & ~I8042_CTR_AUXINT;
-        SET_EBDA2(ebda_seg, ps2ctr, ps2ctr);
+        SET_LOW(Ps2ctr, ps2ctr);
     }
 
     return ps2_command(1, command, param);
@@ -371,7 +372,7 @@ handle_74(void)
     }
     v = inb(PORT_PS2_DATA);
 
-    if (!(GET_EBDA(ps2ctr) & I8042_CTR_AUXINT))
+    if (!(GET_LOW(Ps2ctr) & I8042_CTR_AUXINT))
         // Interrupts not enabled.
         goto done;
 
@@ -398,7 +399,7 @@ handle_09(void)
     }
     v = inb(PORT_PS2_DATA);
 
-    if (!(GET_EBDA(ps2ctr) & I8042_CTR_KBDINT))
+    if (!(GET_LOW(Ps2ctr) & I8042_CTR_KBDINT))
         // Interrupts not enabled.
         goto done;
 
@@ -444,7 +445,7 @@ keyboard_init(void *data)
     }
 
     // Disable keyboard and mouse events.
-    SET_EBDA(ps2ctr, I8042_CTR_KBDDIS | I8042_CTR_AUXDIS);
+    SET_LOW(Ps2ctr, I8042_CTR_KBDDIS | I8042_CTR_AUXDIS);
 
 
     /* ------------------- keyboard side ------------------------*/
@@ -479,7 +480,7 @@ keyboard_init(void *data)
         return;
 
     // Keyboard Mode: disable mouse, scan code convert, enable kbd IRQ
-    SET_EBDA(ps2ctr, I8042_CTR_AUXDIS | I8042_CTR_XLATE | I8042_CTR_KBDINT);
+    SET_LOW(Ps2ctr, I8042_CTR_AUXDIS | I8042_CTR_XLATE | I8042_CTR_KBDINT);
 
     /* Enable keyboard */
     ret = ps2_kbd_command(ATKBD_CMD_ENABLE, NULL);
-- 
1.7.6.5




More information about the SeaBIOS mailing list