1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ 2 #ifndef _ASM_POWERPC_TERMBITS_H 3 #define _ASM_POWERPC_TERMBITS_H 4 5 /* 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 9 * 2 of the License, or (at your option) any later version. 10 */ 11 12 typedef unsigned char cc_t; 13 typedef unsigned int speed_t; 14 typedef unsigned int tcflag_t; 15 16 /* 17 * termios type and macro definitions. Be careful about adding stuff 18 * to this file since it's used in GNU libc and there are strict rules 19 * concerning namespace pollution. 20 */ 21 22 #define NCCS 19 23 struct termios { 24 tcflag_t c_iflag; /* input mode flags */ 25 tcflag_t c_oflag; /* output mode flags */ 26 tcflag_t c_cflag; /* control mode flags */ 27 tcflag_t c_lflag; /* local mode flags */ 28 cc_t c_cc[NCCS]; /* control characters */ 29 cc_t c_line; /* line discipline (== c_cc[19]) */ 30 speed_t c_ispeed; /* input speed */ 31 speed_t c_ospeed; /* output speed */ 32 }; 33 34 /* For PowerPC the termios and ktermios are the same */ 35 36 struct ktermios { 37 tcflag_t c_iflag; /* input mode flags */ 38 tcflag_t c_oflag; /* output mode flags */ 39 tcflag_t c_cflag; /* control mode flags */ 40 tcflag_t c_lflag; /* local mode flags */ 41 cc_t c_cc[NCCS]; /* control characters */ 42 cc_t c_line; /* line discipline (== c_cc[19]) */ 43 speed_t c_ispeed; /* input speed */ 44 speed_t c_ospeed; /* output speed */ 45 }; 46 47 /* c_cc characters */ 48 #define VINTR 0 49 #define VQUIT 1 50 #define VERASE 2 51 #define VKILL 3 52 #define VEOF 4 53 #define VMIN 5 54 #define VEOL 6 55 #define VTIME 7 56 #define VEOL2 8 57 #define VSWTC 9 58 #define VWERASE 10 59 #define VREPRINT 11 60 #define VSUSP 12 61 #define VSTART 13 62 #define VSTOP 14 63 #define VLNEXT 15 64 #define VDISCARD 16 65 66 /* c_iflag bits */ 67 #define IGNBRK 0x00001 68 #define BRKINT 0x00002 69 #define IGNPAR 0x00004 70 #define PARMRK 0x00008 71 #define INPCK 0x00010 72 #define ISTRIP 0x00020 73 #define INLCR 0x00040 74 #define IGNCR 0x00080 75 #define ICRNL 0x00100 76 #define IXON 0x00200 77 #define IXOFF 0x00400 78 #define IXANY 0x00800 79 #define IUCLC 0x01000 80 #define IMAXBEL 0x02000 81 #define IUTF8 0x04000 82 83 /* c_oflag bits */ 84 #define OPOST 0x00001 85 #define ONLCR 0x00002 86 #define OLCUC 0x00004 87 88 #define OCRNL 0x00008 89 #define ONOCR 0x00010 90 #define ONLRET 0x00020 91 92 #define OFILL 0x000040 93 #define OFDEL 0x000080 94 #define NLDLY 0x000300 95 #define NL0 0x000000 96 #define NL1 0x000100 97 #define NL2 0x000200 98 #define NL3 0x000300 99 #define TABDLY 0x000c00 100 #define TAB0 0x000000 101 #define TAB1 0x000400 102 #define TAB2 0x000800 103 #define TAB3 0x000c00 104 #define XTABS 0x000c00 /* required by POSIX to == TAB3 */ 105 #define CRDLY 0x003000 106 #define CR0 0x000000 107 #define CR1 0x001000 108 #define CR2 0x002000 109 #define CR3 0x003000 110 #define FFDLY 0x004000 111 #define FF0 0x000000 112 #define FF1 0x004000 113 #define BSDLY 0x008000 114 #define BS0 0x000000 115 #define BS1 0x008000 116 #define VTDLY 0x010000 117 #define VT0 0x000000 118 #define VT1 0x010000 119 120 /* c_cflag bit meaning */ 121 #define CBAUD 0x000000ff 122 #define B0 0x00000000 /* hang up */ 123 #define B50 0x00000001 124 #define B75 0x00000002 125 #define B110 0x00000003 126 #define B134 0x00000004 127 #define B150 0x00000005 128 #define B200 0x00000006 129 #define B300 0x00000007 130 #define B600 0x00000008 131 #define B1200 0x00000009 132 #define B1800 0x0000000a 133 #define B2400 0x0000000b 134 #define B4800 0x0000000c 135 #define B9600 0x0000000d 136 #define B19200 0x0000000e 137 #define B38400 0x0000000f 138 #define EXTA B19200 139 #define EXTB B38400 140 #define CBAUDEX 0x00000000 141 #define B57600 0x00000010 142 #define B115200 0x00000011 143 #define B230400 0x00000012 144 #define B460800 0x00000013 145 #define B500000 0x00000014 146 #define B576000 0x00000015 147 #define B921600 0x00000016 148 #define B1000000 0x00000017 149 #define B1152000 0x00000018 150 #define B1500000 0x00000019 151 #define B2000000 0x0000001a 152 #define B2500000 0x0000001b 153 #define B3000000 0x0000001c 154 #define B3500000 0x0000001d 155 #define B4000000 0x0000001e 156 #define BOTHER 0x0000001f 157 158 #define CIBAUD 0x00ff0000 159 #define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ 160 161 #define CSIZE 0x00000300 162 #define CS5 0x00000000 163 #define CS6 0x00000100 164 #define CS7 0x00000200 165 #define CS8 0x00000300 166 167 #define CSTOPB 0x00000400 168 #define CREAD 0x00000800 169 #define PARENB 0x00001000 170 #define PARODD 0x00002000 171 #define HUPCL 0x00004000 172 173 #define CLOCAL 0x00008000 174 #define CMSPAR 0x40000000 /* mark or space (stick) parity */ 175 #define CRTSCTS 0x80000000 /* flow control */ 176 177 /* c_lflag bits */ 178 #define ISIG 0x00000080 179 #define ICANON 0x00000100 180 #define XCASE 0x00004000 181 #define ECHO 0x00000008 182 #define ECHOE 0x00000002 183 #define ECHOK 0x00000004 184 #define ECHONL 0x00000010 185 #define NOFLSH 0x80000000 186 #define TOSTOP 0x00400000 187 #define ECHOCTL 0x00000040 188 #define ECHOPRT 0x00000020 189 #define ECHOKE 0x00000001 190 #define FLUSHO 0x00800000 191 #define PENDIN 0x20000000 192 #define IEXTEN 0x00000400 193 #define EXTPROC 0x10000000 194 195 /* Values for the ACTION argument to `tcflow'. */ 196 #define TCOOFF 0 197 #define TCOON 1 198 #define TCIOFF 2 199 #define TCION 3 200 201 /* Values for the QUEUE_SELECTOR argument to `tcflush'. */ 202 #define TCIFLUSH 0 203 #define TCOFLUSH 1 204 #define TCIOFLUSH 2 205 206 /* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ 207 #define TCSANOW 0 208 #define TCSADRAIN 1 209 #define TCSAFLUSH 2 210 211 #endif /* _ASM_POWERPC_TERMBITS_H */ 212