Commit dccfec679e558b22b4f0e5970c951e99df668ddf

Authored by aurel32
1 parent c2b48b69

target-alpha: fix termbits and target IOC macros

This patch fixes the two following problems for Alpha linux-user:
   - termbits.h is incorrectly using host IOC macros and structures
   - IOC bitfields sizes are incorrectly set

This patch corrects the ioctl TCGETS done by isatty function call
on Alpha (when running SPEC crafty for instance).

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5704 c046a42c-6fe2-441c-8c8c-71466251a162
linux-user/alpha/termbits.h
@@ -157,44 +157,44 @@ struct target_termios { @@ -157,44 +157,44 @@ struct target_termios {
157 #define TARGET_PENDIN 0x20000000 157 #define TARGET_PENDIN 0x20000000
158 #define TARGET_IEXTEN 0x00000400 158 #define TARGET_IEXTEN 0x00000400
159 159
160 -#define TARGET_FIOCLEX _IO('f', 1)  
161 -#define TARGET_FIONCLEX _IO('f', 2)  
162 -#define TARGET_FIOASYNC _IOW('f', 125, int)  
163 -#define TARGET_FIONBIO _IOW('f', 126, int)  
164 -#define TARGET_FIONREAD _IOR('f', 127, int) 160 +#define TARGET_FIOCLEX TARGET_IO('f', 1)
  161 +#define TARGET_FIONCLEX TARGET_IO('f', 2)
  162 +#define TARGET_FIOASYNC TARGET_IOW('f', 125, int)
  163 +#define TARGET_FIONBIO TARGET_IOW('f', 126, int)
  164 +#define TARGET_FIONREAD TARGET_IOR('f', 127, int)
165 #define TARGET_TIOCINQ FIONREAD 165 #define TARGET_TIOCINQ FIONREAD
166 -#define TARGET_FIOQSIZE _IOR('f', 128, loff_t) 166 +#define TARGET_FIOQSIZE TARGET_IOR('f', 128, loff_t)
167 167
168 -#define TARGET_TIOCGETP _IOR('t', 8, struct sgttyb)  
169 -#define TARGET_TIOCSETP _IOW('t', 9, struct sgttyb)  
170 -#define TARGET_TIOCSETN _IOW('t', 10, struct sgttyb) /* TIOCSETP wo flush */ 168 +#define TARGET_TIOCGETP TARGET_IOR('t', 8, struct target_sgttyb)
  169 +#define TARGET_TIOCSETP TARGET_IOW('t', 9, struct target_sgttyb)
  170 +#define TARGET_TIOCSETN TARGET_IOW('t', 10, struct target_sgttyb) /* TIOCSETP wo flush */
171 171
172 -#define TARGET_TIOCSETC _IOW('t', 17, struct tchars)  
173 -#define TARGET_TIOCGETC _IOR('t', 18, struct tchars)  
174 -#define TARGET_TCGETS _IOR('t', 19, struct termios)  
175 -#define TARGET_TCSETS _IOW('t', 20, struct termios)  
176 -#define TARGET_TCSETSW _IOW('t', 21, struct termios)  
177 -#define TARGET_TCSETSF _IOW('t', 22, struct termios) 172 +#define TARGET_TIOCSETC TARGET_IOW('t', 17, struct target_tchars)
  173 +#define TARGET_TIOCGETC TARGET_IOR('t', 18, struct target_tchars)
  174 +#define TARGET_TCGETS TARGET_IOR('t', 19, struct target_termios)
  175 +#define TARGET_TCSETS TARGET_IOW('t', 20, struct target_termios)
  176 +#define TARGET_TCSETSW TARGET_IOW('t', 21, struct target_termios)
  177 +#define TARGET_TCSETSF TARGET_IOW('t', 22, struct target_termios)
178 178
179 -#define TARGET_TCGETA _IOR('t', 23, struct termio)  
180 -#define TARGET_TCSETA _IOW('t', 24, struct termio)  
181 -#define TARGET_TCSETAW _IOW('t', 25, struct termio)  
182 -#define TARGET_TCSETAF _IOW('t', 28, struct termio) 179 +#define TARGET_TCGETA TARGET_IOR('t', 23, struct target_termio)
  180 +#define TARGET_TCSETA TARGET_IOW('t', 24, struct target_termio)
  181 +#define TARGET_TCSETAW TARGET_IOW('t', 25, struct target_termio)
  182 +#define TARGET_TCSETAF TARGET_IOW('t', 28, struct target_termio)
183 183
184 -#define TARGET_TCSBRK _IO('t', 29)  
185 -#define TARGET_TCXONC _IO('t', 30)  
186 -#define TARGET_TCFLSH _IO('t', 31) 184 +#define TARGET_TCSBRK TARGET_IO('t', 29)
  185 +#define TARGET_TCXONC TARGET_IO('t', 30)
  186 +#define TARGET_TCFLSH TARGET_IO('t', 31)
187 187
188 -#define TARGET_TIOCSWINSZ _IOW('t', 103, struct winsize)  
189 -#define TARGET_TIOCGWINSZ _IOR('t', 104, struct winsize)  
190 -#define TARGET_TIOCSTART _IO('t', 110) /* start output, like ^Q */  
191 -#define TARGET_TIOCSTOP _IO('t', 111) /* stop output, like ^S */  
192 -#define TARGET_TIOCOUTQ _IOR('t', 115, int) /* output queue size */ 188 +#define TARGET_TIOCSWINSZ TARGET_IOW('t', 103, struct target_winsize)
  189 +#define TARGET_TIOCGWINSZ TARGET_IOR('t', 104, struct target_winsize)
  190 +#define TARGET_TIOCSTART TARGET_IO('t', 110) /* start output, like ^Q */
  191 +#define TARGET_TIOCSTOP TARGET_IO('t', 111) /* stop output, like ^S */
  192 +#define TARGET_TIOCOUTQ TARGET_IOR('t', 115, int) /* output queue size */
193 193
194 -#define TARGET_TIOCGLTC _IOR('t', 116, struct ltchars)  
195 -#define TARGET_TIOCSLTC _IOW('t', 117, struct ltchars)  
196 -#define TARGET_TIOCSPGRP _IOW('t', 118, int)  
197 -#define TARGET_TIOCGPGRP _IOR('t', 119, int) 194 +#define TARGET_TIOCGLTC TARGET_IOR('t', 116, struct target_ltchars)
  195 +#define TARGET_TIOCSLTC TARGET_IOW('t', 117, struct target_ltchars)
  196 +#define TARGET_TIOCSPGRP TARGET_IOW('t', 118, int)
  197 +#define TARGET_TIOCGPGRP TARGET_IOR('t', 119, int)
198 198
199 #define TARGET_TIOCEXCL 0x540C 199 #define TARGET_TIOCEXCL 0x540C
200 #define TARGET_TIOCNXCL 0x540D 200 #define TARGET_TIOCNXCL 0x540D
@@ -243,8 +243,8 @@ struct target_termios { @@ -243,8 +243,8 @@ struct target_termios {
243 #define TARGET_TIOCSBRK 0x5427 /* BSD compatibility */ 243 #define TARGET_TIOCSBRK 0x5427 /* BSD compatibility */
244 #define TARGET_TIOCCBRK 0x5428 /* BSD compatibility */ 244 #define TARGET_TIOCCBRK 0x5428 /* BSD compatibility */
245 #define TARGET_TIOCGSID 0x5429 /* Return the session ID of FD */ 245 #define TARGET_TIOCGSID 0x5429 /* Return the session ID of FD */
246 -#define TARGET_TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */  
247 -#define TARGET_TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 246 +#define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
  247 +#define TARGET_TIOCSPTLCK TARGET_IOW('T',0x31, int) /* Lock/unlock Pty */
248 248
249 #define TARGET_TIOCSERCONFIG 0x5453 249 #define TARGET_TIOCSERCONFIG 0x5453
250 #define TARGET_TIOCSERGWILD 0x5454 250 #define TARGET_TIOCSERGWILD 0x5454
linux-user/syscall_defs.h
@@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
49 #define TARGET_IOC_TYPEBITS 8 49 #define TARGET_IOC_TYPEBITS 8
50 50
51 #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SH4) \ 51 #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SH4) \
52 - || defined(TARGET_M68K) || defined(TARGET_ALPHA) || defined(TARGET_CRIS) 52 + || defined(TARGET_M68K) || defined(TARGET_CRIS)
53 53
54 #define TARGET_IOC_SIZEBITS 14 54 #define TARGET_IOC_SIZEBITS 14
55 #define TARGET_IOC_DIRBITS 2 55 #define TARGET_IOC_DIRBITS 2