summaryrefslogtreecommitdiffstats
path: root/bsps/i386/pc386/console/kbd_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/i386/pc386/console/kbd_parser.c')
-rw-r--r--bsps/i386/pc386/console/kbd_parser.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/bsps/i386/pc386/console/kbd_parser.c b/bsps/i386/pc386/console/kbd_parser.c
new file mode 100644
index 0000000000..f3d2f9c55a
--- /dev/null
+++ b/bsps/i386/pc386/console/kbd_parser.c
@@ -0,0 +1,47 @@
+/*
+ * The contents of this file were formerly in console.c which
+ * had the following copyright notice:
+ *
+ * (C) Copyright 1997
+ * NavIST Group - Real-Time Distributed Systems and Industrial Automation
+ * http://pandora.ist.utl.pt
+ * Instituto Superior Tecnico * Lisboa * PORTUGAL
+ *
+ * The original code and subsequent modifications are:
+ *
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#include <rtems.h>
+#include <rtems/keyboard.h>
+#include <rtems/mw_uid.h>
+
+/* adds a kbd message to the queue */
+static void kbd_parser( void *ptr, unsigned short keycode, unsigned long mods )
+{
+ struct MW_UID_MESSAGE m;
+ struct kbd_struct * kbd = (struct kbd_struct *)ptr;
+
+ m.type = MV_UID_KBD;
+ m.m.kbd.code = keycode;
+ m.m.kbd.modifiers = kbd->ledflagstate;
+ m.m.kbd.mode = kbd->kbdmode;
+ /* printk( "kbd: msg: keycode=%X, mod=%X\n", keycode, mods ); */
+
+ uid_send_message( &m );
+}
+
+void register_kbd_msg_queue( char *q_name, int port )
+{
+ kbd_set_driver_handler( kbd_parser );
+}
+
+void unregister_kbd_msg_queue( int port )
+{
+ kbd_set_driver_handler( NULL );
+}