diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2001-07-03 17:56:32 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2001-07-03 17:56:32 +0000 |
commit | caeb33b22de9493023993090d54e8f4f6156e4cf (patch) | |
tree | f67c5fd1d0ad83cb5eca3c7fe960084f58ab86c7 /c/src/lib/libbsp/i386/shared/comm/tty_drv.c | |
parent | 2001-07-03 Joel Sherrill <joel@OARcorp.com> (diff) | |
download | rtems-caeb33b22de9493023993090d54e8f4f6156e4cf.tar.bz2 |
2001-07-03 Mike Seirs <mike@poliac.com>
* 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.
Diffstat (limited to 'c/src/lib/libbsp/i386/shared/comm/tty_drv.c')
-rw-r--r-- | c/src/lib/libbsp/i386/shared/comm/tty_drv.c | 63 |
1 files changed, 49 insertions, 14 deletions
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 <joel@OARcorp.com> + * + * * 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 <charles.gauthier@nrc.ca> * @@ -47,6 +53,7 @@ #include <bsp.h> #include <irq.h> #include <rtems/libio.h> +#include <rtems/termiostypes.h> #include <termios.h> #include <uart.h> #include <libcpu/cpuModel.h> @@ -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) |