mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
2009-09-24 Robert Millan <rmh.grub@aybabtu.com>
* 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.
This commit is contained in:
1 parent
ff42022396
commit
74c958b180
3 files changed
+18
-7
No files matched your search
@@ -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 @@ static int
|
||||
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 @@ grub_keyboard_getkey (void)
|
||||
|
||||
/* 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 @@ grub_at_keyboard_checkkey (void)
|
||||
key += 'a' - 'A';
|
||||
}
|
||||
}
|
||||
return (int) key;
|
||||
return key;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -195,7 +195,7 @@ grub_at_keyboard_getkey (void)
|
||||
int key;
|
||||
do
|
||||
{
|
||||
key = grub_at_keyboard_checkkey ();
|
||||
key = grub_at_keyboard_getkey_noblock ();
|
||||
} while (key == -1);
|
||||
return key;
|
||||
}
|
||||
@@ -220,7 +220,8 @@ static struct grub_term_input grub_at_keyboard_term =
|
||||
.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,
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user