Revision 3bfd9da1

b/linux-user/arm/termbits.h
1
/* from asm/termbits.h */
2
/* NOTE: exactly the same as i386 */
3

  
4
#define TARGET_NCCS 19
5

  
6
struct target_termios {
7
    unsigned int c_iflag;               /* input mode flags */
8
    unsigned int c_oflag;               /* output mode flags */
9
    unsigned int c_cflag;               /* control mode flags */
10
    unsigned int c_lflag;               /* local mode flags */
11
    unsigned char c_line;                    /* line discipline */
12
    unsigned char c_cc[TARGET_NCCS];                /* control characters */
13
};
14

  
15
/* c_iflag bits */
16
#define TARGET_IGNBRK  0000001
17
#define TARGET_BRKINT  0000002
18
#define TARGET_IGNPAR  0000004
19
#define TARGET_PARMRK  0000010
20
#define TARGET_INPCK   0000020
21
#define TARGET_ISTRIP  0000040
22
#define TARGET_INLCR   0000100
23
#define TARGET_IGNCR   0000200
24
#define TARGET_ICRNL   0000400
25
#define TARGET_IUCLC   0001000
26
#define TARGET_IXON    0002000
27
#define TARGET_IXANY   0004000
28
#define TARGET_IXOFF   0010000
29
#define TARGET_IMAXBEL 0020000
30

  
31
/* c_oflag bits */
32
#define TARGET_OPOST   0000001
33
#define TARGET_OLCUC   0000002
34
#define TARGET_ONLCR   0000004
35
#define TARGET_OCRNL   0000010
36
#define TARGET_ONOCR   0000020
37
#define TARGET_ONLRET  0000040
38
#define TARGET_OFILL   0000100
39
#define TARGET_OFDEL   0000200
40
#define TARGET_NLDLY   0000400
41
#define   TARGET_NL0   0000000
42
#define   TARGET_NL1   0000400
43
#define TARGET_CRDLY   0003000
44
#define   TARGET_CR0   0000000
45
#define   TARGET_CR1   0001000
46
#define   TARGET_CR2   0002000
47
#define   TARGET_CR3   0003000
48
#define TARGET_TABDLY  0014000
49
#define   TARGET_TAB0  0000000
50
#define   TARGET_TAB1  0004000
51
#define   TARGET_TAB2  0010000
52
#define   TARGET_TAB3  0014000
53
#define   TARGET_XTABS 0014000
54
#define TARGET_BSDLY   0020000
55
#define   TARGET_BS0   0000000
56
#define   TARGET_BS1   0020000
57
#define TARGET_VTDLY   0040000
58
#define   TARGET_VT0   0000000
59
#define   TARGET_VT1   0040000
60
#define TARGET_FFDLY   0100000
61
#define   TARGET_FF0   0000000
62
#define   TARGET_FF1   0100000
63

  
64
/* c_cflag bit meaning */
65
#define TARGET_CBAUD   0010017
66
#define  TARGET_B0     0000000         /* hang up */
67
#define  TARGET_B50    0000001
68
#define  TARGET_B75    0000002
69
#define  TARGET_B110   0000003
70
#define  TARGET_B134   0000004
71
#define  TARGET_B150   0000005
72
#define  TARGET_B200   0000006
73
#define  TARGET_B300   0000007
74
#define  TARGET_B600   0000010
75
#define  TARGET_B1200  0000011
76
#define  TARGET_B1800  0000012
77
#define  TARGET_B2400  0000013
78
#define  TARGET_B4800  0000014
79
#define  TARGET_B9600  0000015
80
#define  TARGET_B19200 0000016
81
#define  TARGET_B38400 0000017
82
#define TARGET_EXTA B19200
83
#define TARGET_EXTB B38400
84
#define TARGET_CSIZE   0000060
85
#define   TARGET_CS5   0000000
86
#define   TARGET_CS6   0000020
87
#define   TARGET_CS7   0000040
88
#define   TARGET_CS8   0000060
89
#define TARGET_CSTOPB  0000100
90
#define TARGET_CREAD   0000200
91
#define TARGET_PARENB  0000400
92
#define TARGET_PARODD  0001000
93
#define TARGET_HUPCL   0002000
94
#define TARGET_CLOCAL  0004000
95
#define TARGET_CBAUDEX 0010000
96
#define  TARGET_B57600  0010001
97
#define  TARGET_B115200 0010002
98
#define  TARGET_B230400 0010003
99
#define  TARGET_B460800 0010004
100
#define TARGET_CIBAUD    002003600000  /* input baud rate (not used) */
101
#define TARGET_CRTSCTS   020000000000          /* flow control */
102

  
103
/* c_lflag bits */
104
#define TARGET_ISIG    0000001
105
#define TARGET_ICANON  0000002
106
#define TARGET_XCASE   0000004
107
#define TARGET_ECHO    0000010
108
#define TARGET_ECHOE   0000020
109
#define TARGET_ECHOK   0000040
110
#define TARGET_ECHONL  0000100
111
#define TARGET_NOFLSH  0000200
112
#define TARGET_TOSTOP  0000400
113
#define TARGET_ECHOCTL 0001000
114
#define TARGET_ECHOPRT 0002000
115
#define TARGET_ECHOKE  0004000
116
#define TARGET_FLUSHO  0010000
117
#define TARGET_PENDIN  0040000
118
#define TARGET_IEXTEN  0100000
119

  
120
/* c_cc character offsets */
121
#define TARGET_VINTR	0
122
#define TARGET_VQUIT	1
123
#define TARGET_VERASE	2
124
#define TARGET_VKILL	3
125
#define TARGET_VEOF	4
126
#define TARGET_VTIME	5
127
#define TARGET_VMIN	6
128
#define TARGET_VSWTC	7
129
#define TARGET_VSTART	8
130
#define TARGET_VSTOP	9
131
#define TARGET_VSUSP	10
132
#define TARGET_VEOL	11
133
#define TARGET_VREPRINT	12
134
#define TARGET_VDISCARD	13
135
#define TARGET_VWERASE	14
136
#define TARGET_VLNEXT	15
137
#define TARGET_VEOL2	16
138

  
139
/* ioctls */
140

  
141
#define TARGET_TCGETS		0x5401
142
#define TARGET_TCSETS		0x5402
143
#define TARGET_TCSETSW		0x5403
144
#define TARGET_TCSETSF		0x5404
145
#define TARGET_TCGETA		0x5405
146
#define TARGET_TCSETA		0x5406
147
#define TARGET_TCSETAW		0x5407
148
#define TARGET_TCSETAF		0x5408
149
#define TARGET_TCSBRK		0x5409
150
#define TARGET_TCXONC		0x540A
151
#define TARGET_TCFLSH		0x540B
152

  
153
#define TARGET_TIOCEXCL	0x540C
154
#define TARGET_TIOCNXCL	0x540D
155
#define TARGET_TIOCSCTTY	0x540E
156
#define TARGET_TIOCGPGRP	0x540F
157
#define TARGET_TIOCSPGRP	0x5410
158
#define TARGET_TIOCOUTQ	0x5411
159
#define TARGET_TIOCSTI		0x5412
160
#define TARGET_TIOCGWINSZ	0x5413
161
#define TARGET_TIOCSWINSZ	0x5414
162
#define TARGET_TIOCMGET	0x5415
163
#define TARGET_TIOCMBIS	0x5416
164
#define TARGET_TIOCMBIC	0x5417
165
#define TARGET_TIOCMSET	0x5418
166
#define TARGET_TIOCGSOFTCAR	0x5419
167
#define TARGET_TIOCSSOFTCAR	0x541A
168
#define TARGET_FIONREAD	0x541B
169
#define TARGET_TIOCINQ		TARGET_FIONREAD
170
#define TARGET_TIOCLINUX	0x541C
171
#define TARGET_TIOCCONS	0x541D
172
#define TARGET_TIOCGSERIAL	0x541E
173
#define TARGET_TIOCSSERIAL	0x541F
174
#define TARGET_TIOCPKT		0x5420
175
#define TARGET_FIONBIO		0x5421
176
#define TARGET_TIOCNOTTY	0x5422
177
#define TARGET_TIOCSETD	0x5423
178
#define TARGET_TIOCGETD	0x5424
179
#define TARGET_TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
180
#define TARGET_TIOCTTYGSTRUCT	0x5426  /* For debugging only */
181
#define TARGET_TIOCSBRK	0x5427  /* BSD compatibility */
182
#define TARGET_TIOCCBRK	0x5428  /* BSD compatibility */
183
#define TARGET_TIOCGSID	0x5429  /* Return the session ID of FD */
184
#define TARGET_TIOCGPTN	TARGET_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
185
#define TARGET_TIOCSPTLCK	TARGET_IOW('T',0x31, int)  /* Lock/unlock Pty */
186

  
187
#define TARGET_FIONCLEX	0x5450  /* these numbers need to be adjusted. */
188
#define TARGET_FIOCLEX		0x5451
189
#define TARGET_FIOASYNC	0x5452
190
#define TARGET_TIOCSERCONFIG	0x5453
191
#define TARGET_TIOCSERGWILD	0x5454
192
#define TARGET_TIOCSERSWILD	0x5455
193
#define TARGET_TIOCGLCKTRMIOS	0x5456
194
#define TARGET_TIOCSLCKTRMIOS	0x5457
195
#define TARGET_TIOCSERGSTRUCT	0x5458 /* For debugging only */
196
#define TARGET_TIOCSERGETLSR   0x5459 /* Get line status register */
197
#define TARGET_TIOCSERGETMULTI 0x545A /* Get multiport config  */
198
#define TARGET_TIOCSERSETMULTI 0x545B /* Set multiport config */
199

  
200
#define TARGET_TIOCMIWAIT	0x545C	/* wait for a change on serial input line(s) */
201
#define TARGET_TIOCGICOUNT	0x545D	/* read serial port inline interrupt counts */
202
#define TARGET_TIOCGHAYESESP   0x545E  /* Get Hayes ESP configuration */
203
#define TARGET_TIOCSHAYESESP   0x545F  /* Set Hayes ESP configuration */
204

  
205
/* Used for packet mode */
206
#define TARGET_TIOCPKT_DATA		 0
207
#define TARGET_TIOCPKT_FLUSHREAD	 1
208
#define TARGET_TIOCPKT_FLUSHWRITE	 2
209
#define TARGET_TIOCPKT_STOP		 4
210
#define TARGET_TIOCPKT_START		 8
211
#define TARGET_TIOCPKT_NOSTOP		16
212
#define TARGET_TIOCPKT_DOSTOP		32
213

  
214
#define TARGET_TIOCSER_TEMT    0x01	/* Transmitter physically empty */
215

  
b/linux-user/i386/termbits.h
1
/* from asm/termbits.h */
2

  
3
#define TARGET_NCCS 19
4

  
5
struct target_termios {
6
    unsigned int c_iflag;               /* input mode flags */
7
    unsigned int c_oflag;               /* output mode flags */
8
    unsigned int c_cflag;               /* control mode flags */
9
    unsigned int c_lflag;               /* local mode flags */
10
    unsigned char c_line;                    /* line discipline */
11
    unsigned char c_cc[TARGET_NCCS];                /* control characters */
12
};
13

  
14
/* c_iflag bits */
15
#define TARGET_IGNBRK  0000001
16
#define TARGET_BRKINT  0000002
17
#define TARGET_IGNPAR  0000004
18
#define TARGET_PARMRK  0000010
19
#define TARGET_INPCK   0000020
20
#define TARGET_ISTRIP  0000040
21
#define TARGET_INLCR   0000100
22
#define TARGET_IGNCR   0000200
23
#define TARGET_ICRNL   0000400
24
#define TARGET_IUCLC   0001000
25
#define TARGET_IXON    0002000
26
#define TARGET_IXANY   0004000
27
#define TARGET_IXOFF   0010000
28
#define TARGET_IMAXBEL 0020000
29

  
30
/* c_oflag bits */
31
#define TARGET_OPOST   0000001
32
#define TARGET_OLCUC   0000002
33
#define TARGET_ONLCR   0000004
34
#define TARGET_OCRNL   0000010
35
#define TARGET_ONOCR   0000020
36
#define TARGET_ONLRET  0000040
37
#define TARGET_OFILL   0000100
38
#define TARGET_OFDEL   0000200
39
#define TARGET_NLDLY   0000400
40
#define   TARGET_NL0   0000000
41
#define   TARGET_NL1   0000400
42
#define TARGET_CRDLY   0003000
43
#define   TARGET_CR0   0000000
44
#define   TARGET_CR1   0001000
45
#define   TARGET_CR2   0002000
46
#define   TARGET_CR3   0003000
47
#define TARGET_TABDLY  0014000
48
#define   TARGET_TAB0  0000000
49
#define   TARGET_TAB1  0004000
50
#define   TARGET_TAB2  0010000
51
#define   TARGET_TAB3  0014000
52
#define   TARGET_XTABS 0014000
53
#define TARGET_BSDLY   0020000
54
#define   TARGET_BS0   0000000
55
#define   TARGET_BS1   0020000
56
#define TARGET_VTDLY   0040000
57
#define   TARGET_VT0   0000000
58
#define   TARGET_VT1   0040000
59
#define TARGET_FFDLY   0100000
60
#define   TARGET_FF0   0000000
61
#define   TARGET_FF1   0100000
62

  
63
/* c_cflag bit meaning */
64
#define TARGET_CBAUD   0010017
65
#define  TARGET_B0     0000000         /* hang up */
66
#define  TARGET_B50    0000001
67
#define  TARGET_B75    0000002
68
#define  TARGET_B110   0000003
69
#define  TARGET_B134   0000004
70
#define  TARGET_B150   0000005
71
#define  TARGET_B200   0000006
72
#define  TARGET_B300   0000007
73
#define  TARGET_B600   0000010
74
#define  TARGET_B1200  0000011
75
#define  TARGET_B1800  0000012
76
#define  TARGET_B2400  0000013
77
#define  TARGET_B4800  0000014
78
#define  TARGET_B9600  0000015
79
#define  TARGET_B19200 0000016
80
#define  TARGET_B38400 0000017
81
#define TARGET_EXTA B19200
82
#define TARGET_EXTB B38400
83
#define TARGET_CSIZE   0000060
84
#define   TARGET_CS5   0000000
85
#define   TARGET_CS6   0000020
86
#define   TARGET_CS7   0000040
87
#define   TARGET_CS8   0000060
88
#define TARGET_CSTOPB  0000100
89
#define TARGET_CREAD   0000200
90
#define TARGET_PARENB  0000400
91
#define TARGET_PARODD  0001000
92
#define TARGET_HUPCL   0002000
93
#define TARGET_CLOCAL  0004000
94
#define TARGET_CBAUDEX 0010000
95
#define  TARGET_B57600  0010001
96
#define  TARGET_B115200 0010002
97
#define  TARGET_B230400 0010003
98
#define  TARGET_B460800 0010004
99
#define TARGET_CIBAUD    002003600000  /* input baud rate (not used) */
100
#define TARGET_CRTSCTS   020000000000          /* flow control */
101

  
102
/* c_lflag bits */
103
#define TARGET_ISIG    0000001
104
#define TARGET_ICANON  0000002
105
#define TARGET_XCASE   0000004
106
#define TARGET_ECHO    0000010
107
#define TARGET_ECHOE   0000020
108
#define TARGET_ECHOK   0000040
109
#define TARGET_ECHONL  0000100
110
#define TARGET_NOFLSH  0000200
111
#define TARGET_TOSTOP  0000400
112
#define TARGET_ECHOCTL 0001000
113
#define TARGET_ECHOPRT 0002000
114
#define TARGET_ECHOKE  0004000
115
#define TARGET_FLUSHO  0010000
116
#define TARGET_PENDIN  0040000
117
#define TARGET_IEXTEN  0100000
118

  
119
/* c_cc character offsets */
120
#define TARGET_VINTR	0
121
#define TARGET_VQUIT	1
122
#define TARGET_VERASE	2
123
#define TARGET_VKILL	3
124
#define TARGET_VEOF	4
125
#define TARGET_VTIME	5
126
#define TARGET_VMIN	6
127
#define TARGET_VSWTC	7
128
#define TARGET_VSTART	8
129
#define TARGET_VSTOP	9
130
#define TARGET_VSUSP	10
131
#define TARGET_VEOL	11
132
#define TARGET_VREPRINT	12
133
#define TARGET_VDISCARD	13
134
#define TARGET_VWERASE	14
135
#define TARGET_VLNEXT	15
136
#define TARGET_VEOL2	16
137

  
138
/* ioctls */
139

  
140
#define TARGET_TCGETS		0x5401
141
#define TARGET_TCSETS		0x5402
142
#define TARGET_TCSETSW		0x5403
143
#define TARGET_TCSETSF		0x5404
144
#define TARGET_TCGETA		0x5405
145
#define TARGET_TCSETA		0x5406
146
#define TARGET_TCSETAW		0x5407
147
#define TARGET_TCSETAF		0x5408
148
#define TARGET_TCSBRK		0x5409
149
#define TARGET_TCXONC		0x540A
150
#define TARGET_TCFLSH		0x540B
151

  
152
#define TARGET_TIOCEXCL	0x540C
153
#define TARGET_TIOCNXCL	0x540D
154
#define TARGET_TIOCSCTTY	0x540E
155
#define TARGET_TIOCGPGRP	0x540F
156
#define TARGET_TIOCSPGRP	0x5410
157
#define TARGET_TIOCOUTQ	0x5411
158
#define TARGET_TIOCSTI		0x5412
159
#define TARGET_TIOCGWINSZ	0x5413
160
#define TARGET_TIOCSWINSZ	0x5414
161
#define TARGET_TIOCMGET	0x5415
162
#define TARGET_TIOCMBIS	0x5416
163
#define TARGET_TIOCMBIC	0x5417
164
#define TARGET_TIOCMSET	0x5418
165
#define TARGET_TIOCGSOFTCAR	0x5419
166
#define TARGET_TIOCSSOFTCAR	0x541A
167
#define TARGET_FIONREAD	0x541B
168
#define TARGET_TIOCINQ		TARGET_FIONREAD
169
#define TARGET_TIOCLINUX	0x541C
170
#define TARGET_TIOCCONS	0x541D
171
#define TARGET_TIOCGSERIAL	0x541E
172
#define TARGET_TIOCSSERIAL	0x541F
173
#define TARGET_TIOCPKT		0x5420
174
#define TARGET_FIONBIO		0x5421
175
#define TARGET_TIOCNOTTY	0x5422
176
#define TARGET_TIOCSETD	0x5423
177
#define TARGET_TIOCGETD	0x5424
178
#define TARGET_TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
179
#define TARGET_TIOCTTYGSTRUCT	0x5426  /* For debugging only */
180
#define TARGET_TIOCSBRK	0x5427  /* BSD compatibility */
181
#define TARGET_TIOCCBRK	0x5428  /* BSD compatibility */
182
#define TARGET_TIOCGSID	0x5429  /* Return the session ID of FD */
183
#define TARGET_TIOCGPTN	TARGET_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
184
#define TARGET_TIOCSPTLCK	TARGET_IOW('T',0x31, int)  /* Lock/unlock Pty */
185

  
186
#define TARGET_FIONCLEX	0x5450  /* these numbers need to be adjusted. */
187
#define TARGET_FIOCLEX		0x5451
188
#define TARGET_FIOASYNC	0x5452
189
#define TARGET_TIOCSERCONFIG	0x5453
190
#define TARGET_TIOCSERGWILD	0x5454
191
#define TARGET_TIOCSERSWILD	0x5455
192
#define TARGET_TIOCGLCKTRMIOS	0x5456
193
#define TARGET_TIOCSLCKTRMIOS	0x5457
194
#define TARGET_TIOCSERGSTRUCT	0x5458 /* For debugging only */
195
#define TARGET_TIOCSERGETLSR   0x5459 /* Get line status register */
196
#define TARGET_TIOCSERGETMULTI 0x545A /* Get multiport config  */
197
#define TARGET_TIOCSERSETMULTI 0x545B /* Set multiport config */
198

  
199
#define TARGET_TIOCMIWAIT	0x545C	/* wait for a change on serial input line(s) */
200
#define TARGET_TIOCGICOUNT	0x545D	/* read serial port inline interrupt counts */
201
#define TARGET_TIOCGHAYESESP   0x545E  /* Get Hayes ESP configuration */
202
#define TARGET_TIOCSHAYESESP   0x545F  /* Set Hayes ESP configuration */
203

  
204
/* Used for packet mode */
205
#define TARGET_TIOCPKT_DATA		 0
206
#define TARGET_TIOCPKT_FLUSHREAD	 1
207
#define TARGET_TIOCPKT_FLUSHWRITE	 2
208
#define TARGET_TIOCPKT_STOP		 4
209
#define TARGET_TIOCPKT_START		 8
210
#define TARGET_TIOCPKT_NOSTOP		16
211
#define TARGET_TIOCPKT_DOSTOP		32
212

  
213
#define TARGET_TIOCSER_TEMT    0x01	/* Transmitter physically empty */
214

  
b/linux-user/ppc/termbits.h
1
/* from asm/termbits.h */
2

  
3
#define TARGET_NCCS 19
4

  
5
struct target_termios {
6
    unsigned int c_iflag;               /* input mode flags */
7
    unsigned int c_oflag;               /* output mode flags */
8
    unsigned int c_cflag;               /* control mode flags */
9
    unsigned int c_lflag;               /* local mode flags */
10
    unsigned char c_line;                    /* line discipline */
11
    unsigned char c_cc[TARGET_NCCS];                /* control characters */
12
    unsigned int c_ispeed;		/* input speed */
13
    unsigned int c_ospeed;		/* output speed */
14
};
15

  
16
/* c_cc character offsets */
17
#define TARGET_VINTR 	0
18
#define TARGET_VQUIT 	1
19
#define TARGET_VERASE 	2
20
#define TARGET_VKILL	3
21
#define TARGET_VEOF	4
22
#define TARGET_VMIN	5
23
#define TARGET_VEOL	6
24
#define TARGET_VTIME	7
25
#define TARGET_VEOL2	8
26
#define TARGET_VSWTC	9
27

  
28
#define TARGET_VWERASE 	10
29
#define TARGET_VREPRINT	11
30
#define TARGET_VSUSP 		12
31
#define TARGET_VSTART		13
32
#define TARGET_VSTOP		14
33
#define TARGET_VLNEXT		15
34
#define TARGET_VDISCARD	16
35

  
36
#define TARGET_IGNBRK	0000001
37
#define TARGET_BRKINT	0000002
38
#define TARGET_IGNPAR	0000004
39
#define TARGET_PARMRK	0000010
40
#define TARGET_INPCK	0000020
41
#define TARGET_ISTRIP	0000040
42
#define TARGET_INLCR	0000100
43
#define TARGET_IGNCR	0000200
44
#define TARGET_ICRNL	0000400
45
#define TARGET_IXON	0001000
46
#define TARGET_IXOFF	0002000
47
#define TARGET_IXANY	0004000
48
#define TARGET_IUCLC	0010000
49
#define TARGET_IMAXBEL	0020000
50

  
51
/* c_oflag bits */
52
#define TARGET_OPOST	0000001
53
#define TARGET_ONLCR	0000002
54
#define TARGET_OLCUC	0000004
55

  
56
#define TARGET_OCRNL	0000010
57
#define TARGET_ONOCR	0000020
58
#define TARGET_ONLRET	0000040
59

  
60
#define TARGET_OFILL	00000100
61
#define TARGET_OFDEL	00000200
62
#define TARGET_NLDLY	00001400
63
#define   TARGET_NL0	00000000
64
#define   TARGET_NL1	00000400
65
#define   TARGET_NL2	00001000
66
#define   TARGET_NL3	00001400
67
#define TARGET_TABDLY	00006000
68
#define   TARGET_TAB0	00000000
69
#define   TARGET_TAB1	00002000
70
#define   TARGET_TAB2	00004000
71
#define   TARGET_TAB3	00006000
72
#define TARGET_CRDLY	00030000
73
#define   TARGET_CR0	00000000
74
#define   TARGET_CR1	00010000
75
#define   TARGET_CR2	00020000
76
#define   TARGET_CR3	00030000
77
#define TARGET_FFDLY	00040000
78
#define   TARGET_FF0	00000000
79
#define   TARGET_FF1	00040000
80
#define TARGET_BSDLY	00100000
81
#define   TARGET_BS0	00000000
82
#define   TARGET_BS1	00100000
83
#define TARGET_VTDLY	00200000
84
#define   TARGET_VT0	00000000
85
#define   TARGET_VT1	00200000
86
#define TARGET_XTABS	01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
87

  
88
/* c_cflag bit meaning */
89
#define TARGET_CBAUD	0000377
90
#define  TARGET_B0	0000000		/* hang up */
91
#define  TARGET_B50	0000001
92
#define  TARGET_B75	0000002
93
#define  TARGET_B110	0000003
94
#define  TARGET_B134	0000004
95
#define  TARGET_B150	0000005
96
#define  TARGET_B200	0000006
97
#define  TARGET_B300	0000007
98
#define  TARGET_B600	0000010
99
#define  TARGET_B1200	0000011
100
#define  TARGET_B1800	0000012
101
#define  TARGET_B2400	0000013
102
#define  TARGET_B4800	0000014
103
#define  TARGET_B9600	0000015
104
#define  TARGET_B19200	0000016
105
#define  TARGET_B38400	0000017
106
#define TARGET_EXTA B19200
107
#define TARGET_EXTB B38400
108
#define TARGET_CBAUDEX 0000000
109
#define  TARGET_B57600   00020
110
#define  TARGET_B115200  00021
111
#define  TARGET_B230400  00022
112
#define  TARGET_B460800  00023
113
#define  TARGET_B500000  00024
114
#define  TARGET_B576000  00025
115
#define  TARGET_B921600  00026
116
#define TARGET_B1000000  00027
117
#define TARGET_B1152000  00030
118
#define TARGET_B1500000  00031
119
#define TARGET_B2000000  00032
120
#define TARGET_B2500000  00033
121
#define TARGET_B3000000  00034
122
#define TARGET_B3500000  00035
123
#define TARGET_B4000000  00036
124

  
125
#define TARGET_CSIZE	00001400
126
#define   TARGET_CS5	00000000
127
#define   TARGET_CS6	00000400
128
#define   TARGET_CS7	00001000
129
#define   TARGET_CS8	00001400
130

  
131
#define TARGET_CSTOPB	00002000
132
#define TARGET_CREAD	00004000
133
#define TARGET_PARENB	00010000
134
#define TARGET_PARODD	00020000
135
#define TARGET_HUPCL	00040000
136

  
137
#define TARGET_CLOCAL	00100000
138
#define TARGET_CRTSCTS	  020000000000		/* flow control */
139

  
140
/* c_lflag bits */
141
#define TARGET_ISIG	0x00000080
142
#define TARGET_ICANON	0x00000100
143
#define TARGET_XCASE	0x00004000
144
#define TARGET_ECHO	0x00000008
145
#define TARGET_ECHOE	0x00000002
146
#define TARGET_ECHOK	0x00000004
147
#define TARGET_ECHONL	0x00000010
148
#define TARGET_NOFLSH	0x80000000
149
#define TARGET_TOSTOP	0x00400000
150
#define TARGET_ECHOCTL	0x00000040
151
#define TARGET_ECHOPRT	0x00000020
152
#define TARGET_ECHOKE	0x00000001
153
#define TARGET_FLUSHO	0x00800000
154
#define TARGET_PENDIN	0x20000000
155
#define TARGET_IEXTEN	0x00000400
156

  
157
/* ioctls */
158

  
159
#define TARGET_FIOCLEX		TARGET_IO('f', 1)
160
#define TARGET_FIONCLEX	        TARGET_IO('f', 2)
161
#define TARGET_FIOASYNC	        TARGET_IOW('f', 125, int)
162
#define TARGET_FIONBIO		TARGET_IOW('f', 126, int)
163
#define TARGET_FIONREAD	        TARGET_IOR('f', 127, int)
164
#define TARGET_TIOCINQ		TARGET_FIONREAD
165
//#define TARGET_FIOQSIZE	        TARGET_IOR('f', 128, loff_t)
166

  
167
#define TARGET_TCGETS		TARGET_IOR('t', 19, struct target_termios)
168
#define TARGET_TCSETS		TARGET_IOW('t', 20, struct target_termios)
169
#define TARGET_TCSETSW		TARGET_IOW('t', 21, struct target_termios)
170
#define TARGET_TCSETSF		TARGET_IOW('t', 22, struct target_termios)
171

  
172
#define TARGET_TCGETA		TARGET_IOR('t', 23, struct target_termio)
173
#define TARGET_TCSETA		TARGET_IOW('t', 24, struct target_termio)
174
#define TARGET_TCSETAW		TARGET_IOW('t', 25, struct target_termio)
175
#define TARGET_TCSETAF		TARGET_IOW('t', 28, struct target_termio)
176

  
177
#define TARGET_TCSBRK		TARGET_IO('t', 29)
178
#define TARGET_TCXONC		TARGET_IO('t', 30)
179
#define TARGET_TCFLSH		TARGET_IO('t', 31)
180

  
181
#define TARGET_TIOCSWINSZ	TARGET_IOW('t', 103, struct target_winsize)
182
#define TARGET_TIOCGWINSZ	TARGET_IOR('t', 104, struct target_winsize)
183
#define	TARGET_TIOCSTART	TARGET_IO('t', 110)		/* start output, like ^Q */
184
#define	TARGET_TIOCSTOP	TARGET_IO('t', 111)		/* stop output, like ^S */
185
#define TARGET_TIOCOUTQ        TARGET_IOR('t', 115, int)     /* output queue size */
186

  
187
#define TARGET_TIOCGLTC	TARGET_IOR('t', 116, struct target_ltchars)
188
#define TARGET_TIOCSLTC	TARGET_IOW('t', 117, struct target_ltchars)
189
#define TARGET_TIOCSPGRP	TARGET_IOW('t', 118, int)
190
#define TARGET_TIOCGPGRP	TARGET_IOR('t', 119, int)
191

  
192
#define TARGET_TIOCEXCL	0x540C
193
#define TARGET_TIOCNXCL	0x540D
194
#define TARGET_TIOCSCTTY	0x540E
195

  
196
#define TARGET_TIOCSTI		0x5412
197
#define TARGET_TIOCMGET	0x5415
198
#define TARGET_TIOCMBIS	0x5416
199
#define TARGET_TIOCMBIC	0x5417
200
#define TARGET_TIOCMSET	0x5418
201

  
202
#define TARGET_TIOCGSOFTCAR	0x5419
203
#define TARGET_TIOCSSOFTCAR	0x541A
204
#define TARGET_TIOCLINUX	0x541C
205
#define TARGET_TIOCCONS	0x541D
206
#define TARGET_TIOCGSERIAL	0x541E
207
#define TARGET_TIOCSSERIAL	0x541F
208
#define TARGET_TIOCPKT		0x5420
209

  
210
#define TARGET_TIOCNOTTY	0x5422
211
#define TARGET_TIOCSETD	0x5423
212
#define TARGET_TIOCGETD	0x5424
213
#define TARGET_TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
214
#define TARGET_TIOCTTYGSTRUCT	0x5426  /* For debugging only */
215
#define TARGET_TIOCSBRK	0x5427  /* BSD compatibility */
216
#define TARGET_TIOCCBRK	0x5428  /* BSD compatibility */
217
#define TARGET_TIOCGSID	0x5429  /* Return the session ID of FD */
218
#define TARGET_TIOCGPTN	TARGET_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
219
#define TARGET_TIOCSPTLCK	TARGET_IOW('T',0x31, int)  /* Lock/unlock Pty */
220

  
221
#define TARGET_TIOCSERCONFIG	0x5453
222
#define TARGET_TIOCSERGWILD	0x5454
223
#define TARGET_TIOCSERSWILD	0x5455
224
#define TARGET_TIOCGLCKTRMIOS	0x5456
225
#define TARGET_TIOCSLCKTRMIOS	0x5457
226
#define TARGET_TIOCSERGSTRUCT	0x5458 /* For debugging only */
227
#define TARGET_TIOCSERGETLSR   0x5459 /* Get line status register */
228
  /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
