commit-grub
[Top][All Lists]
Advanced

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

[2611] 2009-09-24 Robert Millan <address@hidden>


From: Robert Millan
Subject: [2611] 2009-09-24 Robert Millan <address@hidden>
Date: Thu, 24 Sep 2009 13:15:53 +0000

Revision: 2611
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2611
Author:   robertmh
Date:     2009-09-24 13:15:51 +0000 (Thu, 24 Sep 2009)
Log Message:
-----------
2009-09-24  Robert Millan  <address@hidden>

        * include/grub/i386/at_keyboard.h (KEYBOARD_ISREADY): Negate
        return value.
        * term/i386/pc/at_keyboard.c (grub_keyboard_getkey): Negate
        KEYBOARD_ISREADY check.
        (grub_at_keyboard_checkkey): Rename to ...
        (grub_at_keyboard_getkey_noblock): ... this.  Update all users.
        Remove gratuitous cast.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/include/grub/i386/at_keyboard.h
    trunk/grub2/term/i386/pc/at_keyboard.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog       2009-09-23 17:18:06 UTC (rev 2610)
+++ trunk/grub2/ChangeLog       2009-09-24 13:15:51 UTC (rev 2611)
@@ -1,3 +1,13 @@
+2009-09-24  Robert Millan  <address@hidden>
+
+       * include/grub/i386/at_keyboard.h (KEYBOARD_ISREADY): Negate
+       return value.
+       * term/i386/pc/at_keyboard.c (grub_keyboard_getkey): Negate
+       KEYBOARD_ISREADY check.
+       (grub_at_keyboard_checkkey): Rename to ...
+       (grub_at_keyboard_getkey_noblock): ... this.  Update all users.
+       Remove gratuitous cast.
+
 2009-09-23  Colin Watson  <address@hidden>
 
        * configure.ac: Call AC_PROG_MKDIR_P.

Modified: trunk/grub2/include/grub/i386/at_keyboard.h
===================================================================
--- trunk/grub2/include/grub/i386/at_keyboard.h 2009-09-23 17:18:06 UTC (rev 
2610)
+++ trunk/grub2/include/grub/i386/at_keyboard.h 2009-09-24 13:15:51 UTC (rev 
2611)
@@ -39,7 +39,7 @@
 #define KEYBOARD_SCANCODE_SET1         0x40
 
 #define KEYBOARD_ISMAKE(x)     !((x) & 0x80)
-#define KEYBOARD_ISREADY(x)    (((x) & 0x01) == 0)
+#define KEYBOARD_ISREADY(x)    ((x) & 0x01)
 #define KEYBOARD_SCANCODE(x)   ((x) & 0x7f)
 
 #ifdef GRUB_MACHINE_IEEE1275

Modified: trunk/grub2/term/i386/pc/at_keyboard.c
===================================================================
--- trunk/grub2/term/i386/pc/at_keyboard.c      2009-09-23 17:18:06 UTC (rev 
2610)
+++ trunk/grub2/term/i386/pc/at_keyboard.c      2009-09-24 13:15:51 UTC (rev 
2611)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2007,2008  Free Software Foundation, Inc.
+ *  Copyright (C) 2007,2008,2009  Free Software Foundation, Inc.
  *
  *  GRUB is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -135,7 +135,7 @@
 grub_keyboard_getkey (void)
 {
   grub_uint8_t key;
-  if (KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS)))
+  if (! KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS)))
     return -1;
   key = grub_inb (KEYBOARD_REG_DATA);
   /* FIXME */ grub_keyboard_isr (key);
@@ -146,7 +146,7 @@
 
 /* If there is a character pending, return it; otherwise return -1.  */
 static int
-grub_at_keyboard_checkkey (void)
+grub_at_keyboard_getkey_noblock (void)
 {
   int code, key;
   code = grub_keyboard_getkey ();
@@ -186,7 +186,7 @@
              key += 'a' - 'A';
          }
     }
-  return (int) key;
+  return key;
 }
 
 static int
@@ -195,7 +195,7 @@
   int key;
   do
     {
-      key = grub_at_keyboard_checkkey ();
+      key = grub_at_keyboard_getkey_noblock ();
     } while (key == -1);
   return key;
 }
@@ -220,7 +220,8 @@
     .name = "at_keyboard",
     .init = grub_keyboard_controller_init,
     .fini = grub_keyboard_controller_fini,
-    .checkkey = grub_at_keyboard_checkkey,
+    /* FIXME: This routine flushes input buffer, and it shouldn't.  */
+    .checkkey = grub_at_keyboard_getkey_noblock,
     .getkey = grub_at_keyboard_getkey,
   };
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]