All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] linux-user: Fix some issues in termbits.h files
@ 2020-01-17  2:11 Aleksandar Markovic
  2020-01-17  2:11 ` [PATCH 1/4] linux-user: alpha: Synchronize termbits.h with kernel Aleksandar Markovic
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-01-17  2:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent, amarkovic

From: Aleksandar Markovic <amarkovic@wavecomp.com>

This series is a spin-off of v5 of earlier series "linux-user: Misc
patches for 5.0", that became too large to manage. I will submit the
rest of that large series separately.

Files linux-user/<target>/termbits.h seem to be in a very bad shape:
unsynchronized with kernel, containing wrong elements expressed in
terms of host instead of target, many being updated wrt kernel
content at various times, and on top of that all contain visually
very ugly combinations of tabs and spaces.

This series attempts to fix great majority of issues in termbits.

Alpha's and mips' termbits.h were in the worst shape, missing large
bits and pieces, and for them as complete as possible synchronization
with kernel code is done - this constitutes the first two patches.

Xtensa's termbits.h contained the most elements wrongly expressed in
terms of host instead of target, and that is the reason the changes
in this file are placed in a separate, third, patch. Previous "R-B"
given by Max Filippov was transferred to this patch only.

The fourth patch fixes remaining elements wrongly expressed in
terms of host instead of target.

As an additional note, structures "serial_iso7816" and "serial_rs485"
(at times mentioned as the third argument of certain ioctls) are
platform-independant in kernel, and do not need "target_" variant
in QEMU. Also, structure "winsize" (also appearing as the third
ioctl's argument at times) is defined at multiple places in kernel
(for several architectures) in kernel, but all such definitions are
identical, and, therefore, it also does not need "target_" variant
in QEMU.

A checkpatch warning related to "#if 0" in patch 2 is benign, and
should be ignored.

Aleksandar Markovic (4):
  linux-user: alpha: Synchronize termbits.h with kernel
  linux-user: mips: Synchronize termbits.h with kernel
  linux-user: xtensa: Fix some constants in termbits.h
  linux-user: Fix some constants in remaining termbits.h

 linux-user/aarch64/termbits.h    |   4 +-
 linux-user/alpha/termbits.h      |  82 ++++++++++++++--
 linux-user/arm/termbits.h        |   4 +-
 linux-user/cris/termbits.h       |   4 +-
 linux-user/hppa/termbits.h       |   4 +-
 linux-user/i386/termbits.h       |   4 +-
 linux-user/m68k/termbits.h       |   4 +-
 linux-user/microblaze/termbits.h |   4 +-
 linux-user/mips/termbits.h       | 140 ++++++++++++++++----------
 linux-user/nios2/termbits.h      |   4 +-
 linux-user/openrisc/termbits.h   |  14 +--
 linux-user/ppc/termbits.h        |   4 +-
 linux-user/riscv/termbits.h      |   4 +-
 linux-user/s390x/termbits.h      |  26 ++---
 linux-user/sh4/termbits.h        |   4 +-
 linux-user/sparc/termbits.h      |   4 +-
 linux-user/sparc64/termbits.h    |   4 +-
 linux-user/tilegx/termbits.h     |  12 ++-
 linux-user/x86_64/termbits.h     |  26 +++--
 linux-user/xtensa/termbits.h     | 207 +++++++++++++++++++++------------------
 20 files changed, 353 insertions(+), 206 deletions(-)

-- 
2.7.4



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

* [PATCH 1/4] linux-user: alpha: Synchronize termbits.h with kernel
  2020-01-17  2:11 [PATCH 0/4] linux-user: Fix some issues in termbits.h files Aleksandar Markovic
@ 2020-01-17  2:11 ` Aleksandar Markovic
  2020-01-17  2:11 ` [PATCH 2/4] linux-user: mips: " Aleksandar Markovic
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-01-17  2:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent, amarkovic

From: Aleksandar Markovic <amarkovic@wavecomp.com>

Synchronize all elements of alpha's termbits.h with kernel and
make sure that all applicable macros and other definitions are
expressed in terms of target, not the host.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
 linux-user/alpha/termbits.h | 82 +++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 76 insertions(+), 6 deletions(-)

diff --git a/linux-user/alpha/termbits.h b/linux-user/alpha/termbits.h
index a714251..d15f26e 100644
--- a/linux-user/alpha/termbits.h
+++ b/linux-user/alpha/termbits.h
@@ -17,6 +17,32 @@ struct target_termios {
 	target_speed_t c_ospeed;		/* output speed */
 };
 
+/* Alpha has identical termios and termios2 */
+
+struct target_termios2 {
+    target_tcflag_t c_iflag;            /* input mode flags */
+    target_tcflag_t c_oflag;            /* output mode flags */
+    target_tcflag_t c_cflag;            /* control mode flags */
+    target_tcflag_t c_lflag;            /* local mode flags */
+    target_cc_t c_cc[TARGET_NCCS];      /* control characters */
+    target_cc_t c_line;                 /* line discipline (== c_cc[19]) */
+    target_speed_t c_ispeed;            /* input speed */
+    target_speed_t c_ospeed;            /* output speed */
+};
+
+/* Alpha has matching termios and ktermios */
+
+struct target_ktermios {
+    target_tcflag_t c_iflag;            /* input mode flags */
+    target_tcflag_t c_oflag;            /* output mode flags */
+    target_tcflag_t c_cflag;            /* control mode flags */
+    target_tcflag_t c_lflag;            /* local mode flags */
+    target_cc_t c_cc[TARGET_NCCS];      /* control characters */
+    target_cc_t c_line;                 /* line discipline (== c_cc[19]) */
+    target_speed_t c_ispeed;            /* input speed */
+    target_speed_t c_ospeed;            /* output speed */
+};
+
 /* c_cc characters */
 #define TARGET_VEOF 0
 #define TARGET_VEOL 1
@@ -88,7 +114,11 @@ struct target_termios {
 #define TARGET_VTDLY	00200000
 #define   TARGET_VT0	00000000
 #define   TARGET_VT1	00200000
-#define TARGET_XTABS	01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
+/*
+ * Should be equivalent to TAB3, see description of TAB3 in
+ * POSIX.1-2008, Ch. 11.2.3 "Output Modes"
+ */
+#define TARGET_XTABS    TARGET_TAB3
 
 /* c_cflag bit meaning */
 #define TARGET_CBAUD	0000037
@@ -108,8 +138,8 @@ struct target_termios {
 #define  TARGET_B9600	0000015
 #define  TARGET_B19200	0000016
 #define  TARGET_B38400	0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA     TARGET_B19200
+#define TARGET_EXTB     TARGET_B38400
 #define TARGET_CBAUDEX 0000000
 #define  TARGET_B57600   00020
 #define  TARGET_B115200  00021
@@ -143,6 +173,9 @@ struct target_termios {
 #define TARGET_CMSPAR	  010000000000		/* mark or space (stick) parity */
 #define TARGET_CRTSCTS	  020000000000		/* flow control */
 
+#define TARGET_CIBAUD   07600000
+#define TARGET_IBSHIFT  16
+
 /* c_lflag bits */
 #define TARGET_ISIG	0x00000080
 #define TARGET_ICANON	0x00000100
@@ -159,13 +192,30 @@ struct target_termios {
 #define TARGET_FLUSHO	0x00800000
 #define TARGET_PENDIN	0x20000000
 #define TARGET_IEXTEN	0x00000400
+#define TARGET_EXTPROC  0x10000000
+
+/* Values for the ACTION argument to `tcflow'.  */
+#define TCOOFF          0
+#define TCOON           1
+#define TCIOFF          2
+#define TCION           3
+
+/* Values for the QUEUE_SELECTOR argument to `tcflush'.  */
+#define TCIFLUSH        0
+#define TCOFLUSH        1
+#define TCIOFLUSH       2
+
+/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'.  */
+#define TCSANOW         0
+#define TCSADRAIN       1
+#define TCSAFLUSH       2
 
 #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_TIOCINQ  TARGET_FIONREAD
 #define TARGET_FIOQSIZE	TARGET_IOR('f', 128, loff_t)
 
 #define TARGET_TIOCGETP	TARGET_IOR('t', 8, struct target_sgttyb)