229
# define TARGET_TIOCSER_TEMT    0x01	/* Transmitter physically empty */
230
#define TARGET_TIOCSERGETMULTI 0x545A /* Get multiport config  */
231
#define TARGET_TIOCSERSETMULTI 0x545B /* Set multiport config */
232

  
233
#define TARGET_TIOCMIWAIT	0x545C	/* wait for a change on serial input line(s) */
234
#define TARGET_TIOCGICOUNT	0x545D	/* read serial port inline interrupt counts */
235

  
b/linux-user/sparc/termbits.h
1
/* from asm/termbits.h */
2

  
3
#define TARGET_NCCS 19
4

  
5
struct target_termios {
6
    unsigned int c_iflag;               /* input mode flags */
7
    unsigned int c_oflag;               /* output mode flags */
8
    unsigned int c_cflag;               /* control mode flags */
9
    unsigned int c_lflag;               /* local mode flags */
10
    unsigned char c_line;                    /* line discipline */
11
    unsigned char c_cc[TARGET_NCCS];                /* control characters */
12
};
13

  
14
/* c_cc characters */
15
#define TARGET_VINTR    0
16
#define TARGET_VQUIT    1
17
#define TARGET_VERASE   2
18
#define TARGET_VKILL    3
19
#define TARGET_VEOF     4
20
#define TARGET_VEOL     5
21
#define TARGET_VEOL2    6
22
#define TARGET_VSWTC    7
23
#define TARGET_VSTART   8
24
#define TARGET_VSTOP    9
25

  
26
#define TARGET_VSUSP    10
27
#define TARGET_VDSUSP   11  /* SunOS POSIX nicety I do believe... */
28
#define TARGET_VREPRINT 12
29
#define TARGET_VDISCARD 13
30
#define TARGET_VWERASE  14
31
#define TARGET_VLNEXT   15
32

  
33
/* Kernel keeps vmin/vtime separated, user apps assume vmin/vtime is
34
 * shared with eof/eol
35
 */
