2008-08-06 Robert Millan <rmh@aybabtu.com>
* conf/i386-coreboot.rmk (pkglib_MODULES): Add `reboot.mod' and `halt.mod'. (reboot_mod_SOURCES, reboot_mod_CFLAGS, reboot_mod_LDFLAGS) (halt_mod_SOURCES, halt_mod_CFLAGS, halt_mod_LDFLAGS): New variables. * kern/i386/halt.c: New file. * kern/i386/reboot.c: Likewise. * include/grub/i386/reboot.h: Likewise. * include/grub/i386/halt.h: Likewise. * commands/halt.c [! GRUB_MACHINE_IEEE1275 ! GRUB_MACHINE_EFI]: Include `<grub/cpu/halt.h>'. * commands/reboot.c [! GRUB_MACHINE_IEEE1275 ! GRUB_MACHINE_EFI] [! GRUB_MACHINE_PCBIOS]: Include `<grub/cpu/reboot.h>'. * term/i386/pc/at_keyboard.c: Include `<grub/cpu/at_keyboard.h>'. (SHIFT_L, SHIFT_R, CTRL, ALT, CAPS_LOCK, KEYBOARD_REG_DATA) (KEYBOARD_REG_STATUS, KEYBOARD_COMMAND_ISREADY, KEYBOARD_COMMAND_READ) (KEYBOARD_COMMAND_WRITE, KEYBOARD_COMMAND_REBOOT) (KEYBOARD_SCANCODE_SET1, KEYBOARD_ISMAKE, KEYBOARD_ISREADY) (KEYBOARD_SCANCODE, OLPC_UP, OLPC_DOWN, OLPC_LEFT, OLPC_RIGHT): Move from here ... * include/grub/i386/at_keyboard.h: ... to here.
This commit is contained in:
parent
24371d2620
commit
a55d42e0e0
14 changed files with 428 additions and 49 deletions
|
@ -17,16 +17,12 @@
|
|||
*/
|
||||
|
||||
#include <grub/machine/console.h>
|
||||
#include <grub/machine/machine.h>
|
||||
#include <grub/cpu/at_keyboard.h>
|
||||
#include <grub/cpu/io.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/term.h>
|
||||
|
||||
#define SHIFT_L 0x2a
|
||||
#define SHIFT_R 0x36
|
||||
#define CTRL 0x1d
|
||||
#define ALT 0x38
|
||||
#define CAPS_LOCK 0x3a
|
||||
static short at_keyboard_status = 0;
|
||||
|
||||
#define KEYBOARD_STATUS_SHIFT_L (1 << 0)
|
||||
#define KEYBOARD_STATUS_SHIFT_R (1 << 1)
|
||||
|
@ -36,34 +32,6 @@
|
|||
#define KEYBOARD_STATUS_CTRL_R (1 << 5)
|
||||
#define KEYBOARD_STATUS_CAPS_LOCK (1 << 6)
|
||||
|
||||
#define KEYBOARD_REG_DATA 0x60
|
||||
#define KEYBOARD_REG_STATUS 0x64
|
||||
|
||||
/* Used for sending commands to the controller. */
|
||||
#define KEYBOARD_COMMAND_ISREADY(x) !((x) & 0x02)
|
||||
#define KEYBOARD_COMMAND_READ 0x20
|
||||
#define KEYBOARD_COMMAND_WRITE 0x60
|
||||
|
||||
#define KEYBOARD_SCANCODE_SET1 0x40
|
||||
|
||||
#define KEYBOARD_ISMAKE(x) !((x) & 0x80)
|
||||
#define KEYBOARD_ISREADY(x) (((x) & 0x01) == 0)
|
||||
#define KEYBOARD_SCANCODE(x) ((x) & 0x7f)
|
||||
|
||||
static short at_keyboard_status = 0;
|
||||
|
||||
#ifdef GRUB_MACHINE_IEEE1275
|
||||
#define OLPC_UP GRUB_TERM_UP
|
||||
#define OLPC_DOWN GRUB_TERM_DOWN
|
||||
#define OLPC_LEFT GRUB_TERM_LEFT
|
||||
#define OLPC_RIGHT GRUB_TERM_RIGHT
|
||||
#else
|
||||
#define OLPC_UP '\0'
|
||||
#define OLPC_DOWN '\0'
|
||||
#define OLPC_LEFT '\0'
|
||||
#define OLPC_RIGHT '\0'
|
||||
#endif
|
||||
|
||||
static char keyboard_map[128] =
|
||||
{
|
||||
'\0', GRUB_TERM_ESC, '1', '2', '3', '4', '5', '6',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue