From 1f5d2baf0607dcf6c6f6fd4d8e887cbc94361b61 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Wed, 2 Jul 2003 14:20:36 +0000 Subject: Patch by Chris Johns adding the rtems_termios_bufsize call. --- cpukit/libcsupport/ChangeLog | 4 ++++ cpukit/libcsupport/include/rtems/libio.h | 11 +++++++++++ cpukit/libcsupport/src/termios.c | 26 +++++++++++++++++++------- 3 files changed, 34 insertions(+), 7 deletions(-) (limited to 'cpukit/libcsupport') diff --git a/cpukit/libcsupport/ChangeLog b/cpukit/libcsupport/ChangeLog index 087d9aa371..769483d6ae 100644 --- a/cpukit/libcsupport/ChangeLog +++ b/cpukit/libcsupport/ChangeLog @@ -1,3 +1,7 @@ +2003-07-02 Chris Johns + * include/rtems/libio.h, src/termios.c: Patch by Chris Johns + adding the rtems_termios_bufsize call. + 2003-05-30 Ralf Corsepius * Makefile.am: Conditionally install stdint.h/inttypes.h. diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h index de41d6388f..b182444415 100644 --- a/cpukit/libcsupport/include/rtems/libio.h +++ b/cpukit/libcsupport/include/rtems/libio.h @@ -554,6 +554,17 @@ typedef struct rtems_termios_callbacks { void rtems_termios_initialize (void); +/* + * CCJ: Change before opening a tty. Newer code from Eric is coming + * so extra work to handle an open tty is not worth it. If the tty + * is open, close then open it again. + */ +rtems_status_code rtems_termios_bufsize ( + int cbufsize, /* cooked buffer size */ + int raw_input, /* raw input buffer size */ + int raw_output /* raw output buffer size */ +); + rtems_status_code rtems_termios_open ( rtems_device_major_number major, rtems_device_minor_number minor, diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c index 96eb92d509..031b5be4ce 100644 --- a/cpukit/libcsupport/src/termios.c +++ b/cpukit/libcsupport/src/termios.c @@ -67,15 +67,15 @@ /* * The size of the cooked buffer */ -#define CBUFSIZE 256 +#define CBUFSIZE (rtems_termios_cbufsize) /* * The sizes of the raw message buffers. * On most architectures it is quite a bit more * efficient if these are powers of two. */ -#define RAW_INPUT_BUFFER_SIZE 128 -#define RAW_OUTPUT_BUFFER_SIZE 64 +#define RAW_INPUT_BUFFER_SIZE (rtems_termios_raw_input_size) +#define RAW_OUTPUT_BUFFER_SIZE (rtems_termios_raw_output_size) /* fields for "flow_ctrl" status */ #define FL_IREQXOF 1 /* input queue requests stop of incoming data */ @@ -113,6 +113,10 @@ extern struct rtems_termios_tty *rtems_termios_ttyHead; extern struct rtems_termios_tty *rtems_termios_ttyTail; extern rtems_id rtems_termios_ttyMutex; +static int rtems_termios_cbufsize = 256; +static int rtems_termios_raw_input_size = 128; +static int rtems_termios_raw_output_size = 64; + static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument); static rtems_task rtems_termios_txdaemon(rtems_task_argument argument); /* @@ -457,6 +461,17 @@ rtems_termios_close (void *arg) return RTEMS_SUCCESSFUL; } +rtems_status_code rtems_termios_bufsize ( + int cbufsize, + int raw_input, + int raw_output +) +{ + rtems_termios_cbufsize = cbufsize; + rtems_termios_raw_input_size = raw_input; + rtems_termios_raw_output_size = raw_output; +} + static void termios_set_flowctrl(struct rtems_termios_tty *tty) { @@ -1063,10 +1078,8 @@ fillBufferQueue (struct rtems_termios_tty *tty) /* continue processing new character */ if (tty->termios.c_lflag & ICANON) { - if (siproc (c, tty)) { + if (siproc (c, tty)) wait = 0; - break; /* done */ - } } else { siproc (c, tty); @@ -1512,4 +1525,3 @@ static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument) } } } - -- cgit v1.2.3