36
#define TARGET_VMIN     TARGET_VEOF
37
#define TARGET_VTIME    TARGET_VEOL
38

  
39
/* c_iflag bits */
40
#define TARGET_IGNBRK	0x00000001
41
#define TARGET_BRKINT	0x00000002
42
#define TARGET_IGNPAR	0x00000004
43
#define TARGET_PARMRK	0x00000008
44
#define TARGET_INPCK	0x00000010
45
#define TARGET_ISTRIP	0x00000020
46
#define TARGET_INLCR	0x00000040
47
#define TARGET_IGNCR	0x00000080
48
#define TARGET_ICRNL	0x00000100
49
#define TARGET_IUCLC	0x00000200
50
#define TARGET_IXON	0x00000400
51
#define TARGET_IXANY	0x00000800
52
#define TARGET_IXOFF	0x00001000
53
#define TARGET_IMAXBEL	0x00002000
54

  
55
/* c_oflag bits */
56
#define TARGET_OPOST	0x00000001
57
#define TARGET_OLCUC	0x00000002
58
#define TARGET_ONLCR	0x00000004
59
#define TARGET_OCRNL	0x00000008
60
#define TARGET_ONOCR	0x00000010
61
#define TARGET_ONLRET	0x00000020
62
#define TARGET_OFILL	0x00000040
63
#define TARGET_OFDEL	0x00000080
64
#define TARGET_NLDLY	0x00000100
65
#define   TARGET_NL0	0x00000000
66
#define   TARGET_NL1	0x00000100
67
#define TARGET_CRDLY	0x00000600
68
#define   TARGET_CR0	0x00000000
69
#define   TARGET_CR1	0x00000200
70
#define   TARGET_CR2	0x00000400
71
#define   TARGET_CR3	0x00000600
72
#define TARGET_TABDLY	0x00001800
73
#define   TARGET_TAB0	0x00000000
74
#define   TARGET_TAB1	0x00000800
75
#define   TARGET_TAB2	0x00001000
76
#define   TARGET_TAB3	0x00001800
77
#define   TARGET_XTABS	0x00001800
78
#define TARGET_BSDLY	0x00002000
79
#define   TARGET_BS0	0x00000000
80
#define   TARGET_BS1	0x00002000
81
#define TARGET_VTDLY	0x00004000
82
#define   TARGET_VT0	0x00000000
83
#define   TARGET_VT1	0x00004000
84
#define TARGET_FFDLY	0x00008000
85
#define   TARGET_FF0	0x00000000
86
#define   TARGET_FF1	0x00008000
87
#define TARGET_PAGEOUT 0x00010000  /* SUNOS specific */
88
#define TARGET_WRAP    0x00020000  /* SUNOS specific */
89

  
90
/* c_cflag bit meaning */
91
#define TARGET_CBAUD	  0x0000100f
92
#define  TARGET_B0	  0x00000000   /* hang up */
93
#define  TARGET_B50	  0x00000001
94
#define  TARGET_B75	  0x00000002
95
#define  TARGET_B110	  0x00000003
96
#define  TARGET_B134	  0x00000004
97
#define  TARGET_B150	  0x00000005
98
#define  TARGET_B200	  0x00000006
99
#define  TARGET_B300	  0x00000007
100
#define  TARGET_B600	  0x00000008
101
#define  TARGET_B1200	  0x00000009
102
#define  TARGET_B1800	  0x0000000a
103
#define  TARGET_B2400	  0x0000000b
104
#define  TARGET_B4800	  0x0000000c
105
#define  TARGET_B9600	  0x0000000d
106
#define  TARGET_B19200	  0x0000000e
107
#define  TARGET_B38400	  0x0000000f
108
#define TARGET_EXTA      B19200
109
#define TARGET_EXTB      B38400
110
#define  TARGET_CSIZE    0x00000030
111
#define   TARGET_CS5	  0x00000000
112
#define   TARGET_CS6	  0x00000010
113
#define   TARGET_CS7	  0x00000020
114
#define   TARGET_CS8	  0x00000030
115
#define TARGET_CSTOPB	  0x00000040
116
#define TARGET_CREAD	  0x00000080
117
#define TARGET_PARENB	  0x00000100
118
#define TARGET_PARODD	  0x00000200
119
#define TARGET_HUPCL	  0x00000400
120
#define TARGET_CLOCAL	  0x00000800
121
#define TARGET_CBAUDEX   0x00001000
122
/* We'll never see these speeds with the Zilogs, but for completeness... */
123
#define  TARGET_B57600   0x00001001
124
#define  TARGET_B115200  0x00001002
125
#define  TARGET_B230400  0x00001003
126
#define  TARGET_B460800  0x00001004
127
/* This is what we can do with the Zilogs. */
128
#define  TARGET_B76800   0x00001005
129
/* This is what we can do with the SAB82532. */
130
#define  TARGET_B153600  0x00001006
131
#define  TARGET_B307200  0x00001007
132
#define  TARGET_B614400  0x00001008
133
#define  TARGET_B921600  0x00001009
134
/* And these are the rest... */
135
#define  TARGET_B500000  0x0000100a
136
#define  TARGET_B576000  0x0000100b
137
#define TARGET_B1000000  0x0000100c
138
#define TARGET_B1152000  0x0000100d
139
#define TARGET_B1500000  0x0000100e
140
#define TARGET_B2000000  0x0000100f
141
/* These have totally bogus values and nobody uses them
142
   so far. Later on we'd have to use say 0x10000x and
143
   adjust CBAUD constant and drivers accordingly.
144
#define B2500000  0x00001010
145
#define B3000000  0x00001011
146
#define B3500000  0x00001012
147
#define B4000000  0x00001013  */
148
#define TARGET_CIBAUD	  0x100f0000  /* input baud rate (not used) */
149
#define TARGET_CMSPAR	  0x40000000  /* mark or space (stick) parity */
150
#define TARGET_CRTSCTS	  0x80000000  /* flow control */
151

  
152
/* c_lflag bits */
153
#define TARGET_ISIG	0x00000001
154
#define TARGET_ICANON	0x00000002
155
#define TARGET_XCASE	0x00000004
156
#define TARGET_ECHO	0x00000008
157
#define TARGET_ECHOE	0x00000010
158
#define TARGET_ECHOK	0x00000020
159
#define TARGET_ECHONL	0x00000040
160
#define TARGET_NOFLSH	0x00000080
161
#define TARGET_TOSTOP	0x00000100
162
#define TARGET_ECHOCTL	0x00000200
163
#define TARGET_ECHOPRT	0x00000400
164
#define TARGET_ECHOKE	0x00000800
165
#define TARGET_DEFECHO  0x00001000  /* SUNOS thing, what is it? */
166
#define TARGET_FLUSHO	0x00002000
167
#define TARGET_PENDIN	0x00004000
168
#define TARGET_IEXTEN	0x00008000
169

  
170
/* ioctls */
171

  
172
/* Big T */
173
#define TARGET_TCGETA		TARGET_IOR('T', 1, struct target_termio)
174
#define TARGET_TCSETA		TARGET_IOW('T', 2, struct target_termio)
175
#define TARGET_TCSETAW		TARGET_IOW('T', 3, struct target_termio)
176
#define TARGET_TCSETAF		TARGET_IOW('T', 4, struct target_termio)
177
#define TARGET_TCSBRK		TARGET_IO('T', 5)
178
#define TARGET_TCXONC		TARGET_IO('T', 6)
179
#define TARGET_TCFLSH		TARGET_IO('T', 7)
180
#define TARGET_TCGETS		TARGET_IOR('T', 8, struct target_termios)
181
#define TARGET_TCSETS		TARGET_IOW('T', 9, struct target_termios)
182
#define TARGET_TCSETSW		TARGET_IOW('T', 10, struct target_termios)
183
#define TARGET_TCSETSF		TARGET_IOW('T', 11, struct target_termios)
184

  
185
/* Note that all the ioctls that are not available in Linux have a 
186
 * double underscore on the front to: a) avoid some programs to
187
 * thing we support some ioctls under Linux (autoconfiguration stuff)
188
 */
