[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: retrieve keyboard shift status flags from BIOS


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Fri, 14 Sep 2012 10:55:28 +0000
  • Delivery-date: Fri, 14 Sep 2012 10:55:33 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1347437854 -7200
# Node ID ac8f4afccd6c6786a3fd5691e8b0c9b38c47e994
# Parent  f47bc4eb8256cba78517137f59029deed3144aad
x86: retrieve keyboard shift status flags from BIOS

Recent Linux tries to make use of this, and has no way of getting at
these bits without Xen assisting it.

There doesn't appear to be a way to obtain the same information from
UEFI.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r f47bc4eb8256 -r ac8f4afccd6c xen/arch/x86/boot/trampoline.S
--- a/xen/arch/x86/boot/trampoline.S    Tue Sep 11 16:04:49 2012 +0200
+++ b/xen/arch/x86/boot/trampoline.S    Wed Sep 12 10:17:34 2012 +0200
@@ -184,11 +184,16 @@ 1:      mov     %cs,%ax
          *  1. Get memory map.
          *  2. Get Enhanced Disk Drive (EDD) information.
          *  3. Set video mode.
+         *  4. Get keyboard shift flags.
          */
         call    get_memory_map
         call    get_edd
         call    video
 
+        mov     $0x0200,%ax
+        int     $0x16
+        mov     %al,bootsym(kbd_shift_flags)
+
         /* Disable irqs before returning to protected mode. */
         cli
 
@@ -221,6 +226,10 @@ 1:      mov     $BOOT_DS,%eax
 skip_realmode:
         .byte   0
 
+        .globl kbd_shift_flags
+kbd_shift_flags:
+        .byte   0
+
 rm_idt: .word   256*4-1, 0, 0
 
 #include "mem.S"
diff -r f47bc4eb8256 -r ac8f4afccd6c xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c Tue Sep 11 16:04:49 2012 +0200
+++ b/xen/arch/x86/platform_hypercall.c Wed Sep 12 10:17:34 2012 +0200
@@ -29,6 +29,7 @@
 #include <asm/edd.h>
 #include <asm/mtrr.h>
 #include <asm/io_apic.h>
+#include <asm/setup.h>
 #include "cpu/mtrr/mtrr.h"
 #include <xsm/xsm.h>
 
@@ -319,6 +320,18 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xe
                                      u.firmware_info.u.efi_info) )
                 ret = -EFAULT;
             break;
+        case XEN_FW_KBD_SHIFT_FLAGS:
+            ret = -ESRCH;
+            if ( op->u.firmware_info.index != 0 )
+                break;
+
+            op->u.firmware_info.u.kbd_shift_flags = bootsym(kbd_shift_flags);
+
+            ret = 0;
+            if ( copy_field_to_guest(u_xenpf_op, op,
+                                     u.firmware_info.u.kbd_shift_flags) )
+                ret = -EFAULT;
+            break;
         default:
             ret = -EINVAL;
             break;
diff -r f47bc4eb8256 -r ac8f4afccd6c xen/include/asm-x86/setup.h
--- a/xen/include/asm-x86/setup.h       Tue Sep 11 16:04:49 2012 +0200
+++ b/xen/include/asm-x86/setup.h       Wed Sep 12 10:17:34 2012 +0200
@@ -41,4 +41,6 @@ int xen_in_range(unsigned long mfn);
 void microcode_grab_module(
     unsigned long *, const multiboot_info_t *, void *(*)(const module_t *));
 
+extern uint8_t kbd_shift_flags;
+
 #endif
diff -r f47bc4eb8256 -r ac8f4afccd6c xen/include/public/platform.h
--- a/xen/include/public/platform.h     Tue Sep 11 16:04:49 2012 +0200
+++ b/xen/include/public/platform.h     Wed Sep 12 10:17:34 2012 +0200
@@ -218,6 +218,7 @@ DEFINE_XEN_GUEST_HANDLE(xenpf_efi_runtim
 #define  XEN_FW_EFI_VENDOR         2
 #define  XEN_FW_EFI_MEM_INFO       3
 #define  XEN_FW_EFI_RT_VERSION     4
+#define XEN_FW_KBD_SHIFT_FLAGS    5
 struct xenpf_firmware_info {
     /* IN variables. */
     uint32_t type;
@@ -266,6 +267,9 @@ struct xenpf_firmware_info {
                 uint32_t type;
             } mem;
         } efi_info; /* XEN_FW_EFI_INFO */
+
+        /* Int16, Fn02: Get keyboard shift flags. */
+        uint8_t kbd_shift_flags; /* XEN_FW_KBD_SHIFT_FLAGS */
     } u;
 };
 typedef struct xenpf_firmware_info xenpf_firmware_info_t;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.