[SeaBIOS] [PATCH 6/9] Convert USB keyboard code EBDA variables to VARLOW variables.

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


Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 src/biosvar.h |   12 ------------
 src/usb-hid.c |   17 ++++++++++++++---
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/src/biosvar.h b/src/biosvar.h
index c19bc85..6521acf 100644
--- a/src/biosvar.h
+++ b/src/biosvar.h
@@ -195,17 +195,6 @@ struct fdpt_s {
     u8 checksum;
 } PACKED;
 
-struct usbkeyinfo {
-    union {
-        struct {
-            u8 modifiers;
-            u8 repeatcount;
-            u8 keys[6];
-        };
-        u64 data;
-    };
-};
-
 struct extended_bios_data_area_s {
     u8 size;
     u8 reserved1[0x21];
@@ -223,7 +212,6 @@ struct extended_bios_data_area_s {
     u8 other2[0xC4];
 
     // 0x121 - Begin custom storage.
-    struct usbkeyinfo usbkey_last;
 
     // El Torito Emulation data
     struct cdemu_s cdemu;
diff --git a/src/usb-hid.c b/src/usb-hid.c
index 6e8ec4e..a4fe4ae 100644
--- a/src/usb-hid.c
+++ b/src/usb-hid.c
@@ -211,6 +211,18 @@ procmodkey(u8 mods, u8 flags)
         }
 }
 
+struct usbkeyinfo {
+    union {
+        struct {
+            u8 modifiers;
+            u8 repeatcount;
+            u8 keys[6];
+        };
+        u64 data;
+    };
+};
+struct usbkeyinfo LastUSBkey VARLOW;
+
 // Process USB keyboard data.
 static void noinline
 handle_key(struct keyevent *data)
@@ -218,9 +230,8 @@ handle_key(struct keyevent *data)
     dprintf(9, "Got key %x %x\n", data->modifiers, data->keys[0]);
 
     // Load old keys.
-    u16 ebda_seg = get_ebda_seg();
     struct usbkeyinfo old;
-    old.data = GET_EBDA2(ebda_seg, usbkey_last.data);
+    old.data = GET_LOW(LastUSBkey.data);
 
     // Check for keys no longer pressed.
     int addpos = 0;
@@ -273,7 +284,7 @@ handle_key(struct keyevent *data)
     }
 
     // Update old keys
-    SET_EBDA2(ebda_seg, usbkey_last.data, old.data);
+    SET_LOW(LastUSBkey.data, old.data);
 }
 
 // Check if a USB keyboard event is pending and process it if so.
-- 
1.7.6.5




More information about the SeaBIOS mailing list