From 1b4595cebf919f2497be93858a4ec61a4c14db22 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 2 Nov 2009 23:57:09 +0100 Subject: [PATCH] AT keyboard support for Yeeloong --- conf/i386.rmk | 2 +- conf/mips.rmk | 6 ++++++ include/grub/i386/at_keyboard.h | 32 -------------------------------- term/{i386/pc => }/at_keyboard.c | 6 +++--- 4 files changed, 10 insertions(+), 36 deletions(-) rename term/{i386/pc => }/at_keyboard.c (98%) diff --git a/conf/i386.rmk b/conf/i386.rmk index 33d49b53c..15529a122 100644 --- a/conf/i386.rmk +++ b/conf/i386.rmk @@ -6,7 +6,7 @@ cpuid_mod_CFLAGS = $(COMMON_CFLAGS) cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) pkglib_MODULES += at_keyboard.mod -at_keyboard_mod_SOURCES = term/i386/pc/at_keyboard.c +at_keyboard_mod_SOURCES = term/at_keyboard.c at_keyboard_mod_CFLAGS = $(COMMON_CFLAGS) at_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/mips.rmk b/conf/mips.rmk index cba8281e8..03765ad8e 100644 --- a/conf/mips.rmk +++ b/conf/mips.rmk @@ -192,4 +192,10 @@ linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_ASFLAGS = $(COMMON_ASFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For at_keyboard.mod. +pkglib_MODULES += at_keyboard.mod +at_keyboard_mod_SOURCES = term/at_keyboard.c +at_keyboard_mod_CFLAGS = $(COMMON_CFLAGS) +at_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/include/grub/i386/at_keyboard.h b/include/grub/i386/at_keyboard.h index 96b21627f..8769c2f11 100644 --- a/include/grub/i386/at_keyboard.h +++ b/include/grub/i386/at_keyboard.h @@ -19,39 +19,7 @@ #ifndef GRUB_CPU_AT_KEYBOARD_HEADER #define GRUB_CPU_AT_KEYBOARD_HEADER 1 -#include - -#define SHIFT_L 0x2a -#define SHIFT_R 0x36 -#define CTRL 0x1d -#define ALT 0x38 -#define CAPS_LOCK 0x3a - #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_COMMAND_REBOOT 0xfe - -#define KEYBOARD_SCANCODE_SET1 0x40 - -#define KEYBOARD_ISMAKE(x) !((x) & 0x80) -#define KEYBOARD_ISREADY(x) ((x) & 0x01) -#define KEYBOARD_SCANCODE(x) ((x) & 0x7f) - -#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 - #endif diff --git a/term/i386/pc/at_keyboard.c b/term/at_keyboard.c similarity index 98% rename from term/i386/pc/at_keyboard.c rename to term/at_keyboard.c index cf30e7242..5d8dc3d89 100644 --- a/term/i386/pc/at_keyboard.c +++ b/term/at_keyboard.c @@ -17,9 +17,9 @@ */ #include -#include -#include -#include +#include +#include +#include #include #include