| 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
| 2 | #ifndef _SPARC_TERMBITS_H |
| 3 | #define _SPARC_TERMBITS_H |
| 4 | |
| 5 | #include <asm-generic/termbits-common.h> |
| 6 | |
| 7 | #if defined(__sparc__) && defined(__arch64__) |
| 8 | typedef unsigned int	tcflag_t; |
| 9 | #else |
| 10 | typedef unsigned long	tcflag_t; |
| 11 | #endif |
| 12 | |
| 13 | #define NCCS 17 |
| 14 | struct termios { |
| 15 | 	tcflag_t c_iflag;		/* input mode flags */ |
| 16 | 	tcflag_t c_oflag;		/* output mode flags */ |
| 17 | 	tcflag_t c_cflag;		/* control mode flags */ |
| 18 | 	tcflag_t c_lflag;		/* local mode flags */ |
| 19 | 	cc_t c_line;			/* line discipline */ |
| 20 | 	cc_t c_cc[NCCS];		/* control characters */ |
| 21 | }; |
| 22 | |
| 23 | struct termios2 { |
| 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_line;			/* line discipline */ |
| 29 | 	cc_t c_cc[NCCS+2];		/* control characters */ |
| 30 | 	speed_t c_ispeed;		/* input speed */ |
| 31 | 	speed_t c_ospeed;		/* output speed */ |
| 32 | }; |
| 33 | |
| 34 | struct ktermios { |
| 35 | 	tcflag_t c_iflag;		/* input mode flags */ |
| 36 | 	tcflag_t c_oflag;		/* output mode flags */ |
| 37 | 	tcflag_t c_cflag;		/* control mode flags */ |
| 38 | 	tcflag_t c_lflag;		/* local mode flags */ |
| 39 | 	cc_t c_line;			/* line discipline */ |
| 40 | 	cc_t c_cc[NCCS+2];		/* control characters */ |
| 41 | 	speed_t c_ispeed;		/* input speed */ |
| 42 | 	speed_t c_ospeed;		/* output speed */ |
| 43 | }; |
| 44 | |
| 45 | /* c_cc characters */ |
| 46 | #define VINTR 0 |
| 47 | #define VQUIT 1 |
| 48 | #define VERASE 2 |
| 49 | #define VKILL 3 |
| 50 | #define VEOF 4 |
| 51 | #define VEOL 5 |
| 52 | #define VEOL2 6 |
| 53 | #define VSWTC 7 |
| 54 | #define VSTART 8 |
| 55 | #define VSTOP 9 |
| 56 | |
| 57 | #define VSUSP 10 |
| 58 | #define VDSUSP 11		/* SunOS POSIX nicety I do believe... */ |
| 59 | #define VREPRINT 12 |
| 60 | #define VDISCARD 13 |
| 61 | #define VWERASE 14 |
| 62 | #define VLNEXT 15 |
| 63 | |
| 64 | /* Kernel keeps vmin/vtime separated, user apps assume vmin/vtime is |
| 65 | * shared with eof/eol |
| 66 | */ |
| 67 | #define VMIN VEOF |
| 68 | #define VTIME VEOL |
| 69 | |
| 70 | /* c_iflag bits */ |
| 71 | #define IUCLC	0x0200 |
| 72 | #define IXON	0x0400 |
| 73 | #define IXOFF	0x1000 |
| 74 | #define IMAXBEL	0x2000 |
| 75 | #define IUTF8 0x4000 |
| 76 | |
| 77 | /* c_oflag bits */ |
| 78 | #define OLCUC	0x00002 |
| 79 | #define ONLCR	0x00004 |
| 80 | #define NLDLY	0x00100 |
| 81 | #define NL0	0x00000 |
| 82 | #define NL1	0x00100 |
| 83 | #define CRDLY	0x00600 |
| 84 | #define CR0	0x00000 |
| 85 | #define CR1	0x00200 |
| 86 | #define CR2	0x00400 |
| 87 | #define CR3	0x00600 |
| 88 | #define TABDLY	0x01800 |
| 89 | #define TAB0	0x00000 |
| 90 | #define TAB1	0x00800 |
| 91 | #define TAB2	0x01000 |
| 92 | #define TAB3	0x01800 |
| 93 | #define XTABS	0x01800 |
| 94 | #define BSDLY	0x02000 |
| 95 | #define BS0	0x00000 |
| 96 | #define BS1	0x02000 |
| 97 | #define VTDLY	0x04000 |
| 98 | #define VT0	0x00000 |
| 99 | #define VT1	0x04000 |
| 100 | #define FFDLY	0x08000 |
| 101 | #define FF0	0x00000 |
| 102 | #define FF1	0x08000 |
| 103 | #define PAGEOUT 0x10000			/* SUNOS specific */ |
| 104 | #define WRAP 0x20000			/* SUNOS specific */ |
| 105 | |
| 106 | /* c_cflag bit meaning */ |
| 107 | #define CBAUD		0x0000100f |
| 108 | #define CSIZE		0x00000030 |
| 109 | #define CS5		0x00000000 |
| 110 | #define CS6		0x00000010 |
| 111 | #define CS7		0x00000020 |
| 112 | #define CS8		0x00000030 |
| 113 | #define CSTOPB		0x00000040 |
| 114 | #define CREAD		0x00000080 |
| 115 | #define PARENB		0x00000100 |
| 116 | #define PARODD		0x00000200 |
| 117 | #define HUPCL		0x00000400 |
| 118 | #define CLOCAL		0x00000800 |
| 119 | #define CBAUDEX		0x00001000 |
| 120 | /* We'll never see these speeds with the Zilogs, but for completeness... */ |
| 121 | #define BOTHER		0x00001000 |
| 122 | #define B57600	0x00001001 |
| 123 | #define B115200	0x00001002 |
| 124 | #define B230400	0x00001003 |
| 125 | #define B460800	0x00001004 |
| 126 | /* This is what we can do with the Zilogs. */ |
| 127 | #define B76800	0x00001005 |
| 128 | /* This is what we can do with the SAB82532. */ |
| 129 | #define B153600	0x00001006 |
| 130 | #define B307200	0x00001007 |
| 131 | #define B614400	0x00001008 |
| 132 | #define B921600	0x00001009 |
| 133 | /* And these are the rest... */ |
| 134 | #define B500000	0x0000100a |
| 135 | #define B576000	0x0000100b |
| 136 | #define B1000000	0x0000100c |
| 137 | #define B1152000	0x0000100d |
| 138 | #define B1500000	0x0000100e |
| 139 | #define B2000000	0x0000100f |
| 140 | /* These have totally bogus values and nobody uses them |
| 141 | so far. Later on we'd have to use say 0x10000x and |
| 142 | adjust CBAUD constant and drivers accordingly. |
| 143 | #define B2500000	0x00001010 |
| 144 | #define B3000000	0x00001011 |
| 145 | #define B3500000	0x00001012 |
| 146 | #define B4000000	0x00001013 */ |
| 147 | #define CIBAUD		0x100f0000	/* input baud rate (not used) */ |
| 148 | |
| 149 | /* c_lflag bits */ |
| 150 | #define ISIG	0x00000001 |
| 151 | #define ICANON	0x00000002 |
| 152 | #define XCASE	0x00000004 |
| 153 | #define ECHO	0x00000008 |
| 154 | #define ECHOE	0x00000010 |
| 155 | #define ECHOK	0x00000020 |
| 156 | #define ECHONL	0x00000040 |
| 157 | #define NOFLSH	0x00000080 |
| 158 | #define TOSTOP	0x00000100 |
| 159 | #define ECHOCTL	0x00000200 |
| 160 | #define ECHOPRT	0x00000400 |
| 161 | #define ECHOKE	0x00000800 |
| 162 | #define DEFECHO 0x00001000		/* SUNOS thing, what is it? */ |
| 163 | #define FLUSHO	0x00002000 |
| 164 | #define PENDIN	0x00004000 |
| 165 | #define IEXTEN	0x00008000 |
| 166 | #define EXTPROC	0x00010000 |
| 167 | |
| 168 | /* modem lines */ |
| 169 | #define TIOCM_LE	0x001 |
| 170 | #define TIOCM_DTR	0x002 |
| 171 | #define TIOCM_RTS	0x004 |
| 172 | #define TIOCM_ST	0x008 |
| 173 | #define TIOCM_SR	0x010 |
| 174 | #define TIOCM_CTS	0x020 |
| 175 | #define TIOCM_CAR	0x040 |
| 176 | #define TIOCM_RNG	0x080 |
| 177 | #define TIOCM_DSR	0x100 |
| 178 | #define TIOCM_CD	TIOCM_CAR |
| 179 | #define TIOCM_RI	TIOCM_RNG |
| 180 | #define TIOCM_OUT1	0x2000 |
| 181 | #define TIOCM_OUT2	0x4000 |
| 182 | #define TIOCM_LOOP	0x8000 |
| 183 | |
| 184 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ |
| 185 | #define TIOCSER_TEMT 0x01	/* Transmitter physically empty */ |
| 186 | |
| 187 | /* tcsetattr uses these */ |
| 188 | #define TCSANOW		0 |
| 189 | #define TCSADRAIN	1 |
| 190 | #define TCSAFLUSH	2 |
| 191 | |
| 192 | #endif /* _SPARC_TERMBITS_H */ |