189
/* Little t */
190
#define TARGET_TIOCGETD	TARGET_IOR('t', 0, int)
191
#define TARGET_TIOCSETD	TARGET_IOW('t', 1, int)
192
//#define __TIOCHPCL        _IO('t', 2) /* SunOS Specific */
193
//#define __TIOCMODG        _IOR('t', 3, int) /* SunOS Specific */
194
//#define __TIOCMODS        _IOW('t', 4, int) /* SunOS Specific */
195
//#define __TIOCGETP        _IOR('t', 8, struct sgttyb) /* SunOS Specific */
196
//#define __TIOCSETP        _IOW('t', 9, struct sgttyb) /* SunOS Specific */
197
//#define __TIOCSETN        _IOW('t', 10, struct sgttyb) /* SunOS Specific */
198
#define TARGET_TIOCEXCL	TARGET_IO('t', 13)
199
#define TARGET_TIOCNXCL	TARGET_IO('t', 14)
200
//#define __TIOCFLUSH       _IOW('t', 16, int) /* SunOS Specific */
201
//#define __TIOCSETC        _IOW('t', 17, struct tchars) /* SunOS Specific */
202
//#define __TIOCGETC        _IOR('t', 18, struct tchars) /* SunOS Specific */
203
//#define __TIOCTCNTL       _IOW('t', 32, int) /* SunOS Specific */
204
//#define __TIOCSIGNAL      _IOW('t', 33, int) /* SunOS Specific */
205
//#define __TIOCSETX        _IOW('t', 34, int) /* SunOS Specific */
206
//#define __TIOCGETX        _IOR('t', 35, int) /* SunOS Specific */
207
#define TARGET_TIOCCONS	TARGET_IO('t', 36)
208
//#define __TIOCSSIZE     _IOW('t', 37, struct sunos_ttysize) /* SunOS Specific */
209
//#define __TIOCGSIZE     _IOR('t', 38, struct sunos_ttysize) /* SunOS Specific */
210
#define TARGET_TIOCGSOFTCAR	TARGET_IOR('t', 100, int)
211
#define TARGET_TIOCSSOFTCAR	TARGET_IOW('t', 101, int)
212
//#define __TIOCUCNTL       _IOW('t', 102, int) /* SunOS Specific */
213
#define TARGET_TIOCSWINSZ	TARGET_IOW('t', 103, struct winsize)
214
#define TARGET_TIOCGWINSZ	TARGET_IOR('t', 104, struct winsize)
215
//#define __TIOCREMOTE      _IOW('t', 105, int) /* SunOS Specific */
216
#define TARGET_TIOCMGET	TARGET_IOR('t', 106, int)
217
#define TARGET_TIOCMBIC	TARGET_IOW('t', 107, int)
218
#define TARGET_TIOCMBIS	TARGET_IOW('t', 108, int)
219
#define TARGET_TIOCMSET	TARGET_IOW('t', 109, int)
220
#define TARGET_TIOCSTART       TARGET_IO('t', 110)
221
#define TARGET_TIOCSTOP        TARGET_IO('t', 111)
222
#define TARGET_TIOCPKT		TARGET_IOW('t', 112, int)
223
#define TARGET_TIOCNOTTY	TARGET_IO('t', 113)
224
#define TARGET_TIOCSTI		TARGET_IOW('t', 114, char)
225
#define TARGET_TIOCOUTQ	TARGET_IOR('t', 115, int)
226
//#define __TIOCGLTC        _IOR('t', 116, struct ltchars) /* SunOS Specific */
227
//#define __TIOCSLTC        _IOW('t', 117, struct ltchars) /* SunOS Specific */
228
/* 118 is the non-posix setpgrp tty ioctl */
229
/* 119 is the non-posix getpgrp tty ioctl */
230
//#define __TIOCCDTR        TARGET_IO('t', 120) /* SunOS Specific */
231
//#define __TIOCSDTR        TARGET_IO('t', 121) /* SunOS Specific */
232
#define TARGET_TIOCCBRK        TARGET_IO('t', 122)
233
#define TARGET_TIOCSBRK        TARGET_IO('t', 123)
234
//#define __TIOCLGET        TARGET_IOW('t', 124, int) /* SunOS Specific */
235
//#define __TIOCLSET        TARGET_IOW('t', 125, int) /* SunOS Specific */
236
//#define __TIOCLBIC        TARGET_IOW('t', 126, int) /* SunOS Specific */
237
//#define __TIOCLBIS        TARGET_IOW('t', 127, int) /* SunOS Specific */
238
//#define __TIOCISPACE      TARGET_IOR('t', 128, int) /* SunOS Specific */
239
//#define __TIOCISIZE       TARGET_IOR('t', 129, int) /* SunOS Specific */
240
#define TARGET_TIOCSPGRP	TARGET_IOW('t', 130, int)
241
#define TARGET_TIOCGPGRP	TARGET_IOR('t', 131, int)
242
#define TARGET_TIOCSCTTY	TARGET_IO('t', 132)
243
#define TARGET_TIOCGSID	TARGET_IOR('t', 133, int)
244
/* Get minor device of a pty master's FD -- Solaris equiv is ISPTM */
245
#define TARGET_TIOCGPTN	TARGET_IOR('t', 134, unsigned int) /* Get Pty Number */
246
#define TARGET_TIOCSPTLCK	TARGET_IOW('t', 135, int) /* Lock/unlock PTY */
247

  
248
/* Little f */
249
#define TARGET_FIOCLEX		TARGET_IO('f', 1)
250
#define TARGET_FIONCLEX	TARGET_IO('f', 2)
251
#define TARGET_FIOASYNC	TARGET_IOW('f', 125, int)
252
#define TARGET_FIONBIO		TARGET_IOW('f', 126, int)
253
#define TARGET_FIONREAD	TARGET_IOR('f', 127, int)
254
#define TARGET_TIOCINQ		TARGET_FIONREAD
255

  
256
/* SCARY Rutgers local SunOS kernel hackery, perhaps I will support it
257
 * someday.  This is completely bogus, I know...
258
 */
259
//#define __TCGETSTAT       TARGET_IO('T', 200) /* Rutgers specific */
260
//#define __TCSETSTAT       TARGET_IO('T', 201) /* Rutgers specific */
261

  
262
/* Linux specific, no SunOS equivalent. */
263
#define TARGET_TIOCLINUX	0x541C
264
#define TARGET_TIOCGSERIAL	0x541E
265
#define TARGET_TIOCSSERIAL	0x541F
266
#define TARGET_TCSBRKP		0x5425
267
#define TARGET_TIOCTTYGSTRUCT	0x5426
268
#define TARGET_TIOCSERCONFIG	0x5453
269
#define TARGET_TIOCSERGWILD	0x5454
270
#define TARGET_TIOCSERSWILD	0x5455
271
#define TARGET_TIOCGLCKTRMIOS	0x5456
272
#define TARGET_TIOCSLCKTRMIOS	0x5457
273
#define TARGET_TIOCSERGSTRUCT	0x5458 /* For debugging only */
274
#define TARGET_TIOCSERGETLSR   0x5459 /* Get line status register */
275
#define TARGET_TIOCSERGETMULTI 0x545A /* Get multiport config  */
276
#define TARGET_TIOCSERSETMULTI 0x545B /* Set multiport config */
277
#define TARGET_TIOCMIWAIT	0x545C /* Wait input */
278
#define TARGET_TIOCGICOUNT	0x545D /* Read serial port inline interrupt counts */
279

  
b/linux-user/syscall_defs.h
664 664
#define TARGET_HDIO_SET_PIO_MODE      0x0327  /* reconfig interface to new speed */
665 665

  
666 666

  
667
#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) || defined(TARGET_PPC)
668

  
669
/* 0x54 is just a magic number to make these relatively unique ('T') */
670

  
671
#define TARGET_TCGETS		0x5401
672
#define TARGET_TCSETS		0x5402
673
#define TARGET_TCSETSW		0x5403
674
#define TARGET_TCSETSF		0x5404
675
#define TARGET_TCGETA		0x5405
676
#define TARGET_TCSETA		0x5406
677
#define TARGET_TCSETAW		0x5407
678
#define TARGET_TCSETAF		0x5408
679
#define TARGET_TCSBRK		0x5409
680
#define TARGET_TCXONC		0x540A
681
#define TARGET_TCFLSH		0x540B
682
#define TARGET_TIOCEXCL	0x540C
683
#define TARGET_TIOCNXCL	0x540D
684
#define TARGET_TIOCSCTTY	0x540E
685
#define TARGET_TIOCGPGRP	0x540F
686
#define TARGET_TIOCSPGRP	0x5410
687
#define TARGET_TIOCOUTQ	0x5411
688
#define TARGET_TIOCSTI		0x5412
689
#define TARGET_TIOCGWINSZ	0x5413
690
#define TARGET_TIOCSWINSZ	0x5414
691
#define TARGET_TIOCMGET	0x5415
692
#define TARGET_TIOCMBIS	0x5416
693
#define TARGET_TIOCMBIC	0x5417
694
#define TARGET_TIOCMSET	0x5418
695
#define TARGET_TIOCGSOFTCAR	0x5419
696
#define TARGET_TIOCSSOFTCAR	0x541A
697
#define TARGET_FIONREAD	0x541B
698
#define TARGET_TIOCINQ		FIONREAD
699
#define TARGET_TIOCLINUX	0x541C
700
#define TARGET_TIOCCONS	0x541D
701
#define TARGET_TIOCGSERIAL	0x541E
702
#define TARGET_TIOCSSERIAL	0x541F
703
#define TARGET_TIOCPKT		0x5420
704
#define TARGET_FIONBIO		0x5421
705
#define TARGET_TIOCNOTTY	0x5422
706
#define TARGET_TIOCSETD	0x5423
707
#define TARGET_TIOCGETD	0x5424
708
#define TARGET_TCSBRKP		0x5425	/* Needed for POSIX tcsendbreak() */
709
#define TARGET_TIOCTTYGSTRUCT	0x5426  /* For debugging only */
710
#define TARGET_TIOCSBRK	0x5427  /* BSD compatibility */
711
#define TARGET_TIOCCBRK	0x5428  /* BSD compatibility */
712
#define TARGET_TIOCGSID	0x5429  /* Return the session ID of FD */
713
#define TARGET_TIOCGPTN	TARGET_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
714
#define TARGET_TIOCSPTLCK	TARGET_IOW('T',0x31, int)  /* Lock/unlock Pty */
715

  
716
#define TARGET_FIONCLEX	0x5450  /* these numbers need to be adjusted. */
717
#define TARGET_FIOCLEX		0x5451
718
#define TARGET_FIOASYNC	0x5452
719
#define TARGET_TIOCSERCONFIG	0x5453
720
#define TARGET_TIOCSERGWILD	0x5454
721
#define TARGET_TIOCSERSWILD	0x5455
722
#define TARGET_TIOCGLCKTRMIOS	0x5456
723
#define TARGET_TIOCSLCKTRMIOS	0x5457
724
#define TARGET_TIOCSERGSTRUCT	0x5458 /* For debugging only */
725
#define TARGET_TIOCSERGETLSR   0x5459 /* Get line status register */
726
#define TARGET_TIOCSERGETMULTI 0x545A /* Get multiport config  */
727
#define TARGET_TIOCSERSETMULTI 0x545B /* Set multiport config */
728

  
729
#define TARGET_TIOCMIWAIT	0x545C	/* wait for a change on serial input line(s) */
730
#define TARGET_TIOCGICOUNT	0x545D	/* read serial port inline interrupt counts */
731
#define TARGET_TIOCGHAYESESP   0x545E  /* Get Hayes ESP configuration */
732
#define TARGET_TIOCSHAYESESP   0x545F  /* Set Hayes ESP configuration */
733

  
734
/* Used for packet mode */
735
#define TARGET_TIOCPKT_DATA		 0
736
#define TARGET_TIOCPKT_FLUSHREAD	 1
737
#define TARGET_TIOCPKT_FLUSHWRITE	 2
738
#define TARGET_TIOCPKT_STOP		 4
739
#define TARGET_TIOCPKT_START		 8
740
#define TARGET_TIOCPKT_NOSTOP		16
741
#define TARGET_TIOCPKT_DOSTOP		32
742

  
743
#define TARGET_TIOCSER_TEMT    0x01	/* Transmitter physically empty */
744

  
745 667
/* from asm/termbits.h */
746 668

  
747
#define TARGET_NCCS 19
669
#define TARGET_NCC 8
670
struct target_termio {
671
	unsigned short c_iflag;		/* input mode flags */
672
	unsigned short c_oflag;		/* output mode flags */
673
	unsigned short c_cflag;		/* control mode flags */
674
	unsigned short c_lflag;		/* local mode flags */
675
	unsigned char c_line;		/* line discipline */
676
	unsigned char c_cc[TARGET_NCC];	/* control characters */
677
};
748 678

  
749
struct target_termios {
750
    unsigned int c_iflag;               /* input mode flags */
751
    unsigned int c_oflag;               /* output mode flags */
752
    unsigned int c_cflag;               /* control mode flags */
753
    unsigned int c_lflag;               /* local mode flags */
754
    unsigned char c_line;                    /* line discipline */
755
    unsigned char c_cc[TARGET_NCCS];                /* control characters */
679
struct target_winsize {
680
	unsigned short ws_row;
681
	unsigned short ws_col;
682
	unsigned short ws_xpixel;
683
	unsigned short ws_ypixel;
756 684
};
757 685

  
758
/* c_iflag bits */
759
#define TARGET_IGNBRK  0000001
760
#define TARGET_BRKINT  0000002
761
#define TARGET_IGNPAR  0000004
762
#define TARGET_PARMRK  0000010
763
#define TARGET_INPCK   0000020
764
#define TARGET_ISTRIP  0000040
765
#define TARGET_INLCR   0000100
766
#define TARGET_IGNCR   0000200
767
#define TARGET_ICRNL   0000400
768
#define TARGET_IUCLC   0001000
769
#define TARGET_IXON    0002000
770
#define TARGET_IXANY   0004000
771
#define TARGET_IXOFF   0010000
772
#define TARGET_IMAXBEL 0020000
773

  
774
/* c_oflag bits */
775
#define TARGET_OPOST   0000001
776
#define TARGET_OLCUC   0000002
777
#define TARGET_ONLCR   0000004
778
#define TARGET_OCRNL   0000010
779
#define TARGET_ONOCR   0000020
780
#define TARGET_ONLRET  0000040
781
#define TARGET_OFILL   0000100
782
#define TARGET_OFDEL   0000200
783
#define TARGET_NLDLY   0000400
784
#define   TARGET_NL0   0000000
785
#define   TARGET_NL1   0000400
786
#define TARGET_CRDLY   0003000
787
#define   TARGET_CR0   0000000
788
#define   TARGET_CR1   0001000
789
#define   TARGET_CR2   0002000
790
#define   TARGET_CR3   0003000
791
#define TARGET_TABDLY  0014000
792
#define   TARGET_TAB0  0000000
793
#define   TARGET_TAB1  0004000
794
#define   TARGET_TAB2  0010000
795
#define   TARGET_TAB3  0014000
796
#define   TARGET_XTABS 0014000
797
#define TARGET_BSDLY   0020000
798
#define   TARGET_BS0   0000000
799
#define   TARGET_BS1   0020000
800
#define TARGET_VTDLY   0040000
801
#define   TARGET_VT0   0000000
802
#define   TARGET_VT1   0040000
803
#define TARGET_FFDLY   0100000
804
#define   TARGET_FF0   0000000
805
#define   TARGET_FF1   0100000
806

  
807
/* c_cflag bit meaning */
808
#define TARGET_CBAUD   0010017
809
#define  TARGET_B0     0000000         /* hang up */
810
#define  TARGET_B50    0000001
811
#define  TARGET_B75    0000002
812
#define  TARGET_B110   0000003
813
#define  TARGET_B134   0000004
814
#define  TARGET_B150   0000005
815
#define  TARGET_B200   0000006
816
#define  TARGET_B300   0000007
817
#define  TARGET_B600   0000010
818
#define  TARGET_B1200  0000011
819
#define  TARGET_B1800  0000012
820
#define  TARGET_B2400  0000013
821
#define  TARGET_B4800  0000014
822
#define  TARGET_B9600  0000015
823
#define  TARGET_B19200 0000016
824
#define  TARGET_B38400 0000017
825
#define TARGET_EXTA B19200
826
#define TARGET_EXTB B38400
827
#define TARGET_CSIZE   0000060
828
#define   TARGET_CS5   0000000
829
#define   TARGET_CS6   0000020
830
#define   TARGET_CS7   0000040
831
#define   TARGET_CS8   0000060
832
#define TARGET_CSTOPB  0000100
833
#define TARGET_CREAD   0000200
834
#define TARGET_PARENB  0000400
835
#define TARGET_PARODD  0001000
836
#define TARGET_HUPCL   0002000
837
#define TARGET_CLOCAL  0004000
838
#define TARGET_CBAUDEX 0010000
839
#define  TARGET_B57600  0010001
840
#define  TARGET_B115200 0010002
841
#define  TARGET_B230400 0010003
842
#define  TARGET_B460800 0010004
843
#define TARGET_CIBAUD    002003600000  /* input baud rate (not used) */
844
#define TARGET_CRTSCTS   020000000000          /* flow control */
845

  
846
/* c_lflag bits */
847
#define TARGET_ISIG    0000001
848
#define TARGET_ICANON  0000002
849
#define TARGET_XCASE   0000004
850
#define TARGET_ECHO    0000010
851
#define TARGET_ECHOE   0000020
852
#define TARGET_ECHOK   0000040
853
#define TARGET_ECHONL  0000100
854
#define TARGET_NOFLSH  0000200
855
#define TARGET_TOSTOP  0000400
856
#define TARGET_ECHOCTL 0001000
857
#define TARGET_ECHOPRT 0002000
858
#define TARGET_ECHOKE  0004000
859
#define TARGET_FLUSHO  0010000
860
#define TARGET_PENDIN  0040000
861
#define TARGET_IEXTEN  0100000
862

  
863
/* c_cc character offsets */
864
#define TARGET_VINTR	0
865
#define TARGET_VQUIT	1
866
#define TARGET_VERASE	2
867
#define TARGET_VKILL	3
868
#define TARGET_VEOF	4
869
#define TARGET_VTIME	5
870
#define TARGET_VMIN	6
871
#define TARGET_VSWTC	7
872
#define TARGET_VSTART	8
873
#define TARGET_VSTOP	9
874
#define TARGET_VSUSP	10
875
#define TARGET_VEOL	11
876
#define TARGET_VREPRINT	12
877
#define TARGET_VDISCARD	13
878
#define TARGET_VWERASE	14
879
#define TARGET_VLNEXT	15
880
#define TARGET_VEOL2	16
686
#include "termbits.h"
881 687

  
882 688
#define TARGET_MAP_SHARED	0x01		/* Share changes */
883 689
#define TARGET_MAP_PRIVATE	0x02		/* Changes are private */
......
891 697
#define TARGET_MAP_LOCKED	0x2000		/* pages are locked */
892 698
#define TARGET_MAP_NORESERVE	0x4000		/* don't check for reservations */
893 699

  
894
#endif /* defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) || defined(TARGET_PPC) */
895

  
896
#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC)
700
#if defined(TARGET_I386) || defined(TARGET_ARM)
897 701
struct target_stat {
898 702
	unsigned short st_dev;
899 703
	unsigned short __pad1;
......
954 758
	unsigned long long	st_ino;
955 759
} __attribute__((packed));
956 760

  
761
#elif defined(TARGET_SPARC)
762

  
763
struct target_stat {
764
	unsigned short	st_dev;
765
	target_ulong	st_ino;
766
	unsigned short	st_mode;
767
	short		st_nlink;
768
	unsigned short	st_uid;
769
	unsigned short	st_gid;
770
	unsigned short	st_rdev;
771
	target_long	st_size;
772
	target_long	target_st_atime;
773
	target_ulong	__unused1;
774
	target_long	target_st_mtime;
775
	target_ulong	__unused2;
776
	target_long	target_st_ctime;
777
	target_ulong	__unused3;
778
	target_long	st_blksize;
779
	target_long	st_blocks;
780
	target_ulong	__unused4[2];
781
};
782

  
783
struct target_stat64 {
784
	unsigned char	__pad0[6];
785
	unsigned short	st_dev;
786

  
787
	uint64_t st_ino;
788

  
789
	unsigned int	st_mode;
790
	unsigned int	st_nlink;
791

  
792
	unsigned int	st_uid;
793
	unsigned int	st_gid;
794

  
795
	unsigned char	__pad2[6];
796
	unsigned short	st_rdev;
797

  
798
	unsigned char	__pad3[8];
799

  
800
        int64_t	st_size;
801
	unsigned int	st_blksize;
802

  
803
	unsigned char	__pad4[8];
804
	unsigned int	st_blocks;
805

  
806
	unsigned int	target_st_atime;
807
	unsigned int	__unused1;
808

  
809
	unsigned int	target_st_mtime;
810
	unsigned int	__unused2;
811

  
812
	unsigned int	target_st_ctime;
813
	unsigned int	__unused3;
814

  
815
	unsigned int	__unused4;
816
	unsigned int	__unused5;
817
};
818

  
957 819
#elif defined(TARGET_PPC)
958 820

  
959 821
struct target_stat {
......
979 841

  
980 842
struct target_stat64 {
981 843
	unsigned long long st_dev;
982

  
983 844
        unsigned long long st_ino;
984

  
985
	unsigned int	st_mode;
986
	unsigned int	st_nlink;
987

  
845
	unsigned int st_mode;
846
	unsigned int st_nlink;
988 847
	unsigned int st_uid;
989 848
	unsigned int st_gid;
990

  
991
	unsigned long long	st_rdev;
992
	unsigned short int __pad2;
993

  
994
	long long	st_size;
849
	unsigned long long st_rdev;
850
	long long pad0;
851
	long long st_size;
995 852
	target_ulong	st_blksize;
996

  
853
	target_ulong	pad1;
997 854
	long long	st_blocks;	/* Number 512-byte blocks allocated. */
998

  
999 855
	target_ulong	target_st_atime;
1000 856
        target_ulong    target_st_atime_nsec;
1001

  
1002 857
	target_ulong	target_st_mtime;
1003 858
        target_ulong    target_st_mtime_nsec;
1004

  
1005 859
	target_ulong	target_st_ctime;
1006 860
        target_ulong    target_st_ctime_nsec;
1007

  
1008 861
        target_ulong    __unused4;
1009 862
        target_ulong    __unused5;
1010 863
};

Also available in: Unified diff