@@ -188,6 +238,11 @@ struct target_termios {
 #define TARGET_TCXONC		TARGET_IO('t', 30)
 #define TARGET_TCFLSH		TARGET_IO('t', 31)
 
+#define TARGET_TCGETS2          TARGET_IOR('T', 42, struct target_termios2)
+#define TARGET_TCSETS2          TARGET_IOW('T', 43, struct target_termios2)
+#define TARGET_TCSETSW2         TARGET_IOW('T', 44, struct target_termios2)
+#define TARGET_TCSETSF2         TARGET_IOW('T', 45, struct target_termios2)
+
 #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 */
@@ -217,8 +272,8 @@ struct target_termios {
 # define TARGET_TIOCM_CAR	0x040
 # define TARGET_TIOCM_RNG	0x080
 # define TARGET_TIOCM_DSR	0x100
-# define TARGET_TIOCM_CD	TIOCM_CAR
-# define TARGET_TIOCM_RI	TIOCM_RNG
+# define TARGET_TIOCM_CD        TARGET_TIOCM_CAR
+# define TARGET_TIOCM_RI        TARGET_TIOCM_RNG
 # define TARGET_TIOCM_OUT1	0x2000
 # define TARGET_TIOCM_OUT2	0x4000
 # define TARGET_TIOCM_LOOP	0x8000
@@ -246,9 +301,24 @@ struct target_termios {
 #define TARGET_TIOCSBRK	0x5427  /* BSD compatibility */
 #define TARGET_TIOCCBRK	0x5428  /* BSD compatibility */
 #define TARGET_TIOCGSID	0x5429  /* Return the session ID of FD */
+#define TARGET_TIOCGRS485       TARGET_IOR('T', 0x2E, struct serial_rs485)
+#define TARGET_TIOCSRS485       TARGET_IOWR('T', 0x2F, struct serial_rs485)
 #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 */
+                                /* Get primary device node of /dev/console */
+#define TARGET_TIOCGDEV         TARGET_IOR('T', 0x32, unsigned int)
+                                /* Generate signal on Pty slave */
+#define TARGET_TIOCSIG          TARGET_IOW('T', 0x36, int)
+#define TARGET_TIOCVHANGUP      0x5437
+                                 /* Get packet mode state */
+#define TARGET_TIOCGPKT         TARGET_IOR('T', 0x38, int)
+                                /* Get Pty lock state */
+#define TARGET_TIOCGPTLCK       TARGET_IOR('T', 0x39, int)
+                                /* Get exclusive mode state */
+#define TARGET_TIOCGEXCL        TARGET_IOR('T', 0x40, int)
 #define TARGET_TIOCGPTPEER      TARGET_IO('T', 0x41) /* Safely open the slave */
+#define TARGET_TIOCGISO7816     TARGET_IOR('T', 0x42, struct serial_iso7816)
+#define TARGET_TIOCSISO7816     TARGET_IOWR('T', 0x43, struct serial_iso7816)
 
 #define TARGET_TIOCSERCONFIG	0x5453
 #define TARGET_TIOCSERGWILD	0x5454
-- 
2.7.4



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

* [PATCH 2/4] linux-user: mips: Synchronize termbits.h with kernel
  2020-01-17  2:11 [PATCH 0/4] linux-user: Fix some issues in termbits.h files Aleksandar Markovic
  2020-01-17  2:11 ` [PATCH 1/4] linux-user: alpha: Synchronize termbits.h with kernel Aleksandar Markovic
@ 2020-01-17  2:11 ` Aleksandar Markovic
  2020-01-17  2:11 ` [PATCH 3/4] linux-user: xtensa: Fix some constants in termbits.h Aleksandar Markovic
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-01-17  2:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent, amarkovic

From: Aleksandar Markovic <amarkovic@wavecomp.com>

Synchronize all elements of mips' termbits.h with kernel and
make sure that all applicable macros and other definitions are
expressed in terms of target, not the host.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
 linux-user/mips/termbits.h | 140 ++++++++++++++++++++++++++++-----------------
 1 file changed, 89 insertions(+), 51 deletions(-)

diff --git a/linux-user/mips/termbits.h b/linux-user/mips/termbits.h
index 3287cf6..79a9b9b 100644
--- a/linux-user/mips/termbits.h
+++ b/linux-user/mips/termbits.h
@@ -3,33 +3,89 @@
 #ifndef LINUX_USER_MIPS_TERMBITS_H
 #define LINUX_USER_MIPS_TERMBITS_H
 
-#define TARGET_NCCS 23
+typedef unsigned char   target_cc_t;
+typedef unsigned int    target_speed_t;
+typedef unsigned int    target_tcflag_t;
 
+/*
+ * The ABI says nothing about NCC but seems to use NCCS as
+ * replacement for it in struct termio
+ */
+#define TARGET_NCCS 23
 struct target_termios {
-    unsigned int c_iflag;               /* input mode flags */
-    unsigned int c_oflag;               /* output mode flags */
-    unsigned int c_cflag;               /* control mode flags */
-    unsigned int c_lflag;               /* local mode flags */
-    unsigned char c_line;                    /* line discipline */
-    unsigned char c_cc[TARGET_NCCS];                /* control characters */
+    target_tcflag_t c_iflag;            /* input mode flags */
+    target_tcflag_t c_oflag;            /* output mode flags */
+    target_tcflag_t c_cflag;            /* control mode flags */
+    target_tcflag_t c_lflag;            /* local mode flags */
+    target_cc_t c_line;                 /* line discipline */
+    target_cc_t c_cc[TARGET_NCCS];      /* control characters */
+};
+
+struct target_termios2 {
+    target_tcflag_t c_iflag;            /* input mode flags */
+    target_tcflag_t c_oflag;            /* output mode flags */
+    target_tcflag_t c_cflag;            /* control mode flags */
+    target_tcflag_t c_lflag;            /* local mode flags */
+    target_cc_t c_line;                 /* line discipline */
+    target_cc_t c_cc[TARGET_NCCS];      /* control characters */
+    target_speed_t c_ispeed;            /* input speed */
+    target_speed_t c_ospeed;            /* output speed */
+};
+
+struct target_ktermios {
+    target_tcflag_t c_iflag;            /* input mode flags */
+    target_tcflag_t c_oflag;            /* output mode flags */
+    target_tcflag_t c_cflag;            /* control mode flags */
+    target_tcflag_t c_lflag;            /* local mode flags */
+    target_cc_t c_line;                 /* line discipline */
+    target_cc_t c_cc[TARGET_NCCS];      /* control characters */
+    target_speed_t c_ispeed;            /* input speed */
+    target_speed_t c_ospeed;            /* output speed */
 };
 
+/* c_cc character offsets */
+#define TARGET_VINTR    0       /* Interrupt character [ISIG].  */
+#define TARGET_VQUIT    1       /* Quit character [ISIG].  */
+#define TARGET_VERASE   2       /* Erase character [ICANON].  */
+#define TARGET_VKILL    3       /* Kill-line character [ICANON].  */
+#define TARGET_VMIN     4       /* Minimum number of bytes read at once */
+#define TARGET_VTIME    5       /* Time-out value (tenths of a second) */
+#define TARGET_VEOL2    6       /* Second EOL character [ICANON].  */
+#define TARGET_VSWTC    7       /* ??? */
+#define TARGET_VSWTCH   VSWTC
+#define TARGET_VSTART   8       /* Start (X-ON) character [IXON, IXOFF].  */
+#define TARGET_VSTOP    9       /* Stop (X-OFF) character [IXON, IXOFF].  */
+#define TARGET_VSUSP    10      /* Suspend character [ISIG].  */
+
+#if 0
+/*
+ * VDSUSP is not supported
+ */
+#define TARGET_VDSUSP      11   /* Delayed suspend character [ISIG].  */
+#endif
+#define TARGET_VREPRINT 12      /* Reprint-line character [ICANON].  */
+#define TARGET_VDISCARD 13      /* Discard character [IEXTEN].  */
+#define TARGET_VWERASE  14      /* Word-erase character [ICANON].  */
+#define TARGET_VLNEXT   15      /* Literal-next character [IEXTEN].  */
+#define TARGET_VEOF     16      /* End-of-file character [ICANON].  */
+#define TARGET_VEOL     17      /* End-of-line character [ICANON].  */
+
 /* c_iflag bits */
-#define TARGET_IGNBRK  0000001
-#define TARGET_BRKINT  0000002
-#define TARGET_IGNPAR  0000004
-#define TARGET_PARMRK  0000010
-#define TARGET_INPCK   0000020
-#define TARGET_ISTRIP  0000040
-#define TARGET_INLCR   0000100
-#define TARGET_IGNCR   0000200
-#define TARGET_ICRNL   0000400
-#define TARGET_IUCLC   0001000
-#define TARGET_IXON    0002000
-#define TARGET_IXANY   0004000
-#define TARGET_IXOFF   0010000
-#define TARGET_IMAXBEL 0020000
-#define TARGET_IUTF8   0040000
+#define TARGET_IGNBRK  0000001  /* Ignore break condition.  */
+#define TARGET_BRKINT  0000002  /* Signal interrupt on break.  */
+#define TARGET_IGNPAR  0000004  /* Ignore characters with parity errors.  */
+#define TARGET_PARMRK  0000010  /* Mark parity and framing errors.  */
+#define TARGET_INPCK   0000020  /* Enable input parity check.  */
+#define TARGET_ISTRIP  0000040  /* Strip 8th bit off characters.  */
+#define TARGET_INLCR   0000100  /* Map NL to CR on input.  */
+#define TARGET_IGNCR   0000200  /* Ignore CR.  */
+#define TARGET_ICRNL   0000400  /* Map CR to NL on input.  */
+#define TARGET_IUCLC   0001000  /* Map upper case to lower case on input.  */
+#define TARGET_IXON    0002000  /* Enable start/stop output control.  */
+#define TARGET_IXANY   0004000  /* Any character will restart after stop.  */
+#define TARGET_IXOFF   0010000  /* Enable start/stop input control.  */
+#define TARGET_IMAXBEL 0020000  /* Ring bell when input queue is full.  */
+#define TARGET_IUTF8   0040000  /* Input is UTF-8 */
 
 /* c_oflag bits */
 #define TARGET_OPOST   0000001
@@ -82,8 +138,8 @@ struct target_termios {
 #define  TARGET_B9600  0000015
 #define  TARGET_B19200 0000016
 #define  TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA    TARGET_B19200
+#define TARGET_EXTB    TARGET_B38400
 #define TARGET_CSIZE   0000060
 #define   TARGET_CS5   0000000
 #define   TARGET_CS6   0000020
@@ -134,26 +190,6 @@ struct target_termios {
 #define TARGET_TOSTOP  0100000
 #define TARGET_ITOSTOP TARGET_TOSTOP
 
-/* c_cc character offsets */
-#define TARGET_VINTR	0
-#define TARGET_VQUIT	1
-#define TARGET_VERASE	2
-#define TARGET_VKILL	3
-#define TARGET_VMIN	4
-#define TARGET_VTIME	5
-#define TARGET_VEOL2	6
-#define TARGET_VSWTC	7
-#define TARGET_VSTART	8
-#define TARGET_VSTOP	9
-#define TARGET_VSUSP	10
-/* VDSUSP not supported */
-#define TARGET_VREPRINT	12
-#define TARGET_VDISCARD	13
-#define TARGET_VWERASE	14
-#define TARGET_VLNEXT	15
-#define TARGET_VEOF	16
-#define TARGET_VEOL	17
-
 /* ioctls */
 
 #define TARGET_TCGETA		0x5401
@@ -186,7 +222,7 @@ struct target_termios {
 #define	 TARGET_TIOCPKT_START		0x08	/* start output */
 #define	 TARGET_TIOCPKT_NOSTOP		0x10	/* no more ^S, ^Q */
 #define	 TARGET_TIOCPKT_DOSTOP		0x20	/* now do ^S ^Q */
-/* #define  TIOCPKT_IOCTL		0x40	state change of pty driver */
+#define  TARGET_TIOCPKT_IOCTL       0x40    /* state change of pty driver */
 #define TARGET_TIOCSWINSZ	TARGET_IOW('t', 103, struct winsize)	/* set window size */
 #define TARGET_TIOCGWINSZ	TARGET_IOR('t', 104, struct winsize)	/* get window size */
 #define TARGET_TIOCNOTTY	0x5471		/* void tty association */
@@ -205,8 +241,8 @@ struct target_termios {
 #define TARGET_TIOCGPGRP	TARGET_IOR('t', 119, int)	/* get pgrp of tty */
 #define TARGET_TIOCCONS	TARGET_IOW('t', 120, int)	/* become virtual console */
 
-#define TARGET_FIONREAD	0x467f
-#define TARGET_TIOCINQ		TARGET_FIONREAD
+#define TARGET_FIONREAD        0x467f
+#define TARGET_TIOCINQ         TARGET_FIONREAD
 
 #define TARGET_TIOCGETP        0x7408
 #define TARGET_TIOCSETP        0x7409
@@ -222,10 +258,10 @@ struct target_termios {
 #define TARGET_TIOCSBRK	0x5427  /* BSD compatibility */
 #define TARGET_TIOCCBRK	0x5428  /* BSD compatibility */
 #define TARGET_TIOCGSID	0x7416  /* Return the session ID of FD */
-#define TARGET_TCGETS2          TARGET_IOR('T', 0x2A, struct termios2)
-#define TARGET_TCSETS2          TARGET_IOW('T', 0x2B, struct termios2)
-#define TARGET_TCSETSW2         TARGET_IOW('T', 0x2C, struct termios2)
-#define TARGET_TCSETSF2         TARGET_IOW('T', 0x2D, struct termios2)
+#define TARGET_TCGETS2          TARGET_IOR('T', 0x2A, struct target_termios2)
+#define TARGET_TCSETS2          TARGET_IOW('T', 0x2B, struct target_termios2)
+#define TARGET_TCSETSW2         TARGET_IOW('T', 0x2C, struct target_termios2)
+#define TARGET_TCSETSF2         TARGET_IOW('T', 0x2D, struct target_termios2)
 #define TARGET_TIOCGRS485       TARGET_IOR('T', 0x2E, struct serial_rs485)
 #define TARGET_TIOCSRS485       TARGET_IOWR('T', 0x2F, struct serial_rs485)
 #define TARGET_TIOCGPTN	TARGET_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
@@ -237,6 +273,8 @@ struct target_termios {
 #define TARGET_TIOCGPTLCK       TARGET_IOR('T', 0x39, int)
 #define TARGET_TIOCGEXCL        TARGET_IOR('T', 0x40, int)
 #define TARGET_TIOCGPTPEER      TARGET_IO('T', 0x41)
+#define TARGET_TIOCGISO7816     TARGET_IOR('T', 0x42, struct serial_iso7816)
+#define TARGET_TIOCSISO7816     TARGET_IOWR('T', 0x43, struct serial_iso7816)
 
 /* I hope the range from 0x5480 on is free ... */
 #define TARGET_TIOCSCTTY	0x5480		/* become controlling tty */
-- 
2.7.4



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

* [PATCH 3/4] linux-user: xtensa: Fix some constants in termbits.h
  2020-01-17  2:11 [PATCH 0/4] linux-user: Fix some issues in termbits.h files Aleksandar Markovic
  2020-01-17  2:11 ` [PATCH 1/4] linux-user: alpha: Synchronize termbits.h with kernel Aleksandar Markovic
  2020-01-17  2:11 ` [PATCH 2/4] linux-user: mips: " Aleksandar Markovic
@ 2020-01-17  2:11 ` Aleksandar Markovic
  2020-01-17  2:11 ` [PATCH 4/4] linux-user: Fix some constants in remaining termbits.h Aleksandar Markovic
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-01-17  2:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent, amarkovic

From: Aleksandar Markovic <amarkovic@wavecomp.com>

Some constants were defined in terms of host, instead of target,
as they should be.

Some additional trivial changes in this patch were forced by
checkpatch.pl.

Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
 linux-user/xtensa/termbits.h | 207 +++++++++++++++++++++++--------------------
 1 file changed, 113 insertions(+), 94 deletions(-)

diff --git a/linux-user/xtensa/termbits.h b/linux-user/xtensa/termbits.h
index d1e09e6..abc8666 100644
--- a/linux-user/xtensa/termbits.h
+++ b/linux-user/xtensa/termbits.h
@@ -15,40 +15,41 @@
 
 #include <linux/posix_types.h>
 
-typedef unsigned char   cc_t;
-typedef unsigned int    speed_t;
-typedef unsigned int    tcflag_t;
+typedef unsigned char   target_cc_t;
+typedef unsigned int    target_speed_t;
+typedef unsigned int    target_tcflag_t;
 
 #define TARGET_NCCS 19
+
 struct target_termios {
-    tcflag_t c_iflag;       /* input mode flags */
-    tcflag_t c_oflag;       /* output mode flags */
-    tcflag_t c_cflag;       /* control mode flags */
-    tcflag_t c_lflag;       /* local mode flags */
-    cc_t c_line;            /* line discipline */
-    cc_t c_cc[TARGET_NCCS]; /* control characters */
+    target_tcflag_t c_iflag;       /* input mode flags */
+    target_tcflag_t c_oflag;       /* output mode flags */
+    target_tcflag_t c_cflag;       /* control mode flags */
+    target_tcflag_t c_lflag;       /* local mode flags */
+    target_cc_t c_line;            /* line discipline */
+    target_cc_t c_cc[TARGET_NCCS]; /* control characters */
 };
 
 struct target_termios2 {
-    tcflag_t c_iflag;       /* input mode flags */
-    tcflag_t c_oflag;       /* output mode flags */
-    tcflag_t c_cflag;       /* control mode flags */
-    tcflag_t c_lflag;       /* local mode flags */
-    cc_t c_line;            /* line discipline */
-    cc_t c_cc[TARGET_NCCS]; /* control characters */
-    speed_t c_ispeed;       /* input speed */
-    speed_t c_ospeed;       /* output speed */
+    target_tcflag_t c_iflag;       /* input mode flags */
+    target_tcflag_t c_oflag;       /* output mode flags */
+    target_tcflag_t c_cflag;       /* control mode flags */
+    target_tcflag_t c_lflag;       /* local mode flags */
+    target_cc_t c_line;            /* line discipline */
+    target_cc_t c_cc[TARGET_NCCS]; /* control characters */
+    target_speed_t c_ispeed;       /* input speed */
+    target_speed_t c_ospeed;       /* output speed */
 };
 
 struct target_ktermios {
-    tcflag_t c_iflag;       /* input mode flags */
-    tcflag_t c_oflag;       /* output mode flags */
-    tcflag_t c_cflag;       /* control mode flags */
-    tcflag_t c_lflag;       /* local mode flags */
-    cc_t c_line;            /* line discipline */
-    cc_t c_cc[TARGET_NCCS]; /* control characters */
-    speed_t c_ispeed;       /* input speed */
-    speed_t c_ospeed;       /* output speed */
+    target_tcflag_t c_iflag;       /* input mode flags */
+    target_tcflag_t c_oflag;       /* output mode flags */
+    target_tcflag_t c_cflag;       /* control mode flags */
+    target_tcflag_t c_lflag;       /* local mode flags */
+    target_cc_t c_line;            /* line discipline */
+    target_cc_t c_cc[TARGET_NCCS]; /* control characters */
+    target_speed_t c_ispeed;       /* input speed */
+    target_speed_t c_ospeed;       /* output speed */
 };
 
 /* c_cc characters */
@@ -142,8 +143,8 @@ struct target_ktermios {
 #define  TARGET_B9600   0000015
 #define  TARGET_B19200  0000016
 #define  TARGET_B38400  0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA     TARGET_B19200
+#define TARGET_EXTB     TARGET_B38400
 #define TARGET_CSIZE    0000060
 #define   TARGET_CS5    0000000
 #define   TARGET_CS6    0000020
@@ -217,13 +218,13 @@ struct target_ktermios {
 
 /* from arch/xtensa/include/uapi/asm/ioctls.h */
 
-#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_TIOCINQ     FIONREAD
-#define TARGET_FIOQSIZE    _IOR('f', 128, loff_t)
+#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     TARGET_FIONREAD
+#define TARGET_FIOQSIZE    TARGET_IOR('f', 128, loff_t)
 
 #define TARGET_TCGETS      0x5401
 #define TARGET_TCSETS      0x5402
@@ -235,28 +236,28 @@ struct target_ktermios {
 #define TARGET_TCSETAW     0x40127419  /* _IOW('t', 25, struct termio) */
 #define TARGET_TCSETAF     0x4012741C  /* _IOW('t', 28, struct 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  0x40087467  /* _IOW('t', 103, struct winsize) */
 #define TARGET_TIOCGWINSZ  0x80087468  /* _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_TIOCSPGRP   _IOW('t', 118, int)
-#define TARGET_TIOCGPGRP   _IOR('t', 119, int)
-
-#define TARGET_TIOCEXCL    _IO('T', 12)
-#define TARGET_TIOCNXCL    _IO('T', 13)
-#define TARGET_TIOCSCTTY   _IO('T', 14)
-
-#define TARGET_TIOCSTI     _IOW('T', 18, char)
-#define TARGET_TIOCMGET    _IOR('T', 21, unsigned int)
-#define TARGET_TIOCMBIS    _IOW('T', 22, unsigned int)
-#define TARGET_TIOCMBIC    _IOW('T', 23, unsigned int)
-#define TARGET_TIOCMSET    _IOW('T', 24, unsigned int)
+#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_TIOCSPGRP   TARGET_IOW('t', 118, int)
+#define TARGET_TIOCGPGRP   TARGET_IOR('t', 119, int)
+
+#define TARGET_TIOCEXCL    TARGET_IO('T', 12)
+#define TARGET_TIOCNXCL    TARGET_IO('T', 13)
+#define TARGET_TIOCSCTTY   TARGET_IO('T', 14)
+
+#define TARGET_TIOCSTI     TARGET_IOW('T', 18, char)
+#define TARGET_TIOCMGET    TARGET_IOR('T', 21, unsigned int)
+#define TARGET_TIOCMBIS    TARGET_IOW('T', 22, unsigned int)
+#define TARGET_TIOCMBIC    TARGET_IOW('T', 23, unsigned int)
+#define TARGET_TIOCMSET    TARGET_IOW('T', 24, unsigned int)
 # define TARGET_TIOCM_LE   0x001
 # define TARGET_TIOCM_DTR  0x002
 # define TARGET_TIOCM_RTS  0x004
@@ -266,16 +267,16 @@ struct target_ktermios {
 # define TARGET_TIOCM_CAR  0x040
 # define TARGET_TIOCM_RNG  0x080
 # define TARGET_TIOCM_DSR  0x100
-# define TARGET_TIOCM_CD   TIOCM_CAR
-# define TARGET_TIOCM_RI   TIOCM_RNG
+# define TARGET_TIOCM_CD   TARGET_TIOCM_CAR
+# define TARGET_TIOCM_RI   TARGET_TIOCM_RNG
 
-#define TARGET_TIOCGSOFTCAR    _IOR('T', 25, unsigned int)
-#define TARGET_TIOCSSOFTCAR    _IOW('T', 26, unsigned int)
-#define TARGET_TIOCLINUX   _IOW('T', 28, char)
-#define TARGET_TIOCCONS    _IO('T', 29)
+#define TARGET_TIOCGSOFTCAR    TARGET_IOR('T', 25, unsigned int)
+#define TARGET_TIOCSSOFTCAR    TARGET_IOW('T', 26, unsigned int)
+#define TARGET_TIOCLINUX   TARGET_IOW('T', 28, char)
+#define TARGET_TIOCCONS    TARGET_IO('T', 29)
 #define TARGET_TIOCGSERIAL 0x803C541E  /*_IOR('T', 30, struct serial_struct)*/
 #define TARGET_TIOCSSERIAL 0x403C541F  /*_IOW('T', 31, struct serial_struct)*/
-#define TARGET_TIOCPKT     _IOW('T', 32, int)
+#define TARGET_TIOCPKT     TARGET_IOW('T', 32, int)
 # define TARGET_TIOCPKT_DATA        0
 # define TARGET_TIOCPKT_FLUSHREAD   1
 # define TARGET_TIOCPKT_FLUSHWRITE  2
@@ -286,43 +287,61 @@ struct target_ktermios {
 # define TARGET_TIOCPKT_IOCTL      64
 
 
-#define TARGET_TIOCNOTTY   _IO('T', 34)
-#define TARGET_TIOCSETD    _IOW('T', 35, int)
-#define TARGET_TIOCGETD    _IOR('T', 36, int)
-#define TARGET_TCSBRKP     _IOW('T', 37, int)   /* Needed for POSIX tcsendbreak()*/
-#define TARGET_TIOCSBRK    _IO('T', 39)         /* BSD compatibility */
-#define TARGET_TIOCCBRK    _IO('T', 40)         /* BSD compatibility */
-#define TARGET_TIOCGSID    _IOR('T', 41, pid_t) /* Return the session ID of FD*/
-#define TARGET_TCGETS2     _IOR('T', 42, struct termios2)
-#define TARGET_TCSETS2     _IOW('T', 43, struct termios2)
-#define TARGET_TCSETSW2    _IOW('T', 44, struct termios2)
-#define TARGET_TCSETSF2    _IOW('T', 45, struct termios2)
-#define TARGET_TIOCGRS485  _IOR('T', 46, struct serial_rs485)
-#define TARGET_TIOCSRS485  _IOWR('T', 47, struct serial_rs485)
-#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_TIOCGDEV    _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */
-#define TARGET_TIOCSIG     _IOW('T',0x36, int)  /* Generate signal on Pty slave */
-#define TARGET_TIOCVHANGUP _IO('T', 0x37)
-#define TARGET_TIOCGPKT    _IOR('T', 0x38, int) /* Get packet mode state */
-#define TARGET_TIOCGPTLCK  _IOR('T', 0x39, int) /* Get Pty lock state */
-#define TARGET_TIOCGEXCL   _IOR('T', 0x40, int) /* Get exclusive mode state */
-#define TARGET_TIOCGPTPEER _IO('T', 0x41) /* Safely open the slave */
-
-#define TARGET_TIOCSERCONFIG   _IO('T', 83)
-#define TARGET_TIOCSERGWILD    _IOR('T', 84,  int)
-#define TARGET_TIOCSERSWILD    _IOW('T', 85,  int)
+#define TARGET_TIOCNOTTY   TARGET_IO('T', 34)
+#define TARGET_TIOCSETD    TARGET_IOW('T', 35, int)
+#define TARGET_TIOCGETD    TARGET_IOR('T', 36, int)
+/* Needed for POSIX tcsendbreak()*/
+#define TARGET_TCSBRKP     TARGET_IOW('T', 37, int)
+/* BSD compatibility */
+#define TARGET_TIOCSBRK    TARGET_IO('T', 39)
+/* BSD compatibility */
+#define TARGET_TIOCCBRK    TARGET_IO('T', 40)
+/* Return the session ID of FD*/
+#define TARGET_TIOCGSID    TARGET_IOR('T', 41, pid_t)
+#define TARGET_TCGETS2     TARGET_IOR('T', 42, struct target_termios2)
+#define TARGET_TCSETS2     TARGET_IOW('T', 43, struct target_termios2)
+#define TARGET_TCSETSW2    TARGET_IOW('T', 44, struct target_termios2)
+#define TARGET_TCSETSF2    TARGET_IOW('T', 45, struct target_termios2)
+#define TARGET_TIOCGRS485  TARGET_IOR('T', 46, struct serial_rs485)
+#define TARGET_TIOCSRS485  TARGET_IOWR('T', 47, struct serial_rs485)
+/* Get Pty Number (of pty-mux device) */
+#define TARGET_TIOCGPTN    TARGET_IOR('T', 0x30, unsigned int)
+/* Lock/unlock Pty */
+#define TARGET_TIOCSPTLCK  TARGET_IOW('T', 0x31, int)
+/* Get primary device node of /dev/console */
+#define TARGET_TIOCGDEV    TARGET_IOR('T', 0x32, unsigned int)
+/* Generate signal on Pty slave */
+#define TARGET_TIOCSIG     TARGET_IOW('T', 0x36, int)
+#define TARGET_TIOCVHANGUP TARGET_IO('T', 0x37)
+/* Get packet mode state */
+#define TARGET_TIOCGPKT    TARGET_IOR('T', 0x38, int)
+/* Get Pty lock state */
+#define TARGET_TIOCGPTLCK  TARGET_IOR('T', 0x39, int)
+/* Get exclusive mode state */
+#define TARGET_TIOCGEXCL   TARGET_IOR('T', 0x40, int)
+/* Safely open the slave */
+#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)
+
+#define TARGET_TIOCSERCONFIG   TARGET_IO('T', 83)
+#define TARGET_TIOCSERGWILD    TARGET_IOR('T', 84,  int)
+#define TARGET_TIOCSERSWILD    TARGET_IOW('T', 85,  int)
 #define TARGET_TIOCGLCKTRMIOS  0x5456
 #define TARGET_TIOCSLCKTRMIOS  0x5457
-#define TARGET_TIOCSERGSTRUCT  0x5458           /* For debugging only */
-#define TARGET_TIOCSERGETLSR   _IOR('T', 89, unsigned int) /* Get line status reg. */
+/* For debugging only */
+#define TARGET_TIOCSERGSTRUCT  0x5458
+/* Get line status reg. */
+#define TARGET_TIOCSERGETLSR   TARGET_IOR('T', 89, unsigned int)
 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
-# define TARGET_TIOCSER_TEMT    0x01            /* Transmitter physically empty */
-#define TARGET_TIOCSERGETMULTI 0x80a8545a /* Get multiport config  */
+/* Transmitter physically empty */
+# define TARGET_TIOCSER_TEMT    0x01
+/* Get multiport config  */
+#define TARGET_TIOCSERGETMULTI 0x80a8545a
 /* _IOR('T', 90, struct serial_multiport_struct) */
-#define TARGET_TIOCSERSETMULTI 0x40a8545b /* Set multiport config */
+/* Set multiport config */
+#define TARGET_TIOCSERSETMULTI 0x40a8545b
 /* _IOW('T', 91, struct serial_multiport_struct) */
-
-#define TARGET_TIOCMIWAIT  _IO('T', 92) /* wait for a change on serial input line(s) */
-#define TARGET_TIOCGICOUNT 0x545D  /* read serial port inline interrupt counts */
+/* wait for a change on serial input line(s) */
+#define TARGET_TIOCMIWAIT      TARGET_IO('T', 92)
+/* read serial port inline interrupt counts */
+#define TARGET_TIOCGICOUNT 0x545D
 #endif /* XTENSA_TERMBITS_H */
-- 
2.7.4



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

* [PATCH 4/4] linux-user: Fix some constants in remaining termbits.h
  2020-01-17  2:11 [PATCH 0/4] linux-user: Fix some issues in termbits.h files Aleksandar Markovic
                   ` (2 preceding siblings ...)
  2020-01-17  2:11 ` [PATCH 3/4] linux-user: xtensa: Fix some constants in termbits.h Aleksandar Markovic
@ 2020-01-17  2:11 ` Aleksandar Markovic
  2020-01-17 10:12 ` [PATCH 0/4] linux-user: Fix some issues in termbits.h files no-reply
  2020-01-28 18:19 ` Laurent Vivier
  5 siblings, 0 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-01-17  2:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: laurent, amarkovic

From: Aleksandar Markovic <amarkovic@wavecomp.com>

Some constants were defined in terms of host, instead of target,
as they should be.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
---
 linux-user/aarch64/termbits.h    |  4 ++--
 linux-user/arm/termbits.h        |  4 ++--
 linux-user/cris/termbits.h       |  4 ++--
 linux-user/hppa/termbits.h       |  4 ++--
 linux-user/i386/termbits.h       |  4 ++--
 linux-user/m68k/termbits.h       |  4 ++--
 linux-user/microblaze/termbits.h |  4 ++--
 linux-user/nios2/termbits.h      |  4 ++--
 linux-user/openrisc/termbits.h   | 14 +++++++-------
 linux-user/ppc/termbits.h        |  4 ++--
 linux-user/riscv/termbits.h      |  4 ++--
 linux-user/s390x/termbits.h      | 26 +++++++++++++++-----------
 linux-user/sh4/termbits.h        |  4 ++--
 linux-user/sparc/termbits.h      |  4 ++--
 linux-user/sparc64/termbits.h    |  4 ++--
 linux-user/tilegx/termbits.h     | 12 ++++++++----
 linux-user/x86_64/termbits.h     | 26 +++++++++++++++++++-------
 17 files changed, 75 insertions(+), 55 deletions(-)

diff --git a/linux-user/aarch64/termbits.h b/linux-user/aarch64/termbits.h
index 0ab448d..998fc1d 100644
--- a/linux-user/aarch64/termbits.h
+++ b/linux-user/aarch64/termbits.h
@@ -83,8 +83,8 @@ struct target_termios {
 #define  TARGET_B9600  0000015
 #define  TARGET_B19200 0000016
 #define  TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA    TARGET_B19200
+#define TARGET_EXTB    TARGET_B38400
 #define TARGET_CSIZE   0000060
 #define   TARGET_CS5   0000000
 #define   TARGET_CS6   0000020
diff --git a/linux-user/arm/termbits.h b/linux-user/arm/termbits.h
index e555cff..7170b8a 100644
--- a/linux-user/arm/termbits.h
+++ b/linux-user/arm/termbits.h
@@ -83,8 +83,8 @@ struct target_termios {
 #define  TARGET_B9600  0000015
 #define  TARGET_B19200 0000016
 #define  TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA    TARGET_B19200
+#define TARGET_EXTB    TARGET_B38400
 #define TARGET_CSIZE   0000060
 #define   TARGET_CS5   0000000
 #define   TARGET_CS6   0000020
diff --git a/linux-user/cris/termbits.h b/linux-user/cris/termbits.h
index 475ee70..76d5ed0 100644
--- a/linux-user/cris/termbits.h
+++ b/linux-user/cris/termbits.h
@@ -81,8 +81,8 @@ struct target_termios {
 #define  TARGET_B9600  0000015
 #define  TARGET_B19200 0000016
 #define  TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA    TARGET_B19200
+#define TARGET_EXTB    TARGET_B38400
 #define TARGET_CSIZE   0000060
 #define   TARGET_CS5   0000000
 #define   TARGET_CS6   0000020
diff --git a/linux-user/hppa/termbits.h b/linux-user/hppa/termbits.h
index 8fba839..3094710 100644
--- a/linux-user/hppa/termbits.h
+++ b/linux-user/hppa/termbits.h
@@ -82,8 +82,8 @@ struct target_termios {
 #define  TARGET_B9600  0000015
 #define  TARGET_B19200 0000016
 #define  TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA    TARGET_B19200
+#define TARGET_EXTB    TARGET_B38400
 #define TARGET_CSIZE   0000060
 #define   TARGET_CS5   0000000
 #define   TARGET_CS6   0000020
diff --git a/linux-user/i386/termbits.h b/linux-user/i386/termbits.h
index 88264bb..3b16977 100644
--- a/linux-user/i386/termbits.h
+++ b/linux-user/i386/termbits.h
@@ -82,8 +82,8 @@ struct target_termios {
 #define  TARGET_B9600  0000015
 #define  TARGET_B19200 0000016
 #define  TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA    TARGET_B19200
+#define TARGET_EXTB    TARGET_B38400
 #define TARGET_CSIZE   0000060
 #define   TARGET_CS5   0000000
 #define   TARGET_CS6   0000020
diff --git a/linux-user/m68k/termbits.h b/linux-user/m68k/termbits.h
index 23840aa..f3ae025 100644
--- a/linux-user/m68k/termbits.h
+++ b/linux-user/m68k/termbits.h
@@ -83,8 +83,8 @@ struct target_termios {
 #define  TARGET_B9600  0000015
 #define  TARGET_B19200 0000016
 #define  TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA    TARGET_B19200
+#define TARGET_EXTB    TARGET_B38400
 #define TARGET_CSIZE   0000060
 #define   TARGET_CS5   0000000
 #define   TARGET_CS6   0000020
diff --git a/linux-user/microblaze/termbits.h b/linux-user/microblaze/termbits.h
index 17db8a4..7697736 100644
--- a/linux-user/microblaze/termbits.h
+++ b/linux-user/microblaze/termbits.h
@@ -81,8 +81,8 @@ struct target_termios {
 #define  TARGET_B9600  0000015
 #define  TARGET_B19200 0000016
 #define  TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA    TARGET_B19200
+#define TARGET_EXTB    TARGET_B38400
 #define TARGET_CSIZE   0000060
 #define   TARGET_CS5   0000000
 #define   TARGET_CS6   0000020
diff --git a/linux-user/nios2/termbits.h b/linux-user/nios2/termbits.h
index 425a2fe..269ab59 100644
--- a/linux-user/nios2/termbits.h
+++ b/linux-user/nios2/termbits.h
@@ -83,8 +83,8 @@ struct target_termios {
 #define  TARGET_B9600  0000015
 #define  TARGET_B19200 0000016
 #define  TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA    TARGET_B19200
+#define TARGET_EXTB    TARGET_B38400
 #define TARGET_CSIZE   0000060
 #define   TARGET_CS5   0000000
 #define   TARGET_CS6   0000020
diff --git a/linux-user/openrisc/termbits.h b/linux-user/openrisc/termbits.h
index 7a635ff..35f7b26 100644
--- a/linux-user/openrisc/termbits.h
+++ b/linux-user/openrisc/termbits.h
@@ -124,8 +124,8 @@ struct target_termios3 {
 #define TARGET_B9600    0000015
 #define TARGET_B19200   0000016
 #define TARGET_B38400   0000017
-#define TARGET_EXTA     B19200
-#define TARGET_EXTB     B38400
+#define TARGET_EXTA     TARGET_B19200
+#define TARGET_EXTB     TARGET_B38400
 #define TARGET_CSIZE    0000060
 #define TARGET_CS5      0000000
 #define TARGET_CS6      0000020
@@ -222,7 +222,7 @@ struct target_termios3 {
 #define TARGET_TIOCGSOFTCAR    0x5419
 #define TARGET_TIOCSSOFTCAR    0x541A
 #define TARGET_FIONREAD        0x541B
-#define TARGET_TIOCINQ         FIONREAD
+#define TARGET_TIOCINQ         TARGET_FIONREAD
 #define TARGET_TIOCLINUX       0x541C
 #define TARGET_TIOCCONS        0x541D
 #define TARGET_TIOCGSERIAL     0x541E
@@ -236,10 +236,10 @@ struct target_termios3 {
 #define TARGET_TIOCSBRK        0x5427  /* BSD compatibility */
 #define TARGET_TIOCCBRK        0x5428  /* BSD compatibility */
 #define TARGET_TIOCGSID        0x5429  /* Return the session ID of FD */
-#define TARGET_TCGETS2         TARGET_IOR('T', 0x2A, struct termios2)
-#define TARGET_TCSETS2         TARGET_IOW('T', 0x2B, struct termios2)
-#define TARGET_TCSETSW2        TARGET_IOW('T', 0x2C, struct termios2)
-#define TARGET_TCSETSF2        TARGET_IOW('T', 0x2D, struct termios2)
+#define TARGET_TCGETS2         TARGET_IOR('T', 0x2A, struct target_termios2)
+#define TARGET_TCSETS2         TARGET_IOW('T', 0x2B, struct target_termios2)
+#define TARGET_TCSETSW2        TARGET_IOW('T', 0x2C, struct target_termios2)
+#define TARGET_TCSETSF2        TARGET_IOW('T', 0x2D, struct target_termios2)
 #define TARGET_TIOCGRS485      0x542E
 #ifndef TARGET_TIOCSRS485
 #define TARGET_TIOCSRS485      0x542F
diff --git a/linux-user/ppc/termbits.h b/linux-user/ppc/termbits.h
index 19e4c6e..66bb76c 100644
--- a/linux-user/ppc/termbits.h
+++ b/linux-user/ppc/termbits.h
@@ -107,8 +107,8 @@ struct target_termios {
 #define  TARGET_B9600	0000015
 #define  TARGET_B19200	0000016
 #define  TARGET_B38400	0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA     TARGET_B19200
+#define TARGET_EXTB     TARGET_B38400
 #define TARGET_CBAUDEX 0000000
 #define  TARGET_B57600   00020
 #define  TARGET_B115200  00021
diff --git a/linux-user/riscv/termbits.h b/linux-user/riscv/termbits.h
index 5e0af0d..778de0c 100644
--- a/linux-user/riscv/termbits.h
+++ b/linux-user/riscv/termbits.h
@@ -83,8 +83,8 @@ struct target_termios {
 #define  TARGET_B9600  0000015
 #define  TARGET_B19200 0000016
 #define  TARGET_B38400 0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA    TARGET_B19200
+#define TARGET_EXTB    TARGET_B38400
 #define TARGET_CSIZE   0000060
 #define   TARGET_CS5   0000000
 #define   TARGET_CS6   0000020
diff --git a/linux-user/s390x/termbits.h b/linux-user/s390x/termbits.h
index 9affa8f..140f684 100644
--- a/linux-user/s390x/termbits.h
+++ b/linux-user/s390x/termbits.h
@@ -128,8 +128,8 @@ struct target_ktermios {
 #define TARGET_B9600	0000015
 #define TARGET_B19200	0000016
 #define TARGET_B38400	0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA     TARGET_B19200
+#define TARGET_EXTB     TARGET_B38400
 #define TARGET_CSIZE	0000060
 #define TARGET_CS5	0000000
 #define TARGET_CS6	0000020
@@ -234,7 +234,7 @@ struct target_ktermios {
 #define TARGET_TIOCGSOFTCAR	0x5419
 #define TARGET_TIOCSSOFTCAR	0x541A
 #define TARGET_FIONREAD	0x541B
-#define TARGET_TIOCINQ		FIONREAD
+#define TARGET_TIOCINQ      TARGET_FIONREAD
 #define TARGET_TIOCLINUX	0x541C
 #define TARGET_TIOCCONS	0x541D
 #define TARGET_TIOCGSERIAL	0x541E
@@ -248,14 +248,18 @@ struct target_ktermios {
 #define TARGET_TIOCSBRK	0x5427  /* BSD compatibility */
 #define TARGET_TIOCCBRK	0x5428  /* BSD compatibility */
 #define TARGET_TIOCGSID	0x5429  /* Return the session ID of FD */
-#define TARGET_TCGETS2		_IOR('T',0x2A, struct termios2)
-#define TARGET_TCSETS2		_IOW('T',0x2B, struct termios2)
-#define TARGET_TCSETSW2	_IOW('T',0x2C, struct termios2)
-#define TARGET_TCSETSF2	_IOW('T',0x2D, struct termios2)
-#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_TIOCGDEV	_IOR('T',0x32, unsigned int) /* Get real dev no below /dev/console */
-#define TARGET_TIOCGPTPEER      TARGET_IO('T', 0x41) /* Safely open the slave */
+#define TARGET_TCGETS2          TARGET_IOR('T', 0x2A, struct target_termios2)
+#define TARGET_TCSETS2          TARGET_IOW('T', 0x2B, struct target_termios2)
+#define TARGET_TCSETSW2         TARGET_IOW('T', 0x2C, struct target_termios2)
+#define TARGET_TCSETSF2         TARGET_IOW('T', 0x2D, struct target_termios2)
+/* Get Pty Number (of pty-mux device) */
+#define TARGET_TIOCGPTN         TARGET_IOR('T', 0x30, unsigned int)
+/* Lock/unlock Pty */
+#define TARGET_TIOCSPTLCK       TARGET_IOW('T', 0x31, int)
+/* Get real dev no below /dev/console */
+#define TARGET_TIOCGDEV         TARGET_IOR('T', 0x32, unsigned int)
+/* Safely open the slave */
+#define TARGET_TIOCGPTPEER      TARGET_IO('T', 0x41)
 
 #define TARGET_FIONCLEX	0x5450  /* these numbers need to be adjusted. */
 #define TARGET_FIOCLEX		0x5451
diff --git a/linux-user/sh4/termbits.h b/linux-user/sh4/termbits.h
index dd125b6..89a124d 100644
--- a/linux-user/sh4/termbits.h
+++ b/linux-user/sh4/termbits.h
@@ -101,8 +101,8 @@ struct target_termios {
 #define TARGET_B9600	0000015
 #define TARGET_B19200	0000016
 #define TARGET_B38400	0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA     TARGET_B19200
+#define TARGET_EXTB     TARGET_B38400
 #define TARGET_CSIZE	0000060
 #define TARGET_CS5	0000000
 #define TARGET_CS6	0000020
diff --git a/linux-user/sparc/termbits.h b/linux-user/sparc/termbits.h
index f85219e..e38e53e 100644
--- a/linux-user/sparc/termbits.h
+++ b/linux-user/sparc/termbits.h
@@ -109,8 +109,8 @@ struct target_termios {
 #define  TARGET_B9600	  0x0000000d
 #define  TARGET_B19200	  0x0000000e
 #define  TARGET_B38400	  0x0000000f
-#define TARGET_EXTA      B19200
-#define TARGET_EXTB      B38400
+#define TARGET_EXTA      TARGET_B19200
+#define TARGET_EXTB      TARGET_B38400
 #define  TARGET_CSIZE    0x00000030
 #define   TARGET_CS5	  0x00000000
 #define   TARGET_CS6	  0x00000010
diff --git a/linux-user/sparc64/termbits.h b/linux-user/sparc64/termbits.h
index 11b5abc..c86f714 100644
--- a/linux-user/sparc64/termbits.h
+++ b/linux-user/sparc64/termbits.h
@@ -109,8 +109,8 @@ struct target_termios {
 #define  TARGET_B9600	  0x0000000d
 #define  TARGET_B19200	  0x0000000e
 #define  TARGET_B38400	  0x0000000f
-#define TARGET_EXTA      B19200
-#define TARGET_EXTB      B38400
+#define TARGET_EXTA       TARGET_B19200
+#define TARGET_EXTB       TARGET_B38400
 #define  TARGET_CSIZE    0x00000030
 #define   TARGET_CS5	  0x00000000
 #define   TARGET_CS6	  0x00000010
diff --git a/linux-user/tilegx/termbits.h b/linux-user/tilegx/termbits.h
index 966daec..75f78d7 100644
--- a/linux-user/tilegx/termbits.h
+++ b/linux-user/tilegx/termbits.h
@@ -224,10 +224,14 @@ struct target_termios2 {
 #define TARGET_TIOCSBRK                 0x5427
 #define TARGET_TIOCCBRK                 0x5428
 #define TARGET_TIOCGSID                 0x5429
-#define TARGET_TCGETS2                  TARGET_IOR('T', 0x2A, struct termios2)
-#define TARGET_TCSETS2                  TARGET_IOW('T', 0x2B, struct termios2)
-#define TARGET_TCSETSW2                 TARGET_IOW('T', 0x2C, struct termios2)
-#define TARGET_TCSETSF2                 TARGET_IOW('T', 0x2D, struct termios2)
+#define TARGET_TCGETS2                  TARGET_IOR('T', 0x2A,                  \
+                                                   struct target_termios2)
+#define TARGET_TCSETS2                  TARGET_IOW('T', 0x2B,                  \
+                                                   struct target_termios2)
+#define TARGET_TCSETSW2                 TARGET_IOW('T', 0x2C,                  \
+                                                   struct target_termios2)
+#define TARGET_TCSETSF2                 TARGET_IOW('T', 0x2D,                  \
+                                                   struct target_termios2)
 #define TARGET_TIOCGRS485               0x542E
 #define TARGET_TIOCSRS485               0x542F
 #define TARGET_TIOCGPTN                 TARGET_IOR('T', 0x30, unsigned int)
diff --git a/linux-user/x86_64/termbits.h b/linux-user/x86_64/termbits.h
index c8bb599..25d9d5d 100644
--- a/linux-user/x86_64/termbits.h
+++ b/linux-user/x86_64/termbits.h
@@ -6,6 +6,7 @@
 typedef unsigned char	target_cc_t;
 typedef unsigned int	target_speed_t;
 typedef unsigned int	target_tcflag_t;
+
 struct target_termios {
 	target_tcflag_t c_iflag;		/* input mode flags */
 	target_tcflag_t c_oflag;		/* output mode flags */
@@ -15,6 +16,17 @@ struct target_termios {
 	target_cc_t c_cc[TARGET_NCCS];		/* control characters */
 };
 
+struct target_termios2 {
+    target_tcflag_t c_iflag;            /* input mode flags */
+    target_tcflag_t c_oflag;            /* output mode flags */
+    target_tcflag_t c_cflag;            /* control mode flags */
+    target_tcflag_t c_lflag;            /* local mode flags */
+    target_cc_t c_line;                 /* line discipline */
+    target_cc_t c_cc[TARGET_NCCS];      /* control characters */
+    target_speed_t c_ispeed;            /* input speed */
+    target_speed_t c_ospeed;            /* output speed */
+};
+
 /* c_cc characters */
 #define TARGET_VINTR 0
 #define TARGET_VQUIT 1
@@ -102,8 +114,8 @@ struct target_termios {
 #define  TARGET_B9600	0000015
 #define  TARGET_B19200	0000016
 #define  TARGET_B38400	0000017
-#define TARGET_EXTA B19200
-#define TARGET_EXTB B38400
+#define TARGET_EXTA     TARGET_B19200
+#define TARGET_EXTB     TARGET_B38400
 #define TARGET_CSIZE	0000060
 #define   TARGET_CS5	0000000
 #define   TARGET_CS6	0000020
@@ -198,7 +210,7 @@ struct target_termios {
 #define TARGET_TIOCGSOFTCAR	0x5419
 #define TARGET_TIOCSSOFTCAR	0x541A
 #define TARGET_FIONREAD	0x541B
-#define TARGET_TIOCINQ		FIONREAD
+#define TARGET_TIOCINQ          TARGET_FIONREAD
 #define TARGET_TIOCLINUX	0x541C
 #define TARGET_TIOCCONS	0x541D
 #define TARGET_TIOCGSERIAL	0x541E
@@ -212,10 +224,10 @@ struct target_termios {
 #define TARGET_TIOCSBRK	0x5427  /* BSD compatibility */
 #define TARGET_TIOCCBRK	0x5428  /* BSD compatibility */
 #define TARGET_TIOCGSID	0x5429  /* Return the session ID of FD */
-#define TARGET_TCGETS2          TARGET_IOR('T',0x2A, struct termios2)
-#define TARGET_TCSETS2          TARGET_IOW('T',0x2B, struct termios2)
-#define TARGET_TCSETSW2         TARGET_IOW('T',0x2C, struct termios2)
-#define TARGET_TCSETSF2         TARGET_IOW('T',0x2D, struct termios2)
+#define TARGET_TCGETS2          TARGET_IOR('T', 0x2A, struct target_termios2)
+#define TARGET_TCSETS2          TARGET_IOW('T', 0x2B, struct target_termios2)
+#define TARGET_TCSETSW2         TARGET_IOW('T', 0x2C, struct target_termios2)
+#define TARGET_TCSETSF2         TARGET_IOW('T', 0x2D, struct target_termios2)
 #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_TIOCGPTPEER      TARGET_IO('T', 0x41) /* Safely open the slave */
-- 
2.7.4



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

* Re: [PATCH 0/4] linux-user: Fix some issues in termbits.h files
  2020-01-17  2:11 [PATCH 0/4] linux-user: Fix some issues in termbits.h files Aleksandar Markovic
                   ` (3 preceding siblings ...)
  2020-01-17  2:11 ` [PATCH 4/4] linux-user: Fix some constants in remaining termbits.h Aleksandar Markovic
@ 2020-01-17 10:12 ` no-reply
  2020-01-28 18:19 ` Laurent Vivier
  5 siblings, 0 replies; 10+ messages in thread
From: no-reply @ 2020-01-17 10:12 UTC (permalink / raw)
  To: aleksandar.markovic; +Cc: qemu-devel, amarkovic, laurent

Patchew URL: https://patchew.org/QEMU/1579227117-6310-1-git-send-email-aleksandar.markovic@rt-rk.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 1579227117-6310-1-git-send-email-aleksandar.markovic@rt-rk.com
Type: series
Subject: [PATCH 0/4] linux-user: Fix some issues in termbits.h files 

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

From https://github.com/patchew-project/qemu
 * [new tag]         patchew/1579227117-6310-1-git-send-email-aleksandar.markovic@rt-rk.com -> patchew/1579227117-6310-1-git-send-email-aleksandar.markovic@rt-rk.com
Switched to a new branch 'test'
2a18394 linux-user: Fix some constants in remaining termbits.h
11acaf6 linux-user: xtensa: Fix some constants in termbits.h
5f64098 linux-user: mips: Synchronize termbits.h with kernel
0d5231a linux-user: alpha: Synchronize termbits.h with kernel

=== OUTPUT BEGIN ===
1/4 Checking commit 0d5231a5c58f (linux-user: alpha: Synchronize termbits.h with kernel)
2/4 Checking commit 5f640980e8f3 (linux-user: mips: Synchronize termbits.h with kernel)
ERROR: if this code is redundant consider removing it
#83: FILE: linux-user/mips/termbits.h:60:
+#if 0

total: 1 errors, 0 warnings, 187 lines checked

Patch 2/4 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

3/4 Checking commit 11acaf6b0460 (linux-user: xtensa: Fix some constants in termbits.h)
4/4 Checking commit 2a18394b0d3c (linux-user: Fix some constants in remaining termbits.h)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/1579227117-6310-1-git-send-email-aleksandar.markovic@rt-rk.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [PATCH 0/4] linux-user: Fix some issues in termbits.h files
  2020-01-17  2:11 [PATCH 0/4] linux-user: Fix some issues in termbits.h files Aleksandar Markovic
                   ` (4 preceding siblings ...)
  2020-01-17 10:12 ` [PATCH 0/4] linux-user: Fix some issues in termbits.h files no-reply
@ 2020-01-28 18:19 ` Laurent Vivier
  2020-03-19 16:24   ` Aleksandar Markovic
  5 siblings, 1 reply; 10+ messages in thread
From: Laurent Vivier @ 2020-01-28 18:19 UTC (permalink / raw)
  To: Aleksandar Markovic, qemu-devel; +Cc: amarkovic

Le 17/01/2020 à 03:11, Aleksandar Markovic a écrit :
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
> 
> This series is a spin-off of v5 of earlier series "linux-user: Misc
> patches for 5.0", that became too large to manage. I will submit the
> rest of that large series separately.
> 
> Files linux-user/<target>/termbits.h seem to be in a very bad shape:
> unsynchronized with kernel, containing wrong elements expressed in
> terms of host instead of target, many being updated wrt kernel
> content at various times, and on top of that all contain visually
> very ugly combinations of tabs and spaces.
> 
> This series attempts to fix great majority of issues in termbits.
> 
> Alpha's and mips' termbits.h were in the worst shape, missing large
> bits and pieces, and for them as complete as possible synchronization
> with kernel code is done - this constitutes the first two patches.
> 
> Xtensa's termbits.h contained the most elements wrongly expressed in
> terms of host instead of target, and that is the reason the changes
> in this file are placed in a separate, third, patch. Previous "R-B"
> given by Max Filippov was transferred to this patch only.
> 
> The fourth patch fixes remaining elements wrongly expressed in
> terms of host instead of target.
> 
> As an additional note, structures "serial_iso7816" and "serial_rs485"
> (at times mentioned as the third argument of certain ioctls) are
> platform-independant in kernel, and do not need "target_" variant
> in QEMU. Also, structure "winsize" (also appearing as the third
> ioctl's argument at times) is defined at multiple places in kernel
> (for several architectures) in kernel, but all such definitions are
> identical, and, therefore, it also does not need "target_" variant
> in QEMU.
> 
> A checkpatch warning related to "#if 0" in patch 2 is benign, and
> should be ignored.
> 
> Aleksandar Markovic (4):
>   linux-user: alpha: Synchronize termbits.h with kernel
>   linux-user: mips: Synchronize termbits.h with kernel
>   linux-user: xtensa: Fix some constants in termbits.h
>   linux-user: Fix some constants in remaining termbits.h
> 
>  linux-user/aarch64/termbits.h    |   4 +-
>  linux-user/alpha/termbits.h      |  82 ++++++++++++++--
>  linux-user/arm/termbits.h        |   4 +-
>  linux-user/cris/termbits.h       |   4 +-
>  linux-user/hppa/termbits.h       |   4 +-
>  linux-user/i386/termbits.h       |   4 +-
>  linux-user/m68k/termbits.h       |   4 +-
>  linux-user/microblaze/termbits.h |   4 +-
>  linux-user/mips/termbits.h       | 140 ++++++++++++++++----------
>  linux-user/nios2/termbits.h      |   4 +-
>  linux-user/openrisc/termbits.h   |  14 +--
>  linux-user/ppc/termbits.h        |   4 +-
>  linux-user/riscv/termbits.h      |   4 +-
>  linux-user/s390x/termbits.h      |  26 ++---
>  linux-user/sh4/termbits.h        |   4 +-
>  linux-user/sparc/termbits.h      |   4 +-
>  linux-user/sparc64/termbits.h    |   4 +-
>  linux-user/tilegx/termbits.h     |  12 ++-
>  linux-user/x86_64/termbits.h     |  26 +++--
>  linux-user/xtensa/termbits.h     | 207 +++++++++++++++++++++------------------
>  20 files changed, 353 insertions(+), 206 deletions(-)
> 

I think we should first introduce a linux-user/generic/termbits.h as we
have an asm-generic/termbits.h in the kernel and use it with all the
targets except alpha, mips, hppa, sparc and xtensa.

I think this linux-user/generic/termbits.h could be copied from
linux-user/openrisc/termbits.h (without the ioctl definitions)

Then you could update the remaining ones.

Thanks,
Laurent


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

* Re: [PATCH 0/4] linux-user: Fix some issues in termbits.h files
  2020-01-28 18:19 ` Laurent Vivier
@ 2020-03-19 16:24   ` Aleksandar Markovic
  2020-03-19 16:34     ` Laurent Vivier
  0 siblings, 1 reply; 10+ messages in thread
From: Aleksandar Markovic @ 2020-03-19 16:24 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: Aleksandar Markovic, QEMU Developers, Aleksandar Markovic

> I think we should first introduce a linux-user/generic/termbits.h as we
> have an asm-generic/termbits.h in the kernel and use it with all the
> targets except alpha, mips, hppa, sparc and xtensa.
>
> I think this linux-user/generic/termbits.h could be copied from
> linux-user/openrisc/termbits.h (without the ioctl definitions)
>
> Then you could update the remaining ones.
>

I agree with you, Laurent, that would be the cleanest
implementation.

However, I think it requires at least several days of meticulous
dev work, that I can't afford at this moment. May I ask you to
accept this series as is for 5.0, as a sort of bridge towards
the implementation you described? It certainly fixes a majority
of termbits-related bugs, many of them remained latent just
by fact that XXX and TARGET_XXX were identical. The most
affected targets, xtensa, mips and alpha should be cleaned up
by this series wrt termbits, and for great majority of issues
are cleaned up for all platforms.

I just don't have enough time resources to additionally
devote to this problem.

Sincerely,
Aleksandar

> Thanks,
> Laurent
>


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

* Re: [PATCH 0/4] linux-user: Fix some issues in termbits.h files
  2020-03-19 16:24   ` Aleksandar Markovic
@ 2020-03-19 16:34     ` Laurent Vivier
  2020-03-19 19:02       ` Aleksandar Markovic
  0 siblings, 1 reply; 10+ messages in thread
From: Laurent Vivier @ 2020-03-19 16:34 UTC (permalink / raw)
  To: Aleksandar Markovic
  Cc: Aleksandar Markovic, QEMU Developers, Aleksandar Markovic

Le 19/03/2020 à 17:24, Aleksandar Markovic a écrit :
>> I think we should first introduce a linux-user/generic/termbits.h as we
>> have an asm-generic/termbits.h in the kernel and use it with all the
>> targets except alpha, mips, hppa, sparc and xtensa.
>>
>> I think this linux-user/generic/termbits.h could be copied from
>> linux-user/openrisc/termbits.h (without the ioctl definitions)
>>
>> Then you could update the remaining ones.
>>
> 
> I agree with you, Laurent, that would be the cleanest
> implementation.
> 
> However, I think it requires at least several days of meticulous
> dev work, that I can't afford at this moment. May I ask you to
> accept this series as is for 5.0, as a sort of bridge towards
> the implementation you described? It certainly fixes a majority
> of termbits-related bugs, many of them remained latent just
> by fact that XXX and TARGET_XXX were identical. The most
> affected targets, xtensa, mips and alpha should be cleaned up
> by this series wrt termbits, and for great majority of issues
> are cleaned up for all platforms.
> 
> I just don't have enough time resources to additionally
> devote to this problem.

ok, but I need to review and test them, I don't know if I will have
enough time for that. I will try...

Thanks,
Laurent


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

* Re: [PATCH 0/4] linux-user: Fix some issues in termbits.h files
  2020-03-19 16:34     ` Laurent Vivier
@ 2020-03-19 19:02       ` Aleksandar Markovic
  0 siblings, 0 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-03-19 19:02 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: Aleksandar Markovic, QEMU Developers, Aleksandar Markovic

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

On Thursday, March 19, 2020, Laurent Vivier <laurent@vivier.eu> wrote:

> Le 19/03/2020 à 17:24, Aleksandar Markovic a écrit :
> >> I think we should first introduce a linux-user/generic/termbits.h as we
> >> have an asm-generic/termbits.h in the kernel and use it with all the
> >> targets except alpha, mips, hppa, sparc and xtensa.
> >>
> >> I think this linux-user/generic/termbits.h could be copied from
> >> linux-user/openrisc/termbits.h (without the ioctl definitions)
> >>
> >> Then you could update the remaining ones.
> >>
> >
> > I agree with you, Laurent, that would be the cleanest
> > implementation.
> >
> > However, I think it requires at least several days of meticulous
> > dev work, that I can't afford at this moment. May I ask you to
> > accept this series as is for 5.0, as a sort of bridge towards
> > the implementation you described? It certainly fixes a majority
> > of termbits-related bugs, many of them remained latent just
> > by fact that XXX and TARGET_XXX were identical. The most
> > affected targets, xtensa, mips and alpha should be cleaned up
> > by this series wrt termbits, and for great majority of issues
> > are cleaned up for all platforms.
> >
> > I just don't have enough time resources to additionally
> > devote to this problem.
>
> ok, but I need to review and test them, I don't know if I will have
> enough time for that. I will try...
>
>
OK, thanks!

Aleksandar



> Thanks,
> Laurent
>

[-- Attachment #2: Type: text/html, Size: 2015 bytes --]

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

end of thread, other threads:[~2020-03-19 19:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17  2:11 [PATCH 0/4] linux-user: Fix some issues in termbits.h files Aleksandar Markovic
2020-01-17  2:11 ` [PATCH 1/4] linux-user: alpha: Synchronize termbits.h with kernel Aleksandar Markovic
2020-01-17  2:11 ` [PATCH 2/4] linux-user: mips: " Aleksandar Markovic
2020-01-17  2:11 ` [PATCH 3/4] linux-user: xtensa: Fix some constants in termbits.h Aleksandar Markovic
2020-01-17  2:11 ` [PATCH 4/4] linux-user: Fix some constants in remaining termbits.h Aleksandar Markovic
2020-01-17 10:12 ` [PATCH 0/4] linux-user: Fix some issues in termbits.h files no-reply
2020-01-28 18:19 ` Laurent Vivier
2020-03-19 16:24   ` Aleksandar Markovic
2020-03-19 16:34     ` Laurent Vivier
2020-03-19 19:02       ` Aleksandar Markovic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.