- Timestamp:
- 03/14/11 14:57:00 (13 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 3d4f749
- Parents:
- 3d6c1bb
- 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 1 2011-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 1 12 2011-03-04 Joel Sherrill <joel.sherrilL@OARcorp.com> 2 13 -
c/src/lib/libbsp/i386/pc386/Makefile.am
r3d6c1bb r1fef02ca 64 64 65 65 include_rtemsdir = $(includedir)/rtems 66 include_rtems_HEADERS = console/keyboard.h console/kd.h \ 67 console/serial_mouse.h console/ps2_drv.h 66 include_rtems_HEADERS = console/keyboard.h console/kd.h console/ps2_drv.h 68 67 69 68 include_HEADERS += ../../i386/shared/comm/i386_io.h … … 71 70 libbsp_a_SOURCES += console/console.c console/inch.c console/outch.c \ 72 71 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 \ 75 75 ../../i386/shared/comm/uart.c ../../i386/shared/comm/tty_drv.c 76 76 -
c/src/lib/libbsp/i386/pc386/console/console.c
r3d6c1bb r1fef02ca 1 1 /*-------------------------------------------------------------------------+ 2 | console.c v1.1 - PC386 BSP - 1997/08/073 +--------------------------------------------------------------------------+4 2 | This file contains the PC386 console I/O package. 5 3 +--------------------------------------------------------------------------+ … … 16 14 | expressed or implied. 17 15 +--------------------------------------------------------------------------+ 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 | 29 26 | 30 27 | $Id$ … … 45 42 46 43 #include <rtems/mw_uid.h> 47 #include "mouse_parser.h" 44 #include <rtems/mouse_parser.h> 45 #include <rtems/keyboard.h> 48 46 49 47 /* … … 72 70 int BSPCmdBaud = 9600; 73 71 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 */ 74 BSP_output_char_function_type BSP_output_char = 75 (BSP_output_char_function_type) _IBMPC_outch; 76 77 BSP_polling_getchar_function_type BSP_poll_char = BSP_wait_polled_input; 77 78 78 79 /*-------------------------------------------------------------------------+ 79 80 | External Prototypes 80 81 +--------------------------------------------------------------------------*/ 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 86 82 static 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 */ 100 87 static void 101 88 isr_on(const rtems_irq_connect_data *unused) … … 116 103 } 117 104 118 extern int rtems_kbpoll( void ); 105 static 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}; 119 112 120 113 static ssize_t … … 473 466 } /* console_write */ 474 467 475 extern int vt_ioctl( unsigned int cmd, unsigned long arg);476 477 468 /* 478 469 * Handle ioctl request. … … 551 542 return 0; 552 543 } 553 554 void keyboard_interrupt_wrapper(void *unused){555 keyboard_interrupt();556 }557 558 /*559 * BSP initialization560 */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 30 30 #define KBD_DEFLOCK 0 31 31 #endif 32 33 extern void add_to_queue( unsigned short );34 32 35 33 int set_bit(int nr, unsigned long * addr) -
c/src/lib/libbsp/i386/pc386/console/keyboard.h
r3d6c1bb r1fef02ca 1 1 /* 2 * $Id$3 *4 2 * Submitted by: Rosimildo da Silva: rdasilva@connecttel.com 5 3 * 4 * $Id$ 6 5 */ 7 6 … … 498 497 extern struct kbd_struct kbd_table[]; 499 498 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 500 void kbd_set_driver_handler( 501 void ( *handler )( void *, unsigned short, unsigned long ) 502 ); 504 503 505 504 static inline void show_console(void) … … 511 510 } 512 511 513 externvoid set_leds(void);512 void set_leds(void); 514 513 515 514 static inline int vc_kbd_mode(struct kbd_struct * kbd, int flag) 516 515 { 517 516 return ((kbd->modeflags >> flag) & 1); 518 517 } 519 518 520 519 static inline int vc_kbd_led(struct kbd_struct * kbd, int flag) 521 520 { 522 521 return ((kbd->ledflagstate >> flag) & 1); 523 522 } 524 523 525 524 static inline void set_vc_kbd_mode(struct kbd_struct * kbd, int flag) 526 525 { 527 526 kbd->modeflags |= 1 << flag; 528 527 } 529 528 530 529 static inline void set_vc_kbd_led(struct kbd_struct * kbd, int flag) 531 530 { 532 531 kbd->ledflagstate |= 1 << flag; 533 532 } 534 533 535 534 static inline void clr_vc_kbd_mode(struct kbd_struct * kbd, int flag) 536 535 { 537 536 kbd->modeflags &= ~(1 << flag); 538 537 } 539 538 540 539 static inline void clr_vc_kbd_led(struct kbd_struct * kbd, int flag) 541 540 { 542 541 kbd->ledflagstate &= ~(1 << flag); 543 542 } 544 543 545 544 static inline void chg_vc_kbd_lock(struct kbd_struct * kbd, int flag) 546 545 { 547 546 kbd->lockstate ^= 1 << flag; 548 547 } 549 548 550 549 static inline void chg_vc_kbd_slock(struct kbd_struct * kbd, int flag) 551 550 { 552 551 kbd->slockstate ^= 1 << flag; 553 552 } 554 553 555 554 static inline void chg_vc_kbd_mode(struct kbd_struct * kbd, int flag) 556 555 { 557 556 kbd->modeflags ^= 1 << flag; 558 557 } 559 558 560 559 static inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag) 561 560 { 562 563 561 kbd->ledflagstate ^= 1 << flag; 562 set_leds(); 564 563 } 565 564 … … 567 566 568 567 /* keyboard.c */ 569 568 int kbd_init(void); 570 569 int getkeycode(unsigned int scancode); 571 570 int setkeycode(unsigned int scancode, unsigned int keycode); 572 571 void compute_shiftstate(void); 572 unsigned char getledstate(void); 573 void setledstate(struct kbd_struct *kbd, unsigned int led); 574 void handle_scancode(unsigned char scancode, int down); 575 576 /* kbd_parser.c */ 577 void register_kbd_msg_queue( char *qname, int port ); 578 void unregister_kbd_msg_queue( int port ); 573 579 574 580 /* defkeymap.c */ 575 576 581 extern unsigned int keymap_count; 577 582 583 /* inch.c */ 584 void add_to_queue( unsigned short ); 585 int getch( void ); 586 int BSP_wait_polled_input(void); 587 int rtems_kbpoll( void ); 588 589 /* outch.c */ 590 void _IBMPC_initVideo(void); 591 592 /* pc_keyb.c */ 593 void keyboard_interrupt(void *unused); 594 595 /* vt.c */ 596 int vt_ioctl( unsigned int cmd, unsigned long arg); 597 578 598 #endif -
c/src/lib/libbsp/i386/pc386/console/pc_keyb.c
r3d6c1bb r1fef02ca 22 22 23 23 #include <bsp.h> 24 #include <rtems/keyboard.h> 24 25 #include "i386kbd.h" 25 26 /* keyboard.c */27 extern void handle_scancode(unsigned char scancode, int down);28 26 29 27 static unsigned char handle_kbd_event(void); … … 385 383 } 386 384 387 void keyboard_interrupt( void)385 void keyboard_interrupt(void *unused) 388 386 { 389 387 handle_kbd_event(); … … 628 626 629 627 } 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 10 10 * C. Scott Ananian <cananian@alumni.princeton.edu> 1999-01-29. 11 11 * 12 * RTEMS port: by Rosimildo da Silva. 13 * This module was ported from Linux. 12 * RTEMS port: by Rosimildo da Silva. 14 13 * 14 * $Id$ 15 15 */ 16 16 … … 27 27 #include <i386_io.h> 28 28 #include <rtems/mw_uid.h> 29 #include <rtems/mouse_parser.h> 29 30 30 31 #define INITIALIZE_MOUSE 31 32 /* Some configuration switches are present in the include file... */ 32 33 #include "ps2_mouse.h" 33 #include "mouse_parser.h"34 34 35 35 static void kbd_write_command_w(int data); … … 60 60 61 61 static void ps2_mouse_interrupt(rtems_irq_hdl_param); 62 63 static void ( *driver_input_handler_ps2 )( void *, unsigned char *, int ) = 0; 62 static mouse_parser_enqueue_handler driver_input_handler_ps2 = NULL; 64 63 65 64 /* … … 67 66 * from the serial port. 68 67 */ 69 void ps2_set_driver_handler( int port, void ( *handler )( void *, unsigned char *, int ) ) 68 void ps2_set_driver_handler( 69 int port, 70 mouse_parser_enqueue_handler handler 71 ) 70 72 { 71 73 driver_input_handler_ps2 = handler; … … 186 188 /* if the input queue is active, add to it */ 187 189 if( driver_input_handler_ps2 ) { 188 driver_input_handler_ps2( NULL,&scancode, 1 );190 driver_input_handler_ps2( &scancode, 1 ); 189 191 } else { 190 192 /* post this byte to termios */ … … 558 560 559 561 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 ); 562 565 break; 563 566 564 567 case MW_UID_UNREGISTER_DEVICE: 568 /* 565 569 unregister_mou_msg_queue( -1 ); 570 */ 571 ps2_set_driver_handler( minor, NULL ); 566 572 break; 567 573 } -
c/src/lib/libbsp/i386/pc386/console/vgainit.c
r3d6c1bb r1fef02ca 59 59 } REGIO; 60 60 61 /* extern data*/62 61 #if ROMFONT 63 62 extern FARADDR rom_char_addr; /* address of ROM font*/ -
c/src/lib/libbsp/i386/pc386/preinstall.am
r3d6c1bb r1fef02ca 107 107 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/kd.h 108 108 109 $(PROJECT_INCLUDE)/rtems/serial_mouse.h: console/serial_mouse.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)110 $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/serial_mouse.h111 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/serial_mouse.h112 113 109 $(PROJECT_INCLUDE)/rtems/ps2_drv.h: console/ps2_drv.h $(PROJECT_INCLUDE)/rtems/$(dirstamp) 114 110 $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/ps2_drv.h
Note: See TracChangeset
for help on using the changeset viewer.