dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0226-grub-core-term-at_keyboard.c-Increase-robustness-on-.patch

f96e0b
From 22a5b3e8041be8b3abdfe52ebf155136218489bb Mon Sep 17 00:00:00 2001
f96e0b
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
f96e0b
Date: Sat, 23 Mar 2013 16:54:36 +0100
f96e0b
Subject: [PATCH 226/482] 	* grub-core/term/at_keyboard.c: Increase
f96e0b
 robustness on coreboot 	and qemu.
f96e0b
f96e0b
---
f96e0b
 ChangeLog                    |  5 +++++
f96e0b
 grub-core/term/at_keyboard.c | 16 +++++++++++++---
f96e0b
 2 files changed, 18 insertions(+), 3 deletions(-)
f96e0b
f96e0b
diff --git a/ChangeLog b/ChangeLog
f96e0b
index 8175269..9841659 100644
f96e0b
--- a/ChangeLog
f96e0b
+++ b/ChangeLog
f96e0b
@@ -1,3 +1,8 @@
f96e0b
+2013-03-23  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
+
f96e0b
+	* grub-core/term/at_keyboard.c: Increase robustness on coreboot
f96e0b
+	and qemu.
f96e0b
+
f96e0b
 2013-03-22  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
 
f96e0b
 	* grub-core/fs/zfs/zfs.c: Fix incorrect handling of special volumes.
f96e0b
diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c
f96e0b
index 2afcceb..b2f328f 100644
f96e0b
--- a/grub-core/term/at_keyboard.c
f96e0b
+++ b/grub-core/term/at_keyboard.c
f96e0b
@@ -259,7 +259,13 @@ grub_keyboard_controller_write (grub_uint8_t c)
f96e0b
   grub_outb (c, KEYBOARD_REG_DATA);
f96e0b
 }
f96e0b
 
f96e0b
-#if !defined (GRUB_MACHINE_MIPS_LOONGSON) && !defined (GRUB_MACHINE_QEMU) && !defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
f96e0b
+#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
f96e0b
+#define USE_SCANCODE_SET 1
f96e0b
+#else
f96e0b
+#define USE_SCANCODE_SET 0
f96e0b
+#endif
f96e0b
+
f96e0b
+#if !USE_SCANCODE_SET
f96e0b
 
f96e0b
 static grub_uint8_t
f96e0b
 grub_keyboard_controller_read (void)
f96e0b
@@ -332,7 +338,7 @@ set_scancodes (void)
f96e0b
       return;
f96e0b
     }
f96e0b
 
f96e0b
-#if !(defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS))
f96e0b
+#if !USE_SCANCODE_SET
f96e0b
   current_set = 1;
f96e0b
   return;
f96e0b
 #else
f96e0b
@@ -570,9 +576,13 @@ grub_keyboard_controller_init (struct grub_term_input *term __attribute__ ((unus
f96e0b
       keyboard_controller_wait_until_ready ();
f96e0b
       grub_inb (KEYBOARD_REG_DATA);
f96e0b
     }
f96e0b
-#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
f96e0b
+#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
f96e0b
   grub_keyboard_controller_orig = 0;
f96e0b
   grub_keyboard_orig_set = 2;
f96e0b
+#elif defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_COREBOOT)
f96e0b
+  /* *BSD relies on those settings.  */
f96e0b
+  grub_keyboard_controller_orig = KEYBOARD_AT_TRANSLATE;
f96e0b
+  grub_keyboard_orig_set = 2;
f96e0b
 #else
f96e0b
   grub_keyboard_controller_orig = grub_keyboard_controller_read ();
f96e0b
   grub_keyboard_orig_set = query_mode ();
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b