forked from Imagelibrary/rtems
Move RTEMS-specific Termios API content
Remove obsolete support for OFILL, OFDEL, NLDLY, CRDLY, BSDLY, VTDLY, and FFDLY which is not present on FreeBSD and not implemented in Linux. Update #2833.
This commit is contained in:
@@ -11,6 +11,8 @@
|
|||||||
#ifndef _MC68681_H_
|
#ifndef _MC68681_H_
|
||||||
#define _MC68681_H_
|
#define _MC68681_H_
|
||||||
|
|
||||||
|
#include <rtems/termiostypes.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include <rtems/libio.h>
|
#include <rtems/libio.h>
|
||||||
#include <rtems/assoc.h>
|
#include <rtems/assoc.h>
|
||||||
#include <rtems/chain.h>
|
#include <rtems/chain.h>
|
||||||
|
#include <sys/ioccom.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
|
||||||
@@ -573,6 +574,14 @@ int rtems_termios_poll(
|
|||||||
int events
|
int events
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#define RTEMS_IO_SNDWAKEUP _IOW('t', 11, struct ttywakeup ) /* send tty wakeup */
|
||||||
|
#define RTEMS_IO_RCVWAKEUP _IOW('t', 12, struct ttywakeup ) /* recv tty wakeup */
|
||||||
|
|
||||||
|
#define OLCUC 0x00000100 /* map lower case to upper case on output */
|
||||||
|
#define IUCLC 0x00004000 /* map upper case to lower case on input */
|
||||||
|
|
||||||
|
#define RTEMS_TERMIOS_NUMBER_BAUD_RATES 25
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -95,9 +95,6 @@
|
|||||||
#define IXANY 0x00000800 /* any char will restart after stop */
|
#define IXANY 0x00000800 /* any char will restart after stop */
|
||||||
#define IMAXBEL 0x00002000 /* ring bell on input queue full */
|
#define IMAXBEL 0x00002000 /* ring bell on input queue full */
|
||||||
#endif /*_POSIX_SOURCE */
|
#endif /*_POSIX_SOURCE */
|
||||||
#ifdef __rtems__
|
|
||||||
#define IUCLC 0x00004000 /* map upper case to lower case on input */
|
|
||||||
#endif /* __rtems__ */
|
|
||||||
/*
|
/*
|
||||||
* Output flags - software output processing
|
* Output flags - software output processing
|
||||||
*/
|
*/
|
||||||
@@ -118,31 +115,10 @@
|
|||||||
#define TAB1 0x00000004
|
#define TAB1 0x00000004
|
||||||
#define TAB2 0x00000008
|
#define TAB2 0x00000008
|
||||||
#define TAB3 0x0000000C /* expand tabs to spaces */
|
#define TAB3 0x0000000C /* expand tabs to spaces */
|
||||||
#define XTABS 0x0000000C
|
|
||||||
#define ONOEOT 0x00000010 /* discard EOT's (^D) on output) */
|
#define ONOEOT 0x00000010 /* discard EOT's (^D) on output) */
|
||||||
#define OCRNL 0x00000020 /* map CR to NL on output */
|
#define OCRNL 0x00000020 /* map CR to NL on output */
|
||||||
#define ONOCR 0x00000040 /* no CR output at column 0 */
|
#define ONOCR 0x00000040 /* no CR output at column 0 */
|
||||||
#define ONLRET 0x00000080 /* NL performs CR function */
|
#define ONLRET 0x00000080 /* NL performs CR function */
|
||||||
#define OLCUC 0x00000100 /* map lower case to upper case on output */
|
|
||||||
#define OFILL 0x00000200 /* send fill characters for a delay, rather than using a timed delay */
|
|
||||||
#define OFDEL 0x00000400 /* fill character is ASCII DEL (0177). if unset, fill character is ASCII NUL ('\0') */
|
|
||||||
#define NLDLY 0x00000800 /* newline delay mask */
|
|
||||||
#define NL0 0x00000000
|
|
||||||
#define NL1 0x00000800
|
|
||||||
#define CRDLY 0x00003000 /* carriage return delay mask */
|
|
||||||
#define CR0 0x00000000
|
|
||||||
#define CR1 0x00001000
|
|
||||||
#define CR2 0x00002000
|
|
||||||
#define CR3 0x00003000
|
|
||||||
#define BSDLY 0x00004000 /* Backspace delay mask */
|
|
||||||
#define BS0 0x00000000
|
|
||||||
#define BS1 0x00004000
|
|
||||||
#define VTDLY 0x00008000 /* Vertical tab delay mask */
|
|
||||||
#define VT0 0x00000000
|
|
||||||
#define VT1 0x00008000
|
|
||||||
#define FFDLY 0x00010000 /* Form feed delay mask */
|
|
||||||
#define FF0 0x00000000
|
|
||||||
#define FF1 0x00010000
|
|
||||||
#endif /* __rtems__ */
|
#endif /* __rtems__ */
|
||||||
#endif /*_POSIX_SOURCE */
|
#endif /*_POSIX_SOURCE */
|
||||||
|
|
||||||
@@ -243,10 +219,6 @@
|
|||||||
#define EXTB 38400
|
#define EXTB 38400
|
||||||
#endif /* !_POSIX_SOURCE */
|
#endif /* !_POSIX_SOURCE */
|
||||||
|
|
||||||
#ifdef __rtems__
|
|
||||||
#define RTEMS_TERMIOS_NUMBER_BAUD_RATES 25
|
|
||||||
#endif /* __rtems__ */
|
|
||||||
|
|
||||||
typedef unsigned int tcflag_t;
|
typedef unsigned int tcflag_t;
|
||||||
typedef unsigned char cc_t;
|
typedef unsigned char cc_t;
|
||||||
typedef unsigned int speed_t;
|
typedef unsigned int speed_t;
|
||||||
|
|||||||
@@ -60,10 +60,6 @@ struct winsize {
|
|||||||
/* 3-7 unused */
|
/* 3-7 unused */
|
||||||
/* 8-10 compat */
|
/* 8-10 compat */
|
||||||
/* 11-12 unused */
|
/* 11-12 unused */
|
||||||
#ifdef __rtems__
|
|
||||||
#define RTEMS_IO_SNDWAKEUP _IOW('t', 11, struct ttywakeup ) /* send tty wakeup */
|
|
||||||
#define RTEMS_IO_RCVWAKEUP _IOW('t', 12, struct ttywakeup ) /* recv tty wakeup */
|
|
||||||
#endif /* __rtems__ */
|
|
||||||
#define TIOCEXCL _IO('t', 13) /* set exclusive use of tty */
|
#define TIOCEXCL _IO('t', 13) /* set exclusive use of tty */
|
||||||
#define TIOCNXCL _IO('t', 14) /* reset exclusive use of tty */
|
#define TIOCNXCL _IO('t', 14) /* reset exclusive use of tty */
|
||||||
#define TIOCGPTN _IOR('t', 15, int) /* Get pts number. */
|
#define TIOCGPTN _IOR('t', 15, int) /* Get pts number. */
|
||||||
|
|||||||
@@ -577,7 +577,7 @@ rtems_termios_open_tty(
|
|||||||
* Set default parameters
|
* Set default parameters
|
||||||
*/
|
*/
|
||||||
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
|
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
|
||||||
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
|
tty->termios.c_oflag = OPOST | ONLCR | OXTABS;
|
||||||
tty->termios.c_cflag = CS8 | CREAD | CLOCAL;
|
tty->termios.c_cflag = CS8 | CREAD | CLOCAL;
|
||||||
tty->termios.c_lflag =
|
tty->termios.c_lflag =
|
||||||
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
|
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
|
||||||
@@ -1188,7 +1188,7 @@ oproc (unsigned char c, rtems_termios_tty *tty, bool wait)
|
|||||||
|
|
||||||
case '\t':
|
case '\t':
|
||||||
columnAdj = 8 - (oldColumn & 7);
|
columnAdj = 8 - (oldColumn & 7);
|
||||||
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
|
if ((tty->termios.c_oflag & TABDLY) == OXTABS) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
len = (size_t) columnAdj;
|
len = (size_t) columnAdj;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
|
|
||||||
#include <rtems/shell.h>
|
#include <rtems/shell.h>
|
||||||
|
#include <rtems/termiostypes.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -131,87 +132,6 @@ void print_c_oflag( struct termios * tp )
|
|||||||
if( tp->c_oflag & ONLRET )
|
if( tp->c_oflag & ONLRET )
|
||||||
printf( "ONLRET " );
|
printf( "ONLRET " );
|
||||||
|
|
||||||
if( tp->c_oflag & OFILL )
|
|
||||||
printf( "OFILL " );
|
|
||||||
|
|
||||||
if( tp->c_oflag & OFDEL )
|
|
||||||
printf( "OFDEL " );
|
|
||||||
|
|
||||||
switch( tp->c_oflag & NLDLY ) {
|
|
||||||
case NL0:
|
|
||||||
printf( "NL0 " );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NL1:
|
|
||||||
printf( "NL1 " );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch( tp->c_oflag & CRDLY ) {
|
|
||||||
case CR0:
|
|
||||||
printf( "CR0 " );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CR1:
|
|
||||||
printf( "CR1 " );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CR2:
|
|
||||||
printf( "CR2 " );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case CR3:
|
|
||||||
printf( "CR3 " );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch( tp->c_oflag & TABDLY ) {
|
|
||||||
case TAB0:
|
|
||||||
printf( "TAB0 " );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TAB1:
|
|
||||||
printf( "TAB1 " );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TAB2:
|
|
||||||
printf( "TAB2 " );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case TAB3:
|
|
||||||
printf( "TAB3 " );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch( tp->c_oflag & BSDLY ) {
|
|
||||||
case BS0:
|
|
||||||
printf( "BS0 " );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BS1:
|
|
||||||
printf( "BS1 " );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch( tp->c_oflag & VTDLY ) {
|
|
||||||
case VT0:
|
|
||||||
printf( "VT0 " );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case VT1:
|
|
||||||
printf( "VT1 " );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch( tp->c_oflag & FFDLY ) {
|
|
||||||
case FF0:
|
|
||||||
printf( "FF0" );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case FF1:
|
|
||||||
printf( "FF1" );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
printf( "\n" );
|
printf( "\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <rtems/dumpbuf.h>
|
#include <rtems/dumpbuf.h>
|
||||||
|
#include <rtems/termiostypes.h>
|
||||||
|
|
||||||
const char rtems_test_name[] = "TERMIOS 3";
|
const char rtems_test_name[] = "TERMIOS 3";
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <rtems/dumpbuf.h>
|
#include <rtems/dumpbuf.h>
|
||||||
|
#include <rtems/termiostypes.h>
|
||||||
|
|
||||||
const char rtems_test_name[] = "TERMIOS 5";
|
const char rtems_test_name[] = "TERMIOS 5";
|
||||||
|
|
||||||
|
|||||||
@@ -848,7 +848,7 @@ static void test_opost(test_context *ctx)
|
|||||||
|
|
||||||
static void test_xtabs(test_context *ctx)
|
static void test_xtabs(test_context *ctx)
|
||||||
{
|
{
|
||||||
tcflag_t oflags = OPOST | XTABS;
|
tcflag_t oflags = OPOST | OXTABS;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < DEVICE_COUNT; ++i) {
|
for (i = 0; i < DEVICE_COUNT; ++i) {
|
||||||
@@ -952,7 +952,7 @@ static void flush_task(rtems_task_argument arg)
|
|||||||
|
|
||||||
static void test_write(test_context *ctx)
|
static void test_write(test_context *ctx)
|
||||||
{
|
{
|
||||||
tcflag_t oflags = OPOST | ONLCR | XTABS;
|
tcflag_t oflags = OPOST | ONLCR | OXTABS;
|
||||||
rtems_status_code sc;
|
rtems_status_code sc;
|
||||||
size_t i = INTERRUPT;
|
size_t i = INTERRUPT;
|
||||||
device_context *dev = &ctx->devices[i];
|
device_context *dev = &ctx->devices[i];
|
||||||
@@ -1031,7 +1031,7 @@ static void test_write(test_context *ctx)
|
|||||||
buf[OUTPUT_BUFFER_SIZE - 1] = '\n';
|
buf[OUTPUT_BUFFER_SIZE - 1] = '\n';
|
||||||
rtems_test_assert(memcmp(dev->output_buf, buf, OUTPUT_BUFFER_SIZE) == 0);
|
rtems_test_assert(memcmp(dev->output_buf, buf, OUTPUT_BUFFER_SIZE) == 0);
|
||||||
|
|
||||||
/* Ensure that XTABS output expansion is taken into account */
|
/* Ensure that OXTABS output expansion is taken into account */
|
||||||
|
|
||||||
dev->tty->column = 0;
|
dev->tty->column = 0;
|
||||||
clear_output(ctx, i);
|
clear_output(ctx, i);
|
||||||
|
|||||||
Reference in New Issue
Block a user