qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Alpha linux-user: fix termbits and target IOC macros
@ 2008-11-11 16:40 Laurent Desnogues
  2008-11-12 10:02 ` Aurelien Jarno
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Desnogues @ 2008-11-11 16:40 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

Hello,

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).


Laurent

Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: alpha-ioctl.patch --]
[-- Type: text/x-patch; name=alpha-ioctl.patch, Size: 5093 bytes --]

Index: linux-user/alpha/termbits.h
===================================================================
--- linux-user/alpha/termbits.h	(revision 5670)
+++ linux-user/alpha/termbits.h	(working copy)
@@ -157,44 +157,44 @@
 #define TARGET_PENDIN	0x20000000
 #define TARGET_IEXTEN	0x00000400
 
-#define TARGET_FIOCLEX		_IO('f', 1)
-#define TARGET_FIONCLEX	_IO('f', 2)
-#define TARGET_FIOASYNC	_IOW('f', 125, int)
-#define TARGET_FIONBIO		_IOW('f', 126, int)
-#define TARGET_FIONREAD	_IOR('f', 127, int)
+#define TARGET_FIOCLEX		TARGET_IO('f', 1)
+#define TARGET_FIONCLEX	TARGET_IO('f', 2)
+#define TARGET_FIOASYNC	TARGET_IOW('f', 125, int)
+#define TARGET_FIONBIO		TARGET_IOW('f', 126, int)
+#define TARGET_FIONREAD	TARGET_IOR('f', 127, int)
 #define TARGET_TIOCINQ		FIONREAD
-#define TARGET_FIOQSIZE	_IOR('f', 128, loff_t)
+#define TARGET_FIOQSIZE	TARGET_IOR('f', 128, loff_t)
 
-#define TARGET_TIOCGETP	_IOR('t', 8, struct sgttyb)
-#define TARGET_TIOCSETP	_IOW('t', 9, struct sgttyb)
-#define TARGET_TIOCSETN	_IOW('t', 10, struct sgttyb)	/* TIOCSETP wo flush */
+#define TARGET_TIOCGETP	TARGET_IOR('t', 8, struct target_sgttyb)
+#define TARGET_TIOCSETP	TARGET_IOW('t', 9, struct target_sgttyb)
+#define TARGET_TIOCSETN	TARGET_IOW('t', 10, struct target_sgttyb)	/* TIOCSETP wo flush */
 
-#define TARGET_TIOCSETC	_IOW('t', 17, struct tchars)
-#define TARGET_TIOCGETC	_IOR('t', 18, struct tchars)
-#define TARGET_TCGETS		_IOR('t', 19, struct termios)
-#define TARGET_TCSETS		_IOW('t', 20, struct termios)
-#define TARGET_TCSETSW		_IOW('t', 21, struct termios)
-#define TARGET_TCSETSF		_IOW('t', 22, struct termios)
+#define TARGET_TIOCSETC	TARGET_IOW('t', 17, struct target_tchars)
+#define TARGET_TIOCGETC	TARGET_IOR('t', 18, struct target_tchars)
+#define TARGET_TCGETS		TARGET_IOR('t', 19, struct target_termios)
+#define TARGET_TCSETS		TARGET_IOW('t', 20, struct target_termios)
+#define TARGET_TCSETSW		TARGET_IOW('t', 21, struct target_termios)
+#define TARGET_TCSETSF		TARGET_IOW('t', 22, struct target_termios)
 
-#define TARGET_TCGETA		_IOR('t', 23, struct termio)
-#define TARGET_TCSETA		_IOW('t', 24, struct termio)
-#define TARGET_TCSETAW		_IOW('t', 25, struct termio)
-#define TARGET_TCSETAF		_IOW('t', 28, struct termio)
+#define TARGET_TCGETA		TARGET_IOR('t', 23, struct target_termio)
+#define TARGET_TCSETA		TARGET_IOW('t', 24, struct target_termio)
+#define TARGET_TCSETAW		TARGET_IOW('t', 25, struct target_termio)
+#define TARGET_TCSETAF		TARGET_IOW('t', 28, struct target_termio)
 
-#define TARGET_TCSBRK		_IO('t', 29)
-#define TARGET_TCXONC		_IO('t', 30)
-#define TARGET_TCFLSH		_IO('t', 31)
+#define TARGET_TCSBRK		TARGET_IO('t', 29)
+#define TARGET_TCXONC		TARGET_IO('t', 30)
+#define TARGET_TCFLSH		TARGET_IO('t', 31)
 
-#define TARGET_TIOCSWINSZ	_IOW('t', 103, struct winsize)
-#define TARGET_TIOCGWINSZ	_IOR('t', 104, struct winsize)
-#define	TARGET_TIOCSTART	_IO('t', 110)		/* start output, like ^Q */
-#define	TARGET_TIOCSTOP	_IO('t', 111)		/* stop output, like ^S */
-#define TARGET_TIOCOUTQ        _IOR('t', 115, int)     /* output queue size */
+#define TARGET_TIOCSWINSZ	TARGET_IOW('t', 103, struct target_winsize)
+#define TARGET_TIOCGWINSZ	TARGET_IOR('t', 104, struct target_winsize)
+#define	TARGET_TIOCSTART	TARGET_IO('t', 110)		/* start output, like ^Q */
+#define	TARGET_TIOCSTOP	TARGET_IO('t', 111)		/* stop output, like ^S */
+#define TARGET_TIOCOUTQ        TARGET_IOR('t', 115, int)     /* output queue size */
 
-#define TARGET_TIOCGLTC	_IOR('t', 116, struct ltchars)
-#define TARGET_TIOCSLTC	_IOW('t', 117, struct ltchars)
-#define TARGET_TIOCSPGRP	_IOW('t', 118, int)
-#define TARGET_TIOCGPGRP	_IOR('t', 119, int)
+#define TARGET_TIOCGLTC	TARGET_IOR('t', 116, struct target_ltchars)
+#define TARGET_TIOCSLTC	TARGET_IOW('t', 117, struct target_ltchars)
+#define TARGET_TIOCSPGRP	TARGET_IOW('t', 118, int)
+#define TARGET_TIOCGPGRP	TARGET_IOR('t', 119, int)
 
 #define TARGET_TIOCEXCL	0x540C
 #define TARGET_TIOCNXCL	0x540D
@@ -243,8 +243,8 @@
 #define TARGET_TIOCSBRK	0x5427  /* BSD compatibility */
 #define TARGET_TIOCCBRK	0x5428  /* BSD compatibility */
 #define TARGET_TIOCGSID	0x5429  /* Return the session ID of FD */
-#define TARGET_TIOCGPTN	_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
-#define TARGET_TIOCSPTLCK	_IOW('T',0x31, int)  /* Lock/unlock Pty */
+#define TARGET_TIOCGPTN	TARGET_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TARGET_TIOCSPTLCK	TARGET_IOW('T',0x31, int)  /* Lock/unlock Pty */
 
 #define TARGET_TIOCSERCONFIG	0x5453
 #define TARGET_TIOCSERGWILD	0x5454
Index: linux-user/syscall_defs.h
===================================================================
--- linux-user/syscall_defs.h	(revision 5676)
+++ linux-user/syscall_defs.h	(working copy)
@@ -49,7 +49,7 @@
 #define TARGET_IOC_TYPEBITS	8
 
 #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SH4) \
-    || defined(TARGET_M68K) || defined(TARGET_ALPHA) || defined(TARGET_CRIS)
+    || defined(TARGET_M68K) || defined(TARGET_CRIS)
 
 #define TARGET_IOC_SIZEBITS	14
 #define TARGET_IOC_DIRBITS	2

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] Alpha linux-user: fix termbits and target IOC macros
  2008-11-11 16:40 [Qemu-devel] [PATCH] Alpha linux-user: fix termbits and target IOC macros Laurent Desnogues
@ 2008-11-12 10:02 ` Aurelien Jarno
  0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2008-11-12 10:02 UTC (permalink / raw)
  To: qemu-devel

