xref: /qemu/linux-user/alpha/termbits.h (revision c218b4ed)
1f91005e1SMarkus Armbruster #ifndef LINUX_USER_ALPHA_TERMBITS_H
2f91005e1SMarkus Armbruster #define LINUX_USER_ALPHA_TERMBITS_H
3f91005e1SMarkus Armbruster 
4c227f099SAnthony Liguori typedef unsigned char	target_cc_t;
5c227f099SAnthony Liguori typedef unsigned int	target_speed_t;
6c227f099SAnthony Liguori typedef unsigned int	target_tcflag_t;
786cc1ce0Sj_mayer 
886cc1ce0Sj_mayer #define TARGET_NCCS 19
986cc1ce0Sj_mayer struct target_termios {
10c227f099SAnthony Liguori 	target_tcflag_t c_iflag;		/* input mode flags */
11c227f099SAnthony Liguori 	target_tcflag_t c_oflag;		/* output mode flags */
12c227f099SAnthony Liguori 	target_tcflag_t c_cflag;		/* control mode flags */
13c227f099SAnthony Liguori 	target_tcflag_t c_lflag;		/* local mode flags */
14c227f099SAnthony Liguori 	target_cc_t c_cc[TARGET_NCCS];		/* control characters */
15c227f099SAnthony Liguori 	target_cc_t c_line;			/* line discipline (== c_cc[19]) */
16c227f099SAnthony Liguori 	target_speed_t c_ispeed;		/* input speed */
17c227f099SAnthony Liguori 	target_speed_t c_ospeed;		/* output speed */
1886cc1ce0Sj_mayer };
1986cc1ce0Sj_mayer 
2086cc1ce0Sj_mayer /* c_cc characters */
2186cc1ce0Sj_mayer #define TARGET_VEOF 0
2286cc1ce0Sj_mayer #define TARGET_VEOL 1
2386cc1ce0Sj_mayer #define TARGET_VEOL2 2
2486cc1ce0Sj_mayer #define TARGET_VERASE 3
2586cc1ce0Sj_mayer #define TARGET_VWERASE 4
2686cc1ce0Sj_mayer #define TARGET_VKILL 5
2786cc1ce0Sj_mayer #define TARGET_VREPRINT 6
2886cc1ce0Sj_mayer #define TARGET_VSWTC 7
2986cc1ce0Sj_mayer #define TARGET_VINTR 8
3086cc1ce0Sj_mayer #define TARGET_VQUIT 9
3186cc1ce0Sj_mayer #define TARGET_VSUSP 10
3286cc1ce0Sj_mayer #define TARGET_VSTART 12
3386cc1ce0Sj_mayer #define TARGET_VSTOP 13
3486cc1ce0Sj_mayer #define TARGET_VLNEXT 14
3586cc1ce0Sj_mayer #define TARGET_VDISCARD 15
3686cc1ce0Sj_mayer #define TARGET_VMIN 16
3786cc1ce0Sj_mayer #define TARGET_VTIME 17
3886cc1ce0Sj_mayer 
3986cc1ce0Sj_mayer /* c_iflag bits */
4086cc1ce0Sj_mayer #define TARGET_IGNBRK	0000001
4186cc1ce0Sj_mayer #define TARGET_BRKINT	0000002
4286cc1ce0Sj_mayer #define TARGET_IGNPAR	0000004
4386cc1ce0Sj_mayer #define TARGET_PARMRK	0000010
4486cc1ce0Sj_mayer #define TARGET_INPCK	0000020
4586cc1ce0Sj_mayer #define TARGET_ISTRIP	0000040
4686cc1ce0Sj_mayer #define TARGET_INLCR	0000100
4786cc1ce0Sj_mayer #define TARGET_IGNCR	0000200
4886cc1ce0Sj_mayer #define TARGET_ICRNL	0000400
4986cc1ce0Sj_mayer #define TARGET_IXON	0001000
5086cc1ce0Sj_mayer #define TARGET_IXOFF	0002000
5186cc1ce0Sj_mayer #define TARGET_IXANY	0004000
5286cc1ce0Sj_mayer #define TARGET_IUCLC	0010000
5386cc1ce0Sj_mayer #define TARGET_IMAXBEL	0020000
5486cc1ce0Sj_mayer #define TARGET_IUTF8	0040000
5586cc1ce0Sj_mayer 
5686cc1ce0Sj_mayer /* c_oflag bits */
5786cc1ce0Sj_mayer #define TARGET_OPOST	0000001
5886cc1ce0Sj_mayer #define TARGET_ONLCR	0000002
5986cc1ce0Sj_mayer #define TARGET_OLCUC	0000004
6086cc1ce0Sj_mayer 
6186cc1ce0Sj_mayer #define TARGET_OCRNL	0000010
6286cc1ce0Sj_mayer #define TARGET_ONOCR	0000020
6386cc1ce0Sj_mayer #define TARGET_ONLRET	0000040
6486cc1ce0Sj_mayer 
6586cc1ce0Sj_mayer #define TARGET_OFILL	00000100
6686cc1ce0Sj_mayer #define TARGET_OFDEL	00000200
6786cc1ce0Sj_mayer #define TARGET_NLDLY	00001400
6886cc1ce0Sj_mayer #define   TARGET_NL0	00000000
6986cc1ce0Sj_mayer #define   TARGET_NL1	00000400
7086cc1ce0Sj_mayer #define   TARGET_NL2	00001000
7186cc1ce0Sj_mayer #define   TARGET_NL3	00001400
7286cc1ce0Sj_mayer #define TARGET_TABDLY	00006000
7386cc1ce0Sj_mayer #define   TARGET_TAB0	00000000
7486cc1ce0Sj_mayer #define   TARGET_TAB1	00002000
7586cc1ce0Sj_mayer #define   TARGET_TAB2	00004000
7686cc1ce0Sj_mayer #define   TARGET_TAB3	00006000
7786cc1ce0Sj_mayer #define TARGET_CRDLY	00030000
7886cc1ce0Sj_mayer #define   TARGET_CR0	00000000
7986cc1ce0Sj_mayer #define   TARGET_CR1	00010000
8086cc1ce0Sj_mayer #define   TARGET_CR2	00020000
8186cc1ce0Sj_mayer #define   TARGET_CR3	00030000
8286cc1ce0Sj_mayer #define TARGET_FFDLY	00040000
8386cc1ce0Sj_mayer #define   TARGET_FF0	00000000
8486cc1ce0Sj_mayer #define   TARGET_FF1	00040000
8586cc1ce0Sj_mayer #define TARGET_BSDLY	00100000
8686cc1ce0Sj_mayer #define   TARGET_BS0	00000000
8786cc1ce0Sj_mayer #define   TARGET_BS1	00100000
8886cc1ce0Sj_mayer #define TARGET_VTDLY	00200000
8986cc1ce0Sj_mayer #define   TARGET_VT0	00000000
9086cc1ce0Sj_mayer #define   TARGET_VT1	00200000
9186cc1ce0Sj_mayer #define TARGET_XTABS	01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
9286cc1ce0Sj_mayer 
9386cc1ce0Sj_mayer /* c_cflag bit meaning */
9486cc1ce0Sj_mayer #define TARGET_CBAUD	0000037
9586cc1ce0Sj_mayer #define  TARGET_B0	0000000		/* hang up */
9686cc1ce0Sj_mayer #define  TARGET_B50	0000001
9786cc1ce0Sj_mayer #define  TARGET_B75	0000002
9886cc1ce0Sj_mayer #define  TARGET_B110	0000003
9986cc1ce0Sj_mayer #define  TARGET_B134	0000004
10086cc1ce0Sj_mayer #define  TARGET_B150	0000005
10186cc1ce0Sj_mayer #define  TARGET_B200	0000006
10286cc1ce0Sj_mayer #define  TARGET_B300	0000007
10386cc1ce0Sj_mayer #define  TARGET_B600	0000010
10486cc1ce0Sj_mayer #define  TARGET_B1200	0000011
10586cc1ce0Sj_mayer #define  TARGET_B1800	0000012
10686cc1ce0Sj_mayer #define  TARGET_B2400	0000013
10786cc1ce0Sj_mayer #define  TARGET_B4800	0000014
10886cc1ce0Sj_mayer #define  TARGET_B9600	0000015
10986cc1ce0Sj_mayer #define  TARGET_B19200	0000016
11086cc1ce0Sj_mayer #define  TARGET_B38400	0000017
11186cc1ce0Sj_mayer #define TARGET_EXTA B19200
11286cc1ce0Sj_mayer #define TARGET_EXTB B38400
11386cc1ce0Sj_mayer #define TARGET_CBAUDEX 0000000
11486cc1ce0Sj_mayer #define  TARGET_B57600   00020
11586cc1ce0Sj_mayer #define  TARGET_B115200  00021
11686cc1ce0Sj_mayer #define  TARGET_B230400  00022
11786cc1ce0Sj_mayer #define  TARGET_B460800  00023
11886cc1ce0Sj_mayer #define  TARGET_B500000  00024
11986cc1ce0Sj_mayer #define  TARGET_B576000  00025
12086cc1ce0Sj_mayer #define  TARGET_B921600  00026
12186cc1ce0Sj_mayer #define TARGET_B1000000  00027
12286cc1ce0Sj_mayer #define TARGET_B1152000  00030
12386cc1ce0Sj_mayer #define TARGET_B1500000  00031
12486cc1ce0Sj_mayer #define TARGET_B2000000  00032
12586cc1ce0Sj_mayer #define TARGET_B2500000  00033
12686cc1ce0Sj_mayer #define TARGET_B3000000  00034
12786cc1ce0Sj_mayer #define TARGET_B3500000  00035
12886cc1ce0Sj_mayer #define TARGET_B4000000  00036
12986cc1ce0Sj_mayer 
13086cc1ce0Sj_mayer #define TARGET_CSIZE	00001400
13186cc1ce0Sj_mayer #define   TARGET_CS5	00000000
13286cc1ce0Sj_mayer #define   TARGET_CS6	00000400
13386cc1ce0Sj_mayer #define   TARGET_CS7	00001000
13486cc1ce0Sj_mayer #define   TARGET_CS8	00001400
13586cc1ce0Sj_mayer 
13686cc1ce0Sj_mayer #define TARGET_CSTOPB	00002000
13786cc1ce0Sj_mayer #define TARGET_CREAD	00004000
13886cc1ce0Sj_mayer #define TARGET_PARENB	00010000
13986cc1ce0Sj_mayer #define TARGET_PARODD	00020000
14086cc1ce0Sj_mayer #define TARGET_HUPCL	00040000
14186cc1ce0Sj_mayer 
14286cc1ce0Sj_mayer #define TARGET_CLOCAL	00100000
14386cc1ce0Sj_mayer #define TARGET_CMSPAR	  010000000000		/* mark or space (stick) parity */
14486cc1ce0Sj_mayer #define TARGET_CRTSCTS	  020000000000		/* flow control */
14586cc1ce0Sj_mayer 
14686cc1ce0Sj_mayer /* c_lflag bits */
14786cc1ce0Sj_mayer #define TARGET_ISIG	0x00000080
14886cc1ce0Sj_mayer #define TARGET_ICANON	0x00000100
14986cc1ce0Sj_mayer #define TARGET_XCASE	0x00004000
15086cc1ce0Sj_mayer #define TARGET_ECHO	0x00000008
15186cc1ce0Sj_mayer #define TARGET_ECHOE	0x00000002
15286cc1ce0Sj_mayer #define TARGET_ECHOK	0x00000004
15386cc1ce0Sj_mayer #define TARGET_ECHONL	0x00000010
15486cc1ce0Sj_mayer #define TARGET_NOFLSH	0x80000000
15586cc1ce0Sj_mayer #define TARGET_TOSTOP	0x00400000
15686cc1ce0Sj_mayer #define TARGET_ECHOCTL	0x00000040
15786cc1ce0Sj_mayer #define TARGET_ECHOPRT	0x00000020
15886cc1ce0Sj_mayer #define TARGET_ECHOKE	0x00000001
15986cc1ce0Sj_mayer #define TARGET_FLUSHO	0x00800000
16086cc1ce0Sj_mayer #define TARGET_PENDIN	0x20000000
16186cc1ce0Sj_mayer #define TARGET_IEXTEN	0x00000400
162*c218b4edSFilip Bozuta #define TARGET_EXTPROC  0x10000000
16386cc1ce0Sj_mayer 
164dccfec67Saurel32 #define TARGET_FIOCLEX		TARGET_IO('f', 1)
165dccfec67Saurel32 #define TARGET_FIONCLEX	TARGET_IO('f', 2)
166dccfec67Saurel32 #define TARGET_FIOASYNC	TARGET_IOW('f', 125, int)
167dccfec67Saurel32 #define TARGET_FIONBIO		TARGET_IOW('f', 126, int)
168dccfec67Saurel32 #define TARGET_FIONREAD	TARGET_IOR('f', 127, int)
16986cc1ce0Sj_mayer #define TARGET_TIOCINQ		FIONREAD
170dccfec67Saurel32 #define TARGET_FIOQSIZE	TARGET_IOR('f', 128, loff_t)
17186cc1ce0Sj_mayer 
172dccfec67Saurel32 #define TARGET_TIOCGETP	TARGET_IOR('t', 8, struct target_sgttyb)
173dccfec67Saurel32 #define TARGET_TIOCSETP	TARGET_IOW('t', 9, struct target_sgttyb)
174dccfec67Saurel32 #define TARGET_TIOCSETN	TARGET_IOW('t', 10, struct target_sgttyb)	/* TIOCSETP wo flush */
17586cc1ce0Sj_mayer 
176dccfec67Saurel32 #define TARGET_TIOCSETC	TARGET_IOW('t', 17, struct target_tchars)
177dccfec67Saurel32 #define TARGET_TIOCGETC	TARGET_IOR('t', 18, struct target_tchars)
178dccfec67Saurel32 #define TARGET_TCGETS		TARGET_IOR('t', 19, struct target_termios)
179dccfec67Saurel32 #define TARGET_TCSETS		TARGET_IOW('t', 20, struct target_termios)
180dccfec67Saurel32 #define TARGET_TCSETSW		TARGET_IOW('t', 21, struct target_termios)
181dccfec67Saurel32 #define TARGET_TCSETSF		TARGET_IOW('t', 22, struct target_termios)
18286cc1ce0Sj_mayer 
183dccfec67Saurel32 #define TARGET_TCGETA		TARGET_IOR('t', 23, struct target_termio)
184dccfec67Saurel32 #define TARGET_TCSETA		TARGET_IOW('t', 24, struct target_termio)
185dccfec67Saurel32 #define TARGET_TCSETAW		TARGET_IOW('t', 25, struct target_termio)
186dccfec67Saurel32 #define TARGET_TCSETAF		TARGET_IOW('t', 28, struct target_termio)
18786cc1ce0Sj_mayer 
188dccfec67Saurel32 #define TARGET_TCSBRK		TARGET_IO('t', 29)
189dccfec67Saurel32 #define TARGET_TCXONC		TARGET_IO('t', 30)
190dccfec67Saurel32 #define TARGET_TCFLSH		TARGET_IO('t', 31)
19186cc1ce0Sj_mayer 
192dccfec67Saurel32 #define TARGET_TIOCSWINSZ	TARGET_IOW('t', 103, struct target_winsize)
193dccfec67Saurel32 #define TARGET_TIOCGWINSZ	TARGET_IOR('t', 104, struct target_winsize)
194dccfec67Saurel32 #define	TARGET_TIOCSTART	TARGET_IO('t', 110)		/* start output, like ^Q */
195dccfec67Saurel32 #define	TARGET_TIOCSTOP	TARGET_IO('t', 111)		/* stop output, like ^S */
196dccfec67Saurel32 #define TARGET_TIOCOUTQ        TARGET_IOR('t', 115, int)     /* output queue size */
19786cc1ce0Sj_mayer 
198dccfec67Saurel32 #define TARGET_TIOCGLTC	TARGET_IOR('t', 116, struct target_ltchars)
199dccfec67Saurel32 #define TARGET_TIOCSLTC	TARGET_IOW('t', 117, struct target_ltchars)
200dccfec67Saurel32 #define TARGET_TIOCSPGRP	TARGET_IOW('t', 118, int)
201dccfec67Saurel32 #define TARGET_TIOCGPGRP	TARGET_IOR('t', 119, int)
20286cc1ce0Sj_mayer 
20386cc1ce0Sj_mayer #define TARGET_TIOCEXCL	0x540C
20486cc1ce0Sj_mayer #define TARGET_TIOCNXCL	0x540D
20586cc1ce0Sj_mayer #define TARGET_TIOCSCTTY	0x540E
20686cc1ce0Sj_mayer 
20786cc1ce0Sj_mayer #define TARGET_TIOCSTI		0x5412
20886cc1ce0Sj_mayer #define TARGET_TIOCMGET	0x5415
20986cc1ce0Sj_mayer #define TARGET_TIOCMBIS	0x5416
21086cc1ce0Sj_mayer #define TARGET_TIOCMBIC	0x5417
21186cc1ce0Sj_mayer #define TARGET_TIOCMSET	0x5418
21286cc1ce0Sj_mayer # define TARGET_TIOCM_LE	0x001
21386cc1ce0Sj_mayer # define TARGET_TIOCM_DTR	0x002
21486cc1ce0Sj_mayer # define TARGET_TIOCM_RTS	0x004
21586cc1ce0Sj_mayer # define TARGET_TIOCM_ST	0x008
21686cc1ce0Sj_mayer # define TARGET_TIOCM_SR	0x010
21786cc1ce0Sj_mayer # define TARGET_TIOCM_CTS	0x020
21886cc1ce0Sj_mayer # define TARGET_TIOCM_CAR	0x040
21986cc1ce0Sj_mayer # define TARGET_TIOCM_RNG	0x080
22086cc1ce0Sj_mayer # define TARGET_TIOCM_DSR	0x100
22186cc1ce0Sj_mayer # define TARGET_TIOCM_CD	TIOCM_CAR
22286cc1ce0Sj_mayer # define TARGET_TIOCM_RI	TIOCM_RNG
22386cc1ce0Sj_mayer # define TARGET_TIOCM_OUT1	0x2000
22486cc1ce0Sj_mayer # define TARGET_TIOCM_OUT2	0x4000
22586cc1ce0Sj_mayer # define TARGET_TIOCM_LOOP	0x8000
22686cc1ce0Sj_mayer 
22786cc1ce0Sj_mayer #define TARGET_TIOCGSOFTCAR	0x5419
22886cc1ce0Sj_mayer #define TARGET_TIOCSSOFTCAR	0x541A
22986cc1ce0Sj_mayer #define TARGET_TIOCLINUX	0x541C
23086cc1ce0Sj_mayer #define TARGET_TIOCCONS	0x541D
23186cc1ce0Sj_mayer #define TARGET_TIOCGSERIAL	0x541E
23286cc1ce0Sj_mayer #define TARGET_TIOCSSERIAL	0x541F
23386cc1ce0Sj_mayer #define TARGET_TIOCPKT		0x5420
23486cc1ce0Sj_mayer # define TARGET_TIOCPKT_DATA		 0
23586cc1ce0Sj_mayer # define TARGET_TIOCPKT_FLUSHREAD	 1
23686cc1ce0Sj_mayer # define TARGET_TIOCPKT_FLUSHWRITE	 2
23786cc1ce0Sj_mayer # define TARGET_TIOCPKT_STOP		 4
23886cc1ce0Sj_mayer # define TARGET_TIOCPKT_START		 8
23986cc1ce0Sj_mayer # define TARGET_TIOCPKT_NOSTOP		16
24086cc1ce0Sj_mayer # define TARGET_TIOCPKT_DOSTOP		32
24186cc1ce0Sj_mayer 
24286cc1ce0Sj_mayer 
24386cc1ce0Sj_mayer #define TARGET_TIOCNOTTY	0x5422
24486cc1ce0Sj_mayer #define TARGET_TIOCSETD	0x5423
24586cc1ce0Sj_mayer #define TARGET_TIOCGETD	0x5424
24686cc1ce0Sj_mayer #define TARGET_TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
24786cc1ce0Sj_mayer #define TARGET_TIOCSBRK	0x5427  /* BSD compatibility */
24886cc1ce0Sj_mayer #define TARGET_TIOCCBRK	0x5428  /* BSD compatibility */
24986cc1ce0Sj_mayer #define TARGET_TIOCGSID	0x5429  /* Return the session ID of FD */
250dccfec67Saurel32 #define TARGET_TIOCGPTN	TARGET_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
251dccfec67Saurel32 #define TARGET_TIOCSPTLCK	TARGET_IOW('T',0x31, int)  /* Lock/unlock Pty */
2522b74f621SAndreas Schwab #define TARGET_TIOCGPTPEER      TARGET_IO('T', 0x41) /* Safely open the slave */
25386cc1ce0Sj_mayer 
25486cc1ce0Sj_mayer #define TARGET_TIOCSERCONFIG	0x5453
25586cc1ce0Sj_mayer #define TARGET_TIOCSERGWILD	0x5454
25686cc1ce0Sj_mayer #define TARGET_TIOCSERSWILD	0x5455
25786cc1ce0Sj_mayer #define TARGET_TIOCGLCKTRMIOS	0x5456
25886cc1ce0Sj_mayer #define TARGET_TIOCSLCKTRMIOS	0x5457
25986cc1ce0Sj_mayer #define TARGET_TIOCSERGSTRUCT	0x5458 /* For debugging only */
26086cc1ce0Sj_mayer #define TARGET_TIOCSERGETLSR   0x5459 /* Get line status register */
26186cc1ce0Sj_mayer   /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
26286cc1ce0Sj_mayer # define TARGET_TIOCSER_TEMT    0x01	/* Transmitter physically empty */
26386cc1ce0Sj_mayer #define TARGET_TIOCSERGETMULTI 0x545A /* Get multiport config  */
26486cc1ce0Sj_mayer #define TARGET_TIOCSERSETMULTI 0x545B /* Set multiport config */
26586cc1ce0Sj_mayer 
26686cc1ce0Sj_mayer #define TARGET_TIOCMIWAIT	0x545C	/* wait for a change on serial input line(s) */
26786cc1ce0Sj_mayer #define TARGET_TIOCGICOUNT	0x545D	/* read serial port inline interrupt counts */
26886cc1ce0Sj_mayer #define TARGET_TIOCGHAYESESP	0x545E  /* Get Hayes ESP configuration */
26986cc1ce0Sj_mayer #define TARGET_TIOCSHAYESESP	0x545F  /* Set Hayes ESP configuration */
270f91005e1SMarkus Armbruster 
271f91005e1SMarkus Armbruster #endif
272