Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  * This file is subject to the terms and conditions of the GNU General Public
0004  * License.  See the file "COPYING" in the main directory of this archive
0005  * for more details.
0006  *
0007  * Copyright (C) 1995, 96, 99, 2001, 06 Ralf Baechle
0008  * Copyright (C) 1999 Silicon Graphics, Inc.
0009  * Copyright (C) 2001 MIPS Technologies, Inc.
0010  */
0011 #ifndef _ASM_TERMBITS_H
0012 #define _ASM_TERMBITS_H
0013 
0014 #include <asm-generic/termbits-common.h>
0015 
0016 typedef unsigned int    tcflag_t;
0017 
0018 /*
0019  * The ABI says nothing about NCC but seems to use NCCS as
0020  * replacement for it in struct termio
0021  */
0022 #define NCCS    23
0023 struct termios {
0024     tcflag_t c_iflag;       /* input mode flags */
0025     tcflag_t c_oflag;       /* output mode flags */
0026     tcflag_t c_cflag;       /* control mode flags */
0027     tcflag_t c_lflag;       /* local mode flags */
0028     cc_t c_line;            /* line discipline */
0029     cc_t c_cc[NCCS];        /* control characters */
0030 };
0031 
0032 struct termios2 {
0033     tcflag_t c_iflag;       /* input mode flags */
0034     tcflag_t c_oflag;       /* output mode flags */
0035     tcflag_t c_cflag;       /* control mode flags */
0036     tcflag_t c_lflag;       /* local mode flags */
0037     cc_t c_line;            /* line discipline */
0038     cc_t c_cc[NCCS];        /* control characters */
0039     speed_t c_ispeed;       /* input speed */
0040     speed_t c_ospeed;       /* output speed */
0041 };
0042 
0043 struct ktermios {
0044     tcflag_t c_iflag;       /* input mode flags */
0045     tcflag_t c_oflag;       /* output mode flags */
0046     tcflag_t c_cflag;       /* control mode flags */
0047     tcflag_t c_lflag;       /* local mode flags */
0048     cc_t c_line;            /* line discipline */
0049     cc_t c_cc[NCCS];        /* control characters */
0050     speed_t c_ispeed;       /* input speed */
0051     speed_t c_ospeed;       /* output speed */
0052 };
0053 
0054 /* c_cc characters */
0055 #define VINTR        0      /* Interrupt character [ISIG] */
0056 #define VQUIT        1      /* Quit character [ISIG] */
0057 #define VERASE       2      /* Erase character [ICANON] */
0058 #define VKILL        3      /* Kill-line character [ICANON] */
0059 #define VMIN         4      /* Minimum number of bytes read at once [!ICANON] */
0060 #define VTIME        5      /* Time-out value (tenths of a second) [!ICANON] */
0061 #define VEOL2        6      /* Second EOL character [ICANON] */
0062 #define VSWTC        7      /* ??? */
0063 #define VSWTCH      VSWTC
0064 #define VSTART       8      /* Start (X-ON) character [IXON, IXOFF] */
0065 #define VSTOP        9      /* Stop (X-OFF) character [IXON, IXOFF] */
0066 #define VSUSP       10      /* Suspend character [ISIG] */
0067 #if 0
0068 /*
0069  * VDSUSP is not supported
0070  */
0071 #define VDSUSP      11      /* Delayed suspend character [ISIG] */
0072 #endif
0073 #define VREPRINT    12      /* Reprint-line character [ICANON] */
0074 #define VDISCARD    13      /* Discard character [IEXTEN] */
0075 #define VWERASE     14      /* Word-erase character [ICANON] */
0076 #define VLNEXT      15      /* Literal-next character [IEXTEN] */
0077 #define VEOF        16      /* End-of-file character [ICANON] */
0078 #define VEOL        17      /* End-of-line character [ICANON] */
0079 
0080 /* c_iflag bits */
0081 #define IUCLC   0x0200      /* Map upper case to lower case on input */
0082 #define IXON    0x0400      /* Enable start/stop output control */
0083 #define IXOFF   0x1000      /* Enable start/stop input control */
0084 #define IMAXBEL 0x2000      /* Ring bell when input queue is full */
0085 #define IUTF8   0x4000      /* Input is UTF-8 */
0086 
0087 /* c_oflag bits */
0088 #define OLCUC   0x00002     /* Map lower case to upper case on output */
0089 #define ONLCR   0x00004     /* Map NL to CR-NL on output */
0090 #define NLDLY   0x00100
0091 #define   NL0   0x00000
0092 #define   NL1   0x00100
0093 #define CRDLY   0x00600
0094 #define   CR0   0x00000
0095 #define   CR1   0x00200
0096 #define   CR2   0x00400
0097 #define   CR3   0x00600
0098 #define TABDLY  0x01800
0099 #define   TAB0  0x00000
0100 #define   TAB1  0x00800
0101 #define   TAB2  0x01000
0102 #define   TAB3  0x01800
0103 #define   XTABS 0x01800
0104 #define BSDLY   0x02000
0105 #define   BS0   0x00000
0106 #define   BS1   0x02000
0107 #define VTDLY   0x04000
0108 #define   VT0   0x00000
0109 #define   VT1   0x04000
0110 #define FFDLY   0x08000
0111 #define   FF0   0x00000
0112 #define   FF1   0x08000
0113 /*
0114 #define PAGEOUT ???
0115 #define WRAP    ???
0116  */
0117 
0118 /* c_cflag bit meaning */
0119 #define CBAUD       0x0000100f
0120 #define CSIZE       0x00000030  /* Number of bits per byte (mask) */
0121 #define   CS5       0x00000000  /* 5 bits per byte */
0122 #define   CS6       0x00000010  /* 6 bits per byte */
0123 #define   CS7       0x00000020  /* 7 bits per byte */
0124 #define   CS8       0x00000030  /* 8 bits per byte */
0125 #define CSTOPB      0x00000040  /* Two stop bits instead of one */
0126 #define CREAD       0x00000080  /* Enable receiver */
0127 #define PARENB      0x00000100  /* Parity enable */
0128 #define PARODD      0x00000200  /* Odd parity instead of even */
0129 #define HUPCL       0x00000400  /* Hang up on last close */
0130 #define CLOCAL      0x00000800  /* Ignore modem status lines */
0131 #define CBAUDEX     0x00001000
0132 #define BOTHER      0x00001000
0133 #define     B57600  0x00001001
0134 #define    B115200  0x00001002
0135 #define    B230400  0x00001003
0136 #define    B460800  0x00001004
0137 #define    B500000  0x00001005
0138 #define    B576000  0x00001006
0139 #define    B921600  0x00001007
0140 #define   B1000000  0x00001008
0141 #define   B1152000  0x00001009
0142 #define   B1500000  0x0000100a
0143 #define   B2000000  0x0000100b
0144 #define   B2500000  0x0000100c
0145 #define   B3000000  0x0000100d
0146 #define   B3500000  0x0000100e
0147 #define   B4000000  0x0000100f
0148 #define CIBAUD      0x100f0000  /* input baud rate */
0149 
0150 /* c_lflag bits */
0151 #define ISIG    0x00001     /* Enable signals */
0152 #define ICANON  0x00002     /* Do erase and kill processing */
0153 #define XCASE   0x00004
0154 #define ECHO    0x00008     /* Enable echo */
0155 #define ECHOE   0x00010     /* Visual erase for ERASE */
0156 #define ECHOK   0x00020     /* Echo NL after KILL */
0157 #define ECHONL  0x00040     /* Echo NL even if ECHO is off */
0158 #define NOFLSH  0x00080     /* Disable flush after interrupt */
0159 #define IEXTEN  0x00100     /* Enable DISCARD and LNEXT */
0160 #define ECHOCTL 0x00200     /* Echo control characters as ^X */
0161 #define ECHOPRT 0x00400     /* Hardcopy visual erase */
0162 #define ECHOKE  0x00800     /* Visual erase for KILL */
0163 #define FLUSHO  0x02000
0164 #define PENDIN  0x04000     /* Retype pending input (state) */
0165 #define TOSTOP  0x08000     /* Send SIGTTOU for background output */
0166 #define ITOSTOP TOSTOP
0167 #define EXTPROC 0x10000     /* External processing on pty */
0168 
0169 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
0170 #define TIOCSER_TEMT    0x01    /* Transmitter physically empty */
0171 
0172 /* tcsetattr uses these */
0173 #define TCSANOW     TCSETS  /* Change immediately */
0174 #define TCSADRAIN   TCSETSW /* Change when pending output is written */
0175 #define TCSAFLUSH   TCSETSF /* Flush pending input before changing */
0176 
0177 #endif /* _ASM_TERMBITS_H */