Changeset 1fef02ca in rtems


Ignore:
Timestamp:
Mar 14, 2011, 2:57:00 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
3d4f749
Parents:
3d6c1bb
Message:

2011-03-14 Joel Sherrill <joel.sherrill@…>

PR 1762/cpukit

  • Makefile.am, preinstall.am, console/console.c, console/keyboard.c, console/keyboard.h, console/pc_keyb.c, console/ps2_mouse.c, console/vgainit.c: Made mouse parser engine generic. Now use generic serial mouse driver. Moved many externs from C to .h.
  • console/kbd_parser.c, console/serial_mouse_config.c: New files.
  • console/mouse_parser.c, console/mouse_parser.h, console/serial_mouse.c, console/serial_mouse.h: Removed.
Location:
c/src/lib/libbsp/i386/pc386
Files:
2 added
4 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/ChangeLog

    r3d6c1bb r1fef02ca  
     12011-03-14      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        PR 1762/cpukit
     4        * Makefile.am, preinstall.am, console/console.c, console/keyboard.c,
     5        console/keyboard.h, console/pc_keyb.c, console/ps2_mouse.c,
     6        console/vgainit.c: Made mouse parser engine generic. Now use generic
     7        serial mouse driver. Moved many externs from C to .h.
     8        * console/kbd_parser.c, console/serial_mouse_config.c: New files.
     9        * console/mouse_parser.c, console/mouse_parser.h,
     10        console/serial_mouse.c, console/serial_mouse.h: Removed.
     11
    1122011-03-04      Joel Sherrill <joel.sherrilL@OARcorp.com>
    213
  • c/src/lib/libbsp/i386/pc386/Makefile.am

    r3d6c1bb r1fef02ca  
    6464
    6565include_rtemsdir = $(includedir)/rtems
    66 include_rtems_HEADERS = console/keyboard.h console/kd.h \
    67     console/serial_mouse.h console/ps2_drv.h
     66include_rtems_HEADERS = console/keyboard.h console/kd.h console/ps2_drv.h
    6867
    6968include_HEADERS += ../../i386/shared/comm/i386_io.h
     
    7170libbsp_a_SOURCES += console/console.c console/inch.c console/outch.c \
    7271    console/defkeymap.c console/fb_vga.c console/keyboard.c \
    73     console/mouse_parser.c console/pc_keyb.c console/ps2_mouse.c \
    74     console/serial_mouse.c console/vgainit.c console/vt.c console/videoAsm.S \
     72    console/pc_keyb.c console/ps2_mouse.c \
     73    console/vgainit.c console/vt.c console/videoAsm.S \
     74    console/kbd_parser.c console/serial_mouse_config.c \
    7575    ../../i386/shared/comm/uart.c ../../i386/shared/comm/tty_drv.c
    7676
  • c/src/lib/libbsp/i386/pc386/console/console.c

    r3d6c1bb r1fef02ca  
    11/*-------------------------------------------------------------------------+
    2 | console.c v1.1 - PC386 BSP - 1997/08/07
    3 +--------------------------------------------------------------------------+
    42| This file contains the PC386 console I/O package.
    53+--------------------------------------------------------------------------+
     
    1614| expressed or implied.
    1715+--------------------------------------------------------------------------+
    18 | This code is based on:
    19 |   console.c,v 1.4 1995/12/19 20:07:23 joel Exp - go32 BSP
    20 | With the following copyright notice:
    21 | **************************************************************************
    22 | *  COPYRIGHT (c) 1989-1999.
    23 | *  On-Line Applications Research Corporation (OAR).
    24 | *
    25 | *  The license and distribution terms for this file may be
    26 | *  found in the file LICENSE in this distribution or at
    27 | *  http://www.rtems.com/license/LICENSE.
    28 | **************************************************************************
     16| This code was based on code from the go32 BSP and was copyright by OAR.
     17| Subsequent modifications are also copyright OAR.
     18|
     19|  COPYRIGHT (c) 1989-2011.
     20|  On-Line Applications Research Corporation (OAR).
     21|
     22|  The license and distribution terms for this file may be
     23|  found in the file LICENSE in this distribution or at
     24|  http://www.rtems.com/license/LICENSE.
     25|
    2926|
    3027|  $Id$
     
    4542
    4643#include <rtems/mw_uid.h>
    47 #include "mouse_parser.h"
     44#include <rtems/mouse_parser.h>
     45#include <rtems/keyboard.h>
    4846
    4947/*
     
    7270int BSPCmdBaud     = 9600;
    7371
    74 extern BSP_polling_getchar_function_type BSP_poll_char;
    75 extern int getch( void );
    76 extern void kbd_init( void );
     72
     73/* printk support */
     74BSP_output_char_function_type BSP_output_char =
     75                       (BSP_output_char_function_type) _IBMPC_outch;
     76
     77BSP_polling_getchar_function_type BSP_poll_char = BSP_wait_polled_input;
    7778
    7879/*-------------------------------------------------------------------------+
    7980| External Prototypes
    8081+--------------------------------------------------------------------------*/
    81 extern void keyboard_interrupt(void );
    82 extern void keyboard_interrupt_wrapper(void *);
    83 extern int BSP_wait_polled_input(void);
    84 extern void _IBMPC_initVideo(void);
    85 
    8682static int  conSetAttr(int minor, const struct termios *);
    87 static void isr_on(const rtems_irq_connect_data *);
    88 static void isr_off(const rtems_irq_connect_data *);
    89 static int  isr_is_on(const rtems_irq_connect_data *);
    90 
    91 extern int rtems_kbpoll( void );
    92 
    93 static rtems_irq_connect_data console_isr_data = {BSP_KEYBOARD,
    94                                                   keyboard_interrupt_wrapper,
    95                                                   0,
    96                                                   isr_on,
    97                                                   isr_off,
    98                                                   isr_is_on};
    99 
     83
     84/*
     85 *  Keyboard Interrupt Configuration
     86 */
    10087static void
    10188isr_on(const rtems_irq_connect_data *unused)
     
    116103}
    117104
    118 extern int  rtems_kbpoll( void );
     105static rtems_irq_connect_data console_isr_data =
     106  {BSP_KEYBOARD,
     107   keyboard_interrupt,
     108   0,
     109   isr_on,
     110   isr_off,
     111   isr_is_on};
    119112
    120113static ssize_t
     
    473466} /* console_write */
    474467
    475 extern int vt_ioctl( unsigned int cmd, unsigned long arg);
    476 
    477468/*
    478469 * Handle ioctl request.
     
    551542  return 0;
    552543}
    553 
    554 void keyboard_interrupt_wrapper(void *unused){
    555   keyboard_interrupt();
    556 }
    557 
    558 /*
    559  * BSP initialization
    560  */
    561 
    562 BSP_output_char_function_type BSP_output_char =
    563                        (BSP_output_char_function_type) _IBMPC_outch;
    564 
    565 BSP_polling_getchar_function_type BSP_poll_char = BSP_wait_polled_input;
  • c/src/lib/libbsp/i386/pc386/console/keyboard.c

    r3d6c1bb r1fef02ca  
    3030#define KBD_DEFLOCK 0
    3131#endif
    32 
    33 extern void add_to_queue( unsigned short );
    3432
    3533int set_bit(int nr, unsigned long * addr)
  • c/src/lib/libbsp/i386/pc386/console/keyboard.h

    r3d6c1bb r1fef02ca  
    11/*
    2  * $Id$
    3  *
    42 *  Submitted by: Rosimildo da Silva:  rdasilva@connecttel.com
    53 *
     4 *  $Id$
    65 */
    76
     
    498497extern struct kbd_struct kbd_table[];
    499498
    500 extern int kbd_init(void);
    501 
    502 extern unsigned char getledstate(void);
    503 extern void setledstate(struct kbd_struct *kbd, unsigned int led);
     499
     500void kbd_set_driver_handler(
     501  void ( *handler )( void *, unsigned short, unsigned long )
     502);
    504503
    505504static inline void show_console(void)
     
    511510}
    512511
    513 extern void set_leds(void);
     512void set_leds(void);
    514513
    515514static inline int vc_kbd_mode(struct kbd_struct * kbd, int flag)
    516515{
    517         return ((kbd->modeflags >> flag) & 1);
     516  return ((kbd->modeflags >> flag) & 1);
    518517}
    519518
    520519static inline int vc_kbd_led(struct kbd_struct * kbd, int flag)
    521520{
    522         return ((kbd->ledflagstate >> flag) & 1);
     521  return ((kbd->ledflagstate >> flag) & 1);
    523522}
    524523
    525524static inline void set_vc_kbd_mode(struct kbd_struct * kbd, int flag)
    526525{
    527         kbd->modeflags |= 1 << flag;
     526  kbd->modeflags |= 1 << flag;
    528527}
    529528
    530529static inline void set_vc_kbd_led(struct kbd_struct * kbd, int flag)
    531530{
    532         kbd->ledflagstate |= 1 << flag;
     531  kbd->ledflagstate |= 1 << flag;
    533532}
    534533
    535534static inline void clr_vc_kbd_mode(struct kbd_struct * kbd, int flag)
    536535{
    537         kbd->modeflags &= ~(1 << flag);
     536  kbd->modeflags &= ~(1 << flag);
    538537}
    539538
    540539static inline void clr_vc_kbd_led(struct kbd_struct * kbd, int flag)
    541540{
    542         kbd->ledflagstate &= ~(1 << flag);
     541  kbd->ledflagstate &= ~(1 << flag);
    543542}
    544543
    545544static inline void chg_vc_kbd_lock(struct kbd_struct * kbd, int flag)
    546545{
    547         kbd->lockstate ^= 1 << flag;
     546  kbd->lockstate ^= 1 << flag;
    548547}
    549548
    550549static inline void chg_vc_kbd_slock(struct kbd_struct * kbd, int flag)
    551550{
    552         kbd->slockstate ^= 1 << flag;
     551  kbd->slockstate ^= 1 << flag;
    553552}
    554553
    555554static inline void chg_vc_kbd_mode(struct kbd_struct * kbd, int flag)
    556555{
    557         kbd->modeflags ^= 1 << flag;
     556  kbd->modeflags ^= 1 << flag;
    558557}
    559558
    560559static inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag)
    561560{
    562         kbd->ledflagstate ^= 1 << flag;
    563    set_leds();
     561  kbd->ledflagstate ^= 1 << flag;
     562  set_leds();
    564563}
    565564
     
    567566
    568567/* keyboard.c */
    569 
     568int kbd_init(void);
    570569int getkeycode(unsigned int scancode);
    571570int setkeycode(unsigned int scancode, unsigned int keycode);
    572571void compute_shiftstate(void);
     572unsigned char getledstate(void);
     573void setledstate(struct kbd_struct *kbd, unsigned int led);
     574void handle_scancode(unsigned char scancode, int down);
     575
     576/* kbd_parser.c */
     577void register_kbd_msg_queue( char *qname, int port );
     578void unregister_kbd_msg_queue( int port );
    573579
    574580/* defkeymap.c */
    575 
    576581extern unsigned int keymap_count;
    577582
     583/* inch.c */
     584void add_to_queue( unsigned short );
     585int getch( void );
     586int BSP_wait_polled_input(void);
     587int rtems_kbpoll( void );
     588
     589/* outch.c */
     590void _IBMPC_initVideo(void);
     591
     592/* pc_keyb.c */
     593void keyboard_interrupt(void *unused);
     594
     595/* vt.c */
     596int vt_ioctl( unsigned int cmd, unsigned long arg);
     597
    578598#endif
  • c/src/lib/libbsp/i386/pc386/console/pc_keyb.c

    r3d6c1bb r1fef02ca  
    2222
    2323#include <bsp.h>
     24#include <rtems/keyboard.h>
    2425#include "i386kbd.h"
    25 
    26 /* keyboard.c */
    27 extern void handle_scancode(unsigned char scancode, int down);
    2826
    2927static unsigned char handle_kbd_event(void);
     
    385383}
    386384
    387 void keyboard_interrupt( void )
     385void keyboard_interrupt(void *unused)
    388386{
    389387        handle_kbd_event();
     
    628626
    629627}
    630 
    631 /*
    632 char BSP_wait_polled_input( void )
    633 {
    634   int                   c;
    635   rtems_interrupt_level level;
    636 
    637   rtems_interrupt_disable(level);
    638   while ( ( c= kbd_wait_for_input() ) < 0 )
    639       continue;
    640   rtems_interrupt_enable(level);
    641   return c;
    642 }
    643 */
  • c/src/lib/libbsp/i386/pc386/console/ps2_mouse.c

    r3d6c1bb r1fef02ca  
    1010 * C. Scott Ananian <cananian@alumni.princeton.edu> 1999-01-29.
    1111 *
    12  * RTEMS port: by Rosimildo da Silva.
    13  * This module was ported from Linux.
     12 *  RTEMS port: by Rosimildo da Silva.
    1413 *
     14 *  $Id$
    1515 */
    1616
     
    2727#include <i386_io.h>
    2828#include <rtems/mw_uid.h>
     29#include <rtems/mouse_parser.h>
    2930
    3031#define  INITIALIZE_MOUSE
    3132/* Some configuration switches are present in the include file... */
    3233#include "ps2_mouse.h"
    33 #include "mouse_parser.h"
    3434
    3535static void kbd_write_command_w(int data);
     
    6060
    6161static void ps2_mouse_interrupt(rtems_irq_hdl_param);
    62 
    63 static void ( *driver_input_handler_ps2 )( void *,  unsigned char *, int ) = 0;
     62static mouse_parser_enqueue_handler driver_input_handler_ps2 = NULL;
    6463
    6564/*
     
    6766 * from the serial port.
    6867 */
    69 void ps2_set_driver_handler( int port, void ( *handler )( void *,  unsigned char *, int ) )
     68void ps2_set_driver_handler(
     69  int                          port,
     70  mouse_parser_enqueue_handler handler
     71)
    7072{
    7173  driver_input_handler_ps2 = handler;
     
    186188    /* if the input queue is active, add to it */
    187189    if( driver_input_handler_ps2 ) {
    188       driver_input_handler_ps2( NULL,  &scancode, 1 );
     190      driver_input_handler_ps2( &scancode, 1 );
    189191    } else {
    190192      /* post this byte to termios */
     
    558560
    559561    case MW_UID_REGISTER_DEVICE:
    560       printk( "PS2 Mouse: reg=%s\n", args->buffer );
    561       register_mou_msg_queue( args->buffer, -1 );
     562      printk( "PS2 Mouse: registering\n" );
     563      mouse_parser_initialize( "ps2" );
     564      ps2_set_driver_handler( minor, mouse_parser_enqueue );
    562565      break;
    563566
    564567    case MW_UID_UNREGISTER_DEVICE:
     568/*
    565569      unregister_mou_msg_queue( -1 );
     570*/
     571      ps2_set_driver_handler( minor, NULL );
    566572      break;
    567573  }
  • c/src/lib/libbsp/i386/pc386/console/vgainit.c

    r3d6c1bb r1fef02ca  
    5959} REGIO;
    6060
    61 /* extern data*/
    6261#if ROMFONT
    6362extern FARADDR          rom_char_addr;          /* address of ROM font*/
  • c/src/lib/libbsp/i386/pc386/preinstall.am

    r3d6c1bb r1fef02ca  
    107107PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/kd.h
    108108
    109 $(PROJECT_INCLUDE)/rtems/serial_mouse.h: console/serial_mouse.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
    110         $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/serial_mouse.h
    111 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/serial_mouse.h
    112 
    113109$(PROJECT_INCLUDE)/rtems/ps2_drv.h: console/ps2_drv.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
    114110        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/ps2_drv.h
Note: See TracChangeset for help on using the changeset viewer.