From caeb33b22de9493023993090d54e8f4f6156e4cf Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 3 Jul 2001 17:56:32 +0000 Subject: 2001-07-03 Mike Seirs * comm/tty_drv.c, comm/uart.c, comm/uart.h: Adds the capability to use task driven serial I/O to ti386 BSPs. This patch leaves thex default I/O mode to be IRQ. If you want to use task I/O mode, then the tty_drv.c file needs to be modified. Basically, all you need to change is the data values of the termios callbacks structure. This callback structure is used in the tty1_open and tty2_open functions. The values you need to set are commented out in the source code. --- c/src/lib/libbsp/i386/shared/comm/tty_drv.c | 63 ++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 14 deletions(-) (limited to 'c/src/lib/libbsp/i386/shared/comm/tty_drv.c') diff --git a/c/src/lib/libbsp/i386/shared/comm/tty_drv.c b/c/src/lib/libbsp/i386/shared/comm/tty_drv.c index 490260675f..502ab6c4f9 100644 --- a/c/src/lib/libbsp/i386/shared/comm/tty_drv.c +++ b/c/src/lib/libbsp/i386/shared/comm/tty_drv.c @@ -18,6 +18,12 @@ * MODIFICATION/HISTORY: * * $Log$ + * Revision 1.3 2000/12/05 16:37:38 joel + * 2000-12-01 Joel Sherrill + * + * * pc386/console/console.c, pc386/console/serial_mouse.c, + * pc386/console/vgainit.c, shared/comm/tty_drv.c: Remove warnings. + * * Revision 1.2 2000/10/18 16:10:50 joel * 2000-10-18 Charles-Antoine Gauthier * @@ -47,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -175,17 +182,31 @@ tty1_open(rtems_device_major_number major, void *arg) { rtems_status_code status; +#ifndef USE_TASK_DRIVEN + static rtems_termios_callbacks cb = + { + NULL, /* firstOpen */ + tty1_last_close, /* lastClose */ + NULL, /* poll read */ + BSP_uart_termios_write_com1, /* write */ + tty1_conSetAttr, /* setAttributes */ + NULL, /* stopRemoteTx */ + NULL, /* startRemoteTx */ + TERMIOS_IRQ_DRIVEN /* outputUsesInterrupts */ + }; +#else static rtems_termios_callbacks cb = { - NULL, /* firstOpen */ - tty1_last_close, /* lastClose */ - NULL, /* poll read */ + NULL, /* firstOpen */ + tty1_last_close, /* lastClose */ + BSP_uart_termios_read_com1, /* poll read */ BSP_uart_termios_write_com1, /* write */ - tty1_conSetAttr, /* setAttributes */ - NULL, /* stopRemoteTx */ - NULL, /* startRemoteTx */ - 1 /* outputUsesInterrupts */ + tty1_conSetAttr, /* setAttributes */ + NULL, /* stopRemoteTx */ + NULL, /* startRemoteTx */ + TERMIOS_TASK_DRIVEN /* outputUsesInterrupts */ }; +#endif status = rtems_termios_open( major, minor, arg, &cb ); if(status != RTEMS_SUCCESSFUL) @@ -451,17 +472,31 @@ tty2_open(rtems_device_major_number major, void *arg) { rtems_status_code status; +#ifndef USE_TASK_DRIVEN + static rtems_termios_callbacks cb = + { + NULL, /* firstOpen */ + tty2_last_close, /* lastClose */ + NULL, /* poll read */ + BSP_uart_termios_write_com2, /* write */ + tty2_conSetAttr, /* setAttributes */ + NULL, /* stopRemoteTx */ + NULL, /* startRemoteTx */ + TERMIOS_IRQ_DRIVEN /* outputUsesInterrupts */ + }; +#else static rtems_termios_callbacks cb = { - NULL, /* firstOpen */ - tty2_last_close, /* lastClose */ - NULL, /* poll read */ + NULL, /* firstOpen */ + tty2_last_close, /* lastClose */ + BSP_uart_termios_read_com2, /* poll read */ BSP_uart_termios_write_com2, /* write */ - tty2_conSetAttr, /* setAttributes */ - NULL, /* stopRemoteTx */ - NULL, /* startRemoteTx */ - 1 /* outputUsesInterrupts */ + tty2_conSetAttr, /* setAttributes */ + NULL, /* stopRemoteTx */ + NULL, /* startRemoteTx */ + TERMIOS_TASK_DRIVEN /* outputUsesInterrupts */ }; +#endif status = rtems_termios_open (major, minor, arg, &cb); if(status != RTEMS_SUCCESSFUL) -- cgit v1.2.3