xref: /qemu/linux-user/mips/termbits.h (revision c218b4ed)
1048f6b4dSbellard /* from asm/termbits.h */
2048f6b4dSbellard 
3f91005e1SMarkus Armbruster #ifndef LINUX_USER_MIPS_TERMBITS_H
4f91005e1SMarkus Armbruster #define LINUX_USER_MIPS_TERMBITS_H
5f91005e1SMarkus Armbruster 
6048f6b4dSbellard #define TARGET_NCCS 23
7048f6b4dSbellard 
8*c218b4edSFilip Bozuta typedef unsigned char   target_cc_t;        /* cc_t */
9*c218b4edSFilip Bozuta typedef unsigned int    target_speed_t;     /* speed_t */
10*c218b4edSFilip Bozuta typedef unsigned int    target_tcflag_t;    /* tcflag_t */
11*c218b4edSFilip Bozuta 
12048f6b4dSbellard struct target_termios {
13*c218b4edSFilip Bozuta     target_tcflag_t c_iflag;               /* input mode flags */
14*c218b4edSFilip Bozuta     target_tcflag_t c_oflag;               /* output mode flags */
15*c218b4edSFilip Bozuta     target_tcflag_t c_cflag;               /* control mode flags */
16*c218b4edSFilip Bozuta     target_tcflag_t c_lflag;               /* local mode flags */
17*c218b4edSFilip Bozuta     target_cc_t c_line;                    /* line discipline */
18*c218b4edSFilip Bozuta     target_cc_t c_cc[TARGET_NCCS];         /* control characters */
19048f6b4dSbellard };
20048f6b4dSbellard 
21048f6b4dSbellard /* c_iflag bits */
22048f6b4dSbellard #define TARGET_IGNBRK  0000001
23048f6b4dSbellard #define TARGET_BRKINT  0000002
24048f6b4dSbellard #define TARGET_IGNPAR  0000004
25048f6b4dSbellard #define TARGET_PARMRK  0000010
26048f6b4dSbellard #define TARGET_INPCK   0000020
27048f6b4dSbellard #define TARGET_ISTRIP  0000040
28048f6b4dSbellard #define TARGET_INLCR   0000100
29048f6b4dSbellard #define TARGET_IGNCR   0000200
30048f6b4dSbellard #define TARGET_ICRNL   0000400
31048f6b4dSbellard #define TARGET_IUCLC   0001000
32048f6b4dSbellard #define TARGET_IXON    0002000
33048f6b4dSbellard #define TARGET_IXANY   0004000
34048f6b4dSbellard #define TARGET_IXOFF   0010000
35048f6b4dSbellard #define TARGET_IMAXBEL 0020000
362601c356Sths #define TARGET_IUTF8   0040000
37048f6b4dSbellard 
38048f6b4dSbellard /* c_oflag bits */
39048f6b4dSbellard #define TARGET_OPOST   0000001
40048f6b4dSbellard #define TARGET_OLCUC   0000002
41048f6b4dSbellard #define TARGET_ONLCR   0000004
42048f6b4dSbellard #define TARGET_OCRNL   0000010
43048f6b4dSbellard #define TARGET_ONOCR   0000020
44048f6b4dSbellard #define TARGET_ONLRET  0000040
45048f6b4dSbellard #define TARGET_OFILL   0000100
46048f6b4dSbellard #define TARGET_OFDEL   0000200
47048f6b4dSbellard #define TARGET_NLDLY   0000400
48048f6b4dSbellard #define   TARGET_NL0   0000000
49048f6b4dSbellard #define   TARGET_NL1   0000400
50048f6b4dSbellard #define TARGET_CRDLY   0003000
51048f6b4dSbellard #define   TARGET_CR0   0000000
52048f6b4dSbellard #define   TARGET_CR1   0001000
53048f6b4dSbellard #define   TARGET_CR2   0002000
54048f6b4dSbellard #define   TARGET_CR3   0003000
55048f6b4dSbellard #define TARGET_TABDLY  0014000
56048f6b4dSbellard #define   TARGET_TAB0  0000000
57048f6b4dSbellard #define   TARGET_TAB1  0004000
58048f6b4dSbellard #define   TARGET_TAB2  0010000
59048f6b4dSbellard #define   TARGET_TAB3  0014000
60048f6b4dSbellard #define   TARGET_XTABS 0014000
61048f6b4dSbellard #define TARGET_BSDLY   0020000
62048f6b4dSbellard #define   TARGET_BS0   0000000
63048f6b4dSbellard #define   TARGET_BS1   0020000
64048f6b4dSbellard #define TARGET_VTDLY   0040000
65048f6b4dSbellard #define   TARGET_VT0   0000000
66048f6b4dSbellard #define   TARGET_VT1   0040000
67048f6b4dSbellard #define TARGET_FFDLY   0100000
68048f6b4dSbellard #define   TARGET_FF0   0000000
69048f6b4dSbellard #define   TARGET_FF1   0100000
70048f6b4dSbellard 
71048f6b4dSbellard /* c_cflag bit meaning */
72048f6b4dSbellard #define TARGET_CBAUD   0010017
73048f6b4dSbellard #define  TARGET_B0     0000000         /* hang up */
74048f6b4dSbellard #define  TARGET_B50    0000001
75048f6b4dSbellard #define  TARGET_B75    0000002
76048f6b4dSbellard #define  TARGET_B110   0000003
77048f6b4dSbellard #define  TARGET_B134   0000004
78048f6b4dSbellard #define  TARGET_B150   0000005
79048f6b4dSbellard #define  TARGET_B200   0000006
80048f6b4dSbellard #define  TARGET_B300   0000007
81048f6b4dSbellard #define  TARGET_B600   0000010
82048f6b4dSbellard #define  TARGET_B1200  0000011
83048f6b4dSbellard #define  TARGET_B1800  0000012
84048f6b4dSbellard #define  TARGET_B2400  0000013
85048f6b4dSbellard #define  TARGET_B4800  0000014
86048f6b4dSbellard #define  TARGET_B9600  0000015
87048f6b4dSbellard #define  TARGET_B19200 0000016
88048f6b4dSbellard #define  TARGET_B38400 0000017
89048f6b4dSbellard #define TARGET_EXTA B19200
90048f6b4dSbellard #define TARGET_EXTB B38400
91048f6b4dSbellard #define TARGET_CSIZE   0000060
92048f6b4dSbellard #define   TARGET_CS5   0000000
93048f6b4dSbellard #define   TARGET_CS6   0000020
94048f6b4dSbellard #define   TARGET_CS7   0000040
95048f6b4dSbellard #define   TARGET_CS8   0000060
96048f6b4dSbellard #define TARGET_CSTOPB  0000100
97048f6b4dSbellard #define TARGET_CREAD   0000200
98048f6b4dSbellard #define TARGET_PARENB  0000400
99048f6b4dSbellard #define TARGET_PARODD  0001000
100048f6b4dSbellard #define TARGET_HUPCL   0002000
101048f6b4dSbellard #define TARGET_CLOCAL  0004000
102048f6b4dSbellard #define TARGET_CBAUDEX 0010000
1032601c356Sths #define  TARGET_BOTHER   0010000
104048f6b4dSbellard #define  TARGET_B57600   0010001
105048f6b4dSbellard #define  TARGET_B115200  0010002
106048f6b4dSbellard #define  TARGET_B230400  0010003
107048f6b4dSbellard #define  TARGET_B460800  0010004
1082601c356Sths #define  TARGET_B500000  0010005
1092601c356Sths #define  TARGET_B576000  0010006
1102601c356Sths #define  TARGET_B921600  0010007
1112601c356Sths #define  TARGET_B1000000 0010010
1122601c356Sths #define  TARGET_B1152000 0010011
1132601c356Sths #define  TARGET_B1500000 0010012
1142601c356Sths #define  TARGET_B2000000 0010013
1152601c356Sths #define  TARGET_B2500000 0010014
1162601c356Sths #define  TARGET_B3000000 0010015
1172601c356Sths #define  TARGET_B3500000 0010016
1182601c356Sths #define  TARGET_B4000000 0010017
119048f6b4dSbellard #define TARGET_CIBAUD    002003600000  /* input baud rate (not used) */
1202601c356Sths #define TARGET_CMSPAR    010000000000  /* mark or space (stick) parity */
121048f6b4dSbellard #define TARGET_CRTSCTS   020000000000  /* flow control */
122048f6b4dSbellard 
123048f6b4dSbellard /* c_lflag bits */
124048f6b4dSbellard #define TARGET_ISIG    0000001
125048f6b4dSbellard #define TARGET_ICANON  0000002
126048f6b4dSbellard #define TARGET_XCASE   0000004
127048f6b4dSbellard #define TARGET_ECHO    0000010
128048f6b4dSbellard #define TARGET_ECHOE   0000020
129048f6b4dSbellard #define TARGET_ECHOK   0000040
130048f6b4dSbellard #define TARGET_ECHONL  0000100
131048f6b4dSbellard #define TARGET_NOFLSH  0000200
1322601c356Sths #define TARGET_IEXTEN  0000400
133048f6b4dSbellard #define TARGET_ECHOCTL 0001000
134048f6b4dSbellard #define TARGET_ECHOPRT 0002000
135048f6b4dSbellard #define TARGET_ECHOKE  0004000
136048f6b4dSbellard #define TARGET_FLUSHO  0010000
137048f6b4dSbellard #define TARGET_PENDIN  0040000
1382601c356Sths #define TARGET_TOSTOP  0100000
1392601c356Sths #define TARGET_ITOSTOP TARGET_TOSTOP
140*c218b4edSFilip Bozuta #define TARGET_EXTPROC 0200000
141048f6b4dSbellard 
142048f6b4dSbellard /* c_cc character offsets */
143048f6b4dSbellard #define TARGET_VINTR	0
144048f6b4dSbellard #define TARGET_VQUIT	1
145048f6b4dSbellard #define TARGET_VERASE	2
146048f6b4dSbellard #define TARGET_VKILL	3
1472601c356Sths #define TARGET_VMIN	4
148048f6b4dSbellard #define TARGET_VTIME	5
1492601c356Sths #define TARGET_VEOL2	6
150048f6b4dSbellard #define TARGET_VSWTC	7
151048f6b4dSbellard #define TARGET_VSTART	8
152048f6b4dSbellard #define TARGET_VSTOP	9
153048f6b4dSbellard #define TARGET_VSUSP	10
1542601c356Sths /* VDSUSP not supported */
155048f6b4dSbellard #define TARGET_VREPRINT	12
156048f6b4dSbellard #define TARGET_VDISCARD	13
157048f6b4dSbellard #define TARGET_VWERASE	14
158048f6b4dSbellard #define TARGET_VLNEXT	15
1592601c356Sths #define TARGET_VEOF	16
1602601c356Sths #define TARGET_VEOL	17
161048f6b4dSbellard 
162048f6b4dSbellard /* ioctls */
163048f6b4dSbellard 
164c960bde1Sbellard #define TARGET_TCGETA		0x5401
165c960bde1Sbellard #define TARGET_TCSETA		0x5402	/* Clashes with SNDCTL_TMR_START sound ioctl */
166c960bde1Sbellard #define TARGET_TCSETAW		0x5403
167c960bde1Sbellard #define TARGET_TCSETAF		0x5404
168048f6b4dSbellard 
169c960bde1Sbellard #define TARGET_TCSBRK		0x5405
170c960bde1Sbellard #define TARGET_TCXONC		0x5406
171c960bde1Sbellard #define TARGET_TCFLSH		0x5407
172c960bde1Sbellard 
173c960bde1Sbellard #define TARGET_TCGETS		0x540d
174c960bde1Sbellard #define TARGET_TCSETS		0x540e
175c960bde1Sbellard #define TARGET_TCSETSW		0x540f
176c960bde1Sbellard #define TARGET_TCSETSF		0x5410
177c960bde1Sbellard 
178c960bde1Sbellard #define TARGET_TIOCEXCL	0x740d		/* set exclusive use of tty */
179c960bde1Sbellard #define TARGET_TIOCNXCL	0x740e		/* reset exclusive use of tty */
180c960bde1Sbellard #define TARGET_TIOCOUTQ	0x7472		/* output queue size */
181c960bde1Sbellard #define TARGET_TIOCSTI	0x5472		/* simulate terminal input */
182c960bde1Sbellard #define TARGET_TIOCMGET	0x741d		/* get all modem bits */
183c960bde1Sbellard #define TARGET_TIOCMBIS	0x741b		/* bis modem bits */
184c960bde1Sbellard #define TARGET_TIOCMBIC	0x741c		/* bic modem bits */
185c960bde1Sbellard #define TARGET_TIOCMSET	0x741a		/* set all modem bits */
186c960bde1Sbellard #define TARGET_TIOCPKT		0x5470		/* pty: set/clear packet mode */
187c960bde1Sbellard #define	 TARGET_TIOCPKT_DATA		0x00	/* data packet */
188c960bde1Sbellard #define	 TARGET_TIOCPKT_FLUSHREAD	0x01	/* flush packet */
189c960bde1Sbellard #define	 TARGET_TIOCPKT_FLUSHWRITE	0x02	/* flush packet */
190c960bde1Sbellard #define	 TARGET_TIOCPKT_STOP		0x04	/* stop output */
191c960bde1Sbellard #define	 TARGET_TIOCPKT_START		0x08	/* start output */
192c960bde1Sbellard #define	 TARGET_TIOCPKT_NOSTOP		0x10	/* no more ^S, ^Q */
193c960bde1Sbellard #define	 TARGET_TIOCPKT_DOSTOP		0x20	/* now do ^S ^Q */
194c960bde1Sbellard /* #define  TIOCPKT_IOCTL		0x40	state change of pty driver */
195c960bde1Sbellard #define TARGET_TIOCSWINSZ	TARGET_IOW('t', 103, struct winsize)	/* set window size */
196c960bde1Sbellard #define TARGET_TIOCGWINSZ	TARGET_IOR('t', 104, struct winsize)	/* get window size */
197c960bde1Sbellard #define TARGET_TIOCNOTTY	0x5471		/* void tty association */
198c960bde1Sbellard #define TARGET_TIOCSETD	0x7401
199c960bde1Sbellard #define TARGET_TIOCGETD	0x7400
200c960bde1Sbellard 
201c960bde1Sbellard #define TARGET_FIOCLEX		0x6601
202c960bde1Sbellard #define TARGET_FIONCLEX	0x6602
203c960bde1Sbellard #define TARGET_FIOASYNC	0x667d
204c960bde1Sbellard #define TARGET_FIONBIO		0x667e
205c960bde1Sbellard #define TARGET_FIOQSIZE	0x667f
206c960bde1Sbellard 
207c960bde1Sbellard #define TARGET_TIOCGLTC	0x7474			/* get special local chars */
208c960bde1Sbellard #define TARGET_TIOCSLTC	0x7475			/* set special local chars */
209c960bde1Sbellard #define TARGET_TIOCSPGRP	TARGET_IOW('t', 118, int)	/* set pgrp of tty */
210c960bde1Sbellard #define TARGET_TIOCGPGRP	TARGET_IOR('t', 119, int)	/* get pgrp of tty */
211c960bde1Sbellard #define TARGET_TIOCCONS	TARGET_IOW('t', 120, int)	/* become virtual console */
212c960bde1Sbellard 
213c960bde1Sbellard #define TARGET_FIONREAD	0x467f
214048f6b4dSbellard #define TARGET_TIOCINQ		TARGET_FIONREAD
215c960bde1Sbellard 
216c960bde1Sbellard #define TARGET_TIOCGETP        0x7408
217c960bde1Sbellard #define TARGET_TIOCSETP        0x7409
218c960bde1Sbellard #define TARGET_TIOCSETN        0x740a			/* TIOCSETP wo flush */
219c960bde1Sbellard 
220c960bde1Sbellard /* #define TARGET_TIOCSETA	TARGET_IOW('t', 20, struct termios) set termios struct */
221c960bde1Sbellard /* #define TARGET_TIOCSETAW	TARGET_IOW('t', 21, struct termios) drain output, set */
222c960bde1Sbellard /* #define TARGET_TIOCSETAF	TARGET_IOW('t', 22, struct termios) drn out, fls in, set */
223c960bde1Sbellard /* #define TARGET_TIOCGETD	TARGET_IOR('t', 26, int)	get line discipline */
224c960bde1Sbellard /* #define TARGET_TIOCSETD	TARGET_IOW('t', 27, int)	set line discipline */
225c960bde1Sbellard 						/* 127-124 compat */
226c960bde1Sbellard 
227048f6b4dSbellard #define TARGET_TIOCSBRK	0x5427  /* BSD compatibility */
228048f6b4dSbellard #define TARGET_TIOCCBRK	0x5428  /* BSD compatibility */
229c960bde1Sbellard #define TARGET_TIOCGSID	0x7416  /* Return the session ID of FD */
230af83b52eSAleksandar Markovic #define TARGET_TCGETS2          TARGET_IOR('T', 0x2A, struct termios2)
231af83b52eSAleksandar Markovic #define TARGET_TCSETS2          TARGET_IOW('T', 0x2B, struct termios2)
232af83b52eSAleksandar Markovic #define TARGET_TCSETSW2         TARGET_IOW('T', 0x2C, struct termios2)
233af83b52eSAleksandar Markovic #define TARGET_TCSETSF2         TARGET_IOW('T', 0x2D, struct termios2)
234af83b52eSAleksandar Markovic #define TARGET_TIOCGRS485       TARGET_IOR('T', 0x2E, struct serial_rs485)
235af83b52eSAleksandar Markovic #define TARGET_TIOCSRS485       TARGET_IOWR('T', 0x2F, struct serial_rs485)
236048f6b4dSbellard #define TARGET_TIOCGPTN	TARGET_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
237048f6b4dSbellard #define TARGET_TIOCSPTLCK	TARGET_IOW('T',0x31, int)  /* Lock/unlock Pty */
238af83b52eSAleksandar Markovic #define TARGET_TIOCGDEV         TARGET_IOR('T', 0x32, unsigned int)
239af83b52eSAleksandar Markovic #define TARGET_TIOCSIG          TARGET_IOW('T', 0x36, int)
240af83b52eSAleksandar Markovic #define TARGET_TIOCVHANGUP      0x5437
241af83b52eSAleksandar Markovic #define TARGET_TIOCGPKT         TARGET_IOR('T', 0x38, int)
242af83b52eSAleksandar Markovic #define TARGET_TIOCGPTLCK       TARGET_IOR('T', 0x39, int)
243af83b52eSAleksandar Markovic #define TARGET_TIOCGEXCL        TARGET_IOR('T', 0x40, int)
2442b74f621SAndreas Schwab #define TARGET_TIOCGPTPEER      TARGET_IO('T', 0x41)
245048f6b4dSbellard 
246c960bde1Sbellard /* I hope the range from 0x5480 on is free ... */
247c960bde1Sbellard #define TARGET_TIOCSCTTY	0x5480		/* become controlling tty */
248c960bde1Sbellard #define TARGET_TIOCGSOFTCAR	0x5481
249c960bde1Sbellard #define TARGET_TIOCSSOFTCAR	0x5482
250c960bde1Sbellard #define TARGET_TIOCLINUX	0x5483
251c960bde1Sbellard #define TARGET_TIOCGSERIAL	0x5484
252c960bde1Sbellard #define TARGET_TIOCSSERIAL	0x5485
253c960bde1Sbellard #define TARGET_TCSBRKP		0x5486	/* Needed for POSIX tcsendbreak() */
254c960bde1Sbellard #define TARGET_TIOCSERCONFIG	0x5488
255c960bde1Sbellard #define TARGET_TIOCSERGWILD	0x5489
256c960bde1Sbellard #define TARGET_TIOCSERSWILD	0x548a
257c960bde1Sbellard #define TARGET_TIOCGLCKTRMIOS	0x548b
258c960bde1Sbellard #define TARGET_TIOCSLCKTRMIOS	0x548c
259c960bde1Sbellard #define TARGET_TIOCSERGSTRUCT	0x548d /* For debugging only */
260c960bde1Sbellard #define TARGET_TIOCSERGETLSR   0x548e /* Get line status register */
261c960bde1Sbellard #define TARGET_TIOCSERGETMULTI 0x548f /* Get multiport config  */
262c960bde1Sbellard #define TARGET_TIOCSERSETMULTI 0x5490 /* Set multiport config */
263c960bde1Sbellard #define TARGET_TIOCMIWAIT      0x5491 /* wait for a change on serial input line(s) */
264c960bde1Sbellard #define TARGET_TIOCGICOUNT     0x5492 /* read serial port inline interrupt counts */
265c960bde1Sbellard #define TARGET_TIOCGHAYESESP	0x5493 /* Get Hayes ESP configuration */
266c960bde1Sbellard #define TARGET_TIOCSHAYESESP	0x5494 /* Set Hayes ESP configuration */
267f91005e1SMarkus Armbruster 
268f91005e1SMarkus Armbruster #endif
269