Update.
[platform/upstream/glibc.git] / sysdeps / unix / sysv / linux / sparc / bits / termios.h
1 /* termios type and macro definitions.  Linux/SPARC version.
2    Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4
5    The GNU C Library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Library General Public License as
7    published by the Free Software Foundation; either version 2 of the
8    License, or (at your option) any later version.
9
10    The GNU C Library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Library General Public License for more details.
14
15    You should have received a copy of the GNU Library General Public
16    License along with the GNU C Library; see the file COPYING.LIB.  If not,
17    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18    Boston, MA 02111-1307, USA.  */
19
20 #ifndef _SPARC_TERMBITS_H
21 #define _SPARC_TERMBITS_H       1
22
23 typedef unsigned char cc_t;
24 typedef unsigned int speed_t;
25 typedef unsigned int tcflag_t;
26
27 #define NCCS 17
28 struct termios
29   {
30     tcflag_t c_iflag;           /* input mode flags */
31     tcflag_t c_oflag;           /* output mode flags */
32     tcflag_t c_cflag;           /* control mode flags */
33     tcflag_t c_lflag;           /* local mode flags */
34     cc_t c_line;                /* line discipline */
35     cc_t c_cc[NCCS];            /* control characters */
36 #ifdef __KERNEL__
37 #define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t))
38     cc_t _x_cc[2];              /* We need them to hold vmin/vtime */
39 #endif
40   };
41
42 /* c_cc characters */
43 #define VINTR    0
44 #define VQUIT    1
45 #define VERASE   2
46 #define VKILL    3
47 #define VEOF     4
48 #define VEOL     5
49 #define VEOL2    6
50 #define VSWTC    7
51 #define VSTART   8
52 #define VSTOP    9
53
54
55
56 #define VSUSP    10
57 #define VDSUSP   11  /* SunOS POSIX nicety I do believe... */
58 #define VREPRINT 12
59 #define VDISCARD 13
60 #define VWERASE  14
61 #define VLNEXT   15
62
63 /* Kernel keeps vmin/vtime separated, user apps assume vmin/vtime is
64  * shared with eof/eol
65  */
66 #ifdef __KERNEL__
67 #define VMIN     16
68 #define VTIME    17
69 #else
70 #define VMIN     VEOF
71 #define VTIME    VEOL
72 #endif
73
74 /* c_iflag bits */
75 #define IGNBRK  0x00000001
76 #define BRKINT  0x00000002
77 #define IGNPAR  0x00000004
78 #define PARMRK  0x00000008
79 #define INPCK   0x00000010
80 #define ISTRIP  0x00000020
81 #define INLCR   0x00000040
82 #define IGNCR   0x00000080
83 #define ICRNL   0x00000100
84 #define IUCLC   0x00000200
85 #define IXON    0x00000400
86 #define IXANY   0x00000800
87 #define IXOFF   0x00001000
88 #define IMAXBEL 0x00002000
89
90 /* c_oflag bits */
91 #define OPOST   0x00000001
92 #define OLCUC   0x00000002
93 #define ONLCR   0x00000004
94 #define OCRNL   0x00000008
95 #define ONOCR   0x00000010
96 #define ONLRET  0x00000020
97 #define OFILL   0x00000040
98 #define OFDEL   0x00000080
99 #define NLDLY   0x00000100
100 #define   NL0   0x00000000
101 #define   NL1   0x00000100
102 #define CRDLY   0x00000600
103 #define   CR0   0x00000000
104 #define   CR1   0x00000200
105 #define   CR2   0x00000400
106 #define   CR3   0x00000600
107 #define TABDLY  0x00001800
108 #define   TAB0  0x00000000
109 #define   TAB1  0x00000800
110 #define   TAB2  0x00001000
111 #define   TAB3  0x00001800
112 #define   XTABS 0x00001800
113 #define BSDLY   0x00002000
114 #define   BS0   0x00000000
115 #define   BS1   0x00002000
116 #define VTDLY   0x00004000
117 #define   VT0   0x00000000
118 #define   VT1   0x00004000
119 #define FFDLY   0x00008000
120 #define   FF0   0x00000000
121 #define   FF1   0x00008000
122 #define PAGEOUT 0x00010000  /* SUNOS specific */
123 #define WRAP    0x00020000  /* SUNOS specific */
124
125 /* c_cflag bit meaning */
126 #define CBAUD   0x0000000f
127 #define  B0     0x00000000   /* hang up */
128 #define  B50    0x00000001
129 #define  B75    0x00000002
130 #define  B110   0x00000003
131 #define  B134   0x00000004
132 #define  B150   0x00000005
133 #define  B200   0x00000006
134 #define  B300   0x00000007
135 #define  B600   0x00000008
136 #define  B1200  0x00000009
137 #define  B1800  0x0000000a
138 #define  B2400  0x0000000b
139 #define  B4800  0x0000000c
140 #define  B9600  0x0000000d
141 #define  B19200 0x0000000e
142 #define  B38400 0x0000000f
143 #define EXTA    B19200
144 #define EXTB    B38400
145 #define  CSIZE  0x00000030
146 #define   CS5   0x00000000
147 #define   CS6   0x00000010
148 #define   CS7   0x00000020
149 #define   CS8   0x00000030
150 #define CSTOPB  0x00000040
151 #define CREAD   0x00000080
152 #define PARENB  0x00000100
153 #define PARODD  0x00000200
154 #define HUPCL   0x00000400
155 #define CLOCAL  0x00000800
156 /* We'll never see these speeds with the Zilogs' but for completeness... */
157 #define CBAUDEX 0x00010000
158 #define  B57600  0x00010001
159 #define  B115200 0x00010002
160 #define  B230400 0x00010003
161 #define  B460800 0x00010004
162 #define CIBAUD    0x000f0000  /* input baud rate (not used) */
163 #define CMSPAR    010000000000          /* mark or space (stick) parity */
164 #define CRTSCTS   0x80000000  /* flow control */
165
166 /* c_lflag bits */
167 #define ISIG    0x00000001
168 #define ICANON  0x00000002
169 #define XCASE   0x00000004
170 #define ECHO    0x00000008
171 #define ECHOE   0x00000010
172 #define ECHOK   0x00000020
173 #define ECHONL  0x00000040
174 #define NOFLSH  0x00000080
175 #define TOSTOP  0x00000100
176 #define ECHOCTL 0x00000200
177 #define ECHOPRT 0x00000400
178 #define ECHOKE  0x00000800
179 #define DEFECHO 0x00001000  /* SUNOS thing, what is it? */
180 #define FLUSHO  0x00002000
181 #define PENDIN  0x00004000
182 #define IEXTEN  0x00008000
183
184 /* modem lines */
185 #define TIOCM_LE        0x001
186 #define TIOCM_DTR       0x002
187 #define TIOCM_RTS       0x004
188 #define TIOCM_ST        0x008
189 #define TIOCM_SR        0x010
190 #define TIOCM_CTS       0x020
191 #define TIOCM_CAR       0x040
192 #define TIOCM_RNG       0x080
193 #define TIOCM_DSR       0x100
194 #define TIOCM_CD        TIOCM_CAR
195 #define TIOCM_RI        TIOCM_RNG
196
197 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
198 #define TIOCSER_TEMT    0x01    /* Transmitter physically empty */
199
200
201 /* tcflow() and TCXONC use these */
202 #define TCOOFF          0
203 #define TCOON           1
204 #define TCIOFF          2
205 #define TCION           3
206
207 /* tcflush() and TCFLSH use these */
208 #define TCIFLUSH        0
209 #define TCOFLUSH        1
210 #define TCIOFLUSH       2
211
212 /* tcsetattr uses these */
213 #define TCSANOW         0
214 #define TCSADRAIN       1
215 #define TCSAFLUSH       2
216
217 #endif /* !(_SPARC_TERMBITS_H) */