~ilya-yanok/ubuntu/precise/grub2/fix-for-948716

« back to all changes in this revision

Viewing changes to term/i386/pc/at_keyboard.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Millan
  • Date: 2009-07-25 19:00:53 UTC
  • mfrom: (1.6.3 upstream)
  • mto: (17.4.13 sid)
  • mto: This revision was merged to the branch mainline in revision 53.
  • Revision ID: james.westby@ubuntu.com-20090725190053-uv3lm6ya3zxs77ep
ImportĀ upstreamĀ versionĀ 1.96+20090725

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  GRUB  --  GRand Unified Bootloader
3
 
 *  Copyright (C) 2007,2008,2009  Free Software Foundation, Inc.
 
3
 *  Copyright (C) 2007,2008  Free Software Foundation, Inc.
4
4
 *
5
5
 *  GRUB is free software: you can redistribute it and/or modify
6
6
 *  it under the terms of the GNU General Public License as published by
135
135
grub_keyboard_getkey (void)
136
136
{
137
137
  grub_uint8_t key;
138
 
  if (! KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS)))
 
138
  if (KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS)))
139
139
    return -1;
140
140
  key = grub_inb (KEYBOARD_REG_DATA);
141
141
  /* FIXME */ grub_keyboard_isr (key);
146
146
 
147
147
/* If there is a character pending, return it; otherwise return -1.  */
148
148
static int
149
 
grub_at_keyboard_getkey_noblock (void)
 
149
grub_at_keyboard_checkkey (void)
150
150
{
151
151
  int code, key;
152
152
  code = grub_keyboard_getkey ();
186
186
              key += 'a' - 'A';
187
187
          }
188
188
    }
189
 
  return key;
190
 
}
191
 
 
192
 
static int
193
 
grub_at_keyboard_checkkey (void)
194
 
{
195
 
  /* FIXME: this will be triggered by BREAK events.  */
196
 
  return KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS)) ? 1 : -1;
 
189
  return (int) key;
197
190
}
198
191
 
199
192
static int
202
195
  int key;
203
196
  do
204
197
    {
205
 
      key = grub_at_keyboard_getkey_noblock ();
 
198
      key = grub_at_keyboard_checkkey ();
206
199
    } while (key == -1);
207
200
  return key;
208
201
}