Patch by Chris Johns <cjohns@cybertec.com.au> adding the rtems_termios_bufsize call.

This commit is contained in:
Chris Johns
2003-07-02 14:17:25 +00:00
parent 8e308413f2
commit 901c84a986
3 changed files with 34 additions and 7 deletions

View File

@@ -1,3 +1,7 @@
2003-07-02 Chris Johns <cjohns@cybertec.com.au>
* include/rtems/libio.h, src/termios.c: Patch by Chris Johns
<cjohns@cybertec.com.au> adding the rtems_termios_bufsize call.
2003-05-30 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* Makefile.am: Conditionally install stdint.h/inttypes.h.

View File

@@ -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,

View File

@@ -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)
}
}
}