On Tue, Nov 11, 2008 at 05:40:33PM +0100, Laurent Desnogues wrote:
> Hello,
> 
> 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).
> 

Thanks, applied.

> Laurent
> 
> Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>

> Index: linux-user/alpha/termbits.h
> ===================================================================
> --- linux-user/alpha/termbits.h	(revision 5670)
> +++ linux-user/alpha/termbits.h	(working copy)
> @@ -157,44 +157,44 @@
>  #define TARGET_PENDIN	0x20000000
>  #define TARGET_IEXTEN	0x00000400
>  
> -#define TARGET_FIOCLEX		_IO('f', 1)
> -#define TARGET_FIONCLEX	_IO('f', 2)
> -#define TARGET_FIOASYNC	_IOW('f', 125, int)
> -#define TARGET_FIONBIO		_IOW('f', 126, int)
> -#define TARGET_FIONREAD	_IOR('f', 127, int)
> +#define TARGET_FIOCLEX		TARGET_IO('f', 1)
> +#define TARGET_FIONCLEX	TARGET_IO('f', 2)
> +#define TARGET_FIOASYNC	TARGET_IOW('f', 125, int)
> +#define TARGET_FIONBIO		TARGET_IOW('f', 126, int)
> +#define TARGET_FIONREAD	TARGET_IOR('f', 127, int)
>  #define TARGET_TIOCINQ		FIONREAD
> -#define TARGET_FIOQSIZE	_IOR('f', 128, loff_t)
> +#define TARGET_FIOQSIZE	TARGET_IOR('f', 128, loff_t)
>  
> -#define TARGET_TIOCGETP	_IOR('t', 8, struct sgttyb)
> -#define TARGET_TIOCSETP	_IOW('t', 9, struct sgttyb)
> -#define TARGET_TIOCSETN	_IOW('t', 10, struct sgttyb)	/* TIOCSETP wo flush */
> +#define TARGET_TIOCGETP	TARGET_IOR('t', 8, struct target_sgttyb)
> +#define TARGET_TIOCSETP	TARGET_IOW('t', 9, struct target_sgttyb)
> +#define TARGET_TIOCSETN	TARGET_IOW('t', 10, struct target_sgttyb)	/* TIOCSETP wo flush */
>  
> -#define TARGET_TIOCSETC	_IOW('t', 17, struct tchars)
> -#define TARGET_TIOCGETC	_IOR('t', 18, struct tchars)
> -#define TARGET_TCGETS		_IOR('t', 19, struct termios)
> -#define TARGET_TCSETS		_IOW('t', 20, struct termios)
> -#define TARGET_TCSETSW		_IOW('t', 21, struct termios)
> -#define TARGET_TCSETSF		_IOW('t', 22, struct termios)
> +#define TARGET_TIOCSETC	TARGET_IOW('t', 17, struct target_tchars)
> +#define TARGET_TIOCGETC	TARGET_IOR('t', 18, struct target_tchars)
> +#define TARGET_TCGETS		TARGET_IOR('t', 19, struct target_termios)
> +#define TARGET_TCSETS		TARGET_IOW('t', 20, struct target_termios)
> +#define TARGET_TCSETSW		TARGET_IOW('t', 21, struct target_termios)
> +#define TARGET_TCSETSF		TARGET_IOW('t', 22, struct target_termios)
>  
> -#define TARGET_TCGETA		_IOR('t', 23, struct termio)
> -#define TARGET_TCSETA		_IOW('t', 24, struct termio)
> -#define TARGET_TCSETAW		_IOW('t', 25, struct termio)
> -#define TARGET_TCSETAF		_IOW('t', 28, struct termio)
> +#define TARGET_TCGETA		TARGET_IOR('t', 23, struct target_termio)
> +#define TARGET_TCSETA		TARGET_IOW('t', 24, struct target_termio)
> +#define TARGET_TCSETAW		TARGET_IOW('t', 25, struct target_termio)
> +#define TARGET_TCSETAF		TARGET_IOW('t', 28, struct target_termio)
>  
> -#define TARGET_TCSBRK		_IO('t', 29)
> -#define TARGET_TCXONC		_IO('t', 30)
> -#define TARGET_TCFLSH		_IO('t', 31)
> +#define TARGET_TCSBRK		TARGET_IO('t', 29)
> +#define TARGET_TCXONC		TARGET_IO('t', 30)
> +#define TARGET_TCFLSH		TARGET_IO('t', 31)
>  
> -#define TARGET_TIOCSWINSZ	_IOW('t', 103, struct winsize)
> -#define TARGET_TIOCGWINSZ	_IOR('t', 104, struct winsize)
> -#define	TARGET_TIOCSTART	_IO('t', 110)		/* start output, like ^Q */
> -#define	TARGET_TIOCSTOP	_IO('t', 111)		/* stop output, like ^S */
> -#define TARGET_TIOCOUTQ        _IOR('t', 115, int)     /* output queue size */
> +#define TARGET_TIOCSWINSZ	TARGET_IOW('t', 103, struct target_winsize)
> +#define TARGET_TIOCGWINSZ	TARGET_IOR('t', 104, struct target_winsize)
> +#define	TARGET_TIOCSTART	TARGET_IO('t', 110)		/* start output, like ^Q */
> +#define	TARGET_TIOCSTOP	TARGET_IO('t', 111)		/* stop output, like ^S */
> +#define TARGET_TIOCOUTQ        TARGET_IOR('t', 115, int)     /* output queue size */
>  
> -#define TARGET_TIOCGLTC	_IOR('t', 116, struct ltchars)
> -#define TARGET_TIOCSLTC	_IOW('t', 117, struct ltchars)
> -#define TARGET_TIOCSPGRP	_IOW('t', 118, int)
> -#define TARGET_TIOCGPGRP	_IOR('t', 119, int)
> +#define TARGET_TIOCGLTC	TARGET_IOR('t', 116, struct target_ltchars)
> +#define TARGET_TIOCSLTC	TARGET_IOW('t', 117, struct target_ltchars)
> +#define TARGET_TIOCSPGRP	TARGET_IOW('t', 118, int)
> +#define TARGET_TIOCGPGRP	TARGET_IOR('t', 119, int)
>  
>  #define TARGET_TIOCEXCL	0x540C
>  #define TARGET_TIOCNXCL	0x540D
> @@ -243,8 +243,8 @@
>  #define TARGET_TIOCSBRK	0x5427  /* BSD compatibility */
>  #define TARGET_TIOCCBRK	0x5428  /* BSD compatibility */
>  #define TARGET_TIOCGSID	0x5429  /* Return the session ID of FD */
> -#define TARGET_TIOCGPTN	_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
> -#define TARGET_TIOCSPTLCK	_IOW('T',0x31, int)  /* Lock/unlock Pty */
> +#define TARGET_TIOCGPTN	TARGET_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
> +#define TARGET_TIOCSPTLCK	TARGET_IOW('T',0x31, int)  /* Lock/unlock Pty */
>  
>  #define TARGET_TIOCSERCONFIG	0x5453
>  #define TARGET_TIOCSERGWILD	0x5454
> Index: linux-user/syscall_defs.h
> ===================================================================
> --- linux-user/syscall_defs.h	(revision 5676)
> +++ linux-user/syscall_defs.h	(working copy)
> @@ -49,7 +49,7 @@
>  #define TARGET_IOC_TYPEBITS	8
>  
>  #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SH4) \
> -    || defined(TARGET_M68K) || defined(TARGET_ALPHA) || defined(TARGET_CRIS)
> +    || defined(TARGET_M68K) || defined(TARGET_CRIS)
>  
>  #define TARGET_IOC_SIZEBITS	14
>  #define TARGET_IOC_DIRBITS	2


-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-11-12 10:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-11 16:40 [Qemu-devel] [PATCH] Alpha linux-user: fix termbits and target IOC macros Laurent Desnogues
2008-11-12 10:02 ` Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).