From 2d012ecb3457eb0b2e8f324e730263a8becfd026 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 13 May 2012 12:39:16 -0400 Subject: [PATCH] Convert USB keyboard code EBDA variables to VARLOW variables. Signed-off-by: Kevin O'Connor --- 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 412afd5..0d4b39a 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. -- 2.39.5