source: rtems/bsps/i386/pc386/console/kbd_parser.c

Last change on this file was d7d66d7, checked in by Sebastian Huber <sebastian.huber@…>, on 04/19/18 at 04:28:01

bsps: Move console drivers to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  The contents of this file were formerly in console.c which
3 *  had the following copyright notice:
4 *
5 *  (C) Copyright 1997
6 *  NavIST Group - Real-Time Distributed Systems and Industrial Automation
7 *  http://pandora.ist.utl.pt
8 *  Instituto Superior Tecnico * Lisboa * PORTUGAL
9 *
10 *  The original code and subsequent modifications are:
11 *
12 *  COPYRIGHT (c) 1989-2011.
13 *  On-Line Applications Research Corporation (OAR).
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.rtems.org/license/LICENSE.
18 */
19
20#include <rtems.h>
21#include <rtems/keyboard.h>
22#include <rtems/mw_uid.h>
23
24/* adds a kbd message to the queue */
25static void kbd_parser( void *ptr, unsigned short keycode, unsigned long mods )
26{
27  struct MW_UID_MESSAGE m;
28  struct kbd_struct * kbd = (struct kbd_struct *)ptr;
29
30  m.type = MV_UID_KBD;
31  m.m.kbd.code       = keycode;
32  m.m.kbd.modifiers  = kbd->ledflagstate;
33  m.m.kbd.mode       = kbd->kbdmode;
34  /*  printk( "kbd: msg: keycode=%X, mod=%X\n", keycode, mods );  */
35
36  uid_send_message( &m );
37}
38
39void register_kbd_msg_queue( char *q_name, int port )
40{
41  kbd_set_driver_handler( kbd_parser );
42}
43
44void unregister_kbd_msg_queue( int port )
45{
46   kbd_set_driver_handler( NULL );
47}
Note: See TracBrowser for help on using the repository browser.