From: deller@kernel.org
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: "Laurent Vivier" <laurent@vivier.eu>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
deller@gmx.de, "Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 06/11] linux-user: Add termios2 support to sh4 target
Date: Fri, 23 Jan 2026 21:52:25 +0100 [thread overview]
Message-ID: <20260123205230.33541-7-deller@kernel.org> (raw)
In-Reply-To: <20260123205230.33541-1-deller@kernel.org>
From: Luca Bonissi <qemu@bonslack.org>
Signed-off-by: Luca Bonissi <qemu@bonslack.org>
Link: https://lore.kernel.org/qemu-devel/642b32de-2985-45d2-bbdf-c0b2e3ea0551@bonslack.org
Reviewed-by: Helge Deller <deller@gmx.de>
---
linux-user/sh4/termbits.h | 46 +++++++++++++++++++++++++++++----------
1 file changed, 34 insertions(+), 12 deletions(-)
diff --git a/linux-user/sh4/termbits.h b/linux-user/sh4/termbits.h
index 28e79f2c9a..cab6b1299e 100644
--- a/linux-user/sh4/termbits.h
+++ b/linux-user/sh4/termbits.h
@@ -18,6 +18,28 @@ 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 */
+};
+
+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 characters */
#define TARGET_VINTR 0
@@ -251,14 +273,17 @@ struct target_termios {
#define TARGET_TIOCNOTTY TARGET_IO('T', 34) /* 0x5422 */
#define TARGET_TIOCSETD TARGET_IOW('T', 35, int) /* 0x5423 */
#define TARGET_TIOCGETD TARGET_IOR('T', 36, int) /* 0x5424 */
-#define TARGET_TCSBRKP TARGET_IOW('T', 37, int) /* 0x5425 */ /* Needed for POSIX tcse
-ndbreak() */
+#define TARGET_TCSBRKP TARGET_IOW('T', 37, int) /* 0x5425 */ /* Needed for POSIX tcsendbreak() */
#define TARGET_TIOCSBRK TARGET_IO('T', 39) /* 0x5427 */ /* BSD compatibility */
#define TARGET_TIOCCBRK TARGET_IO('T', 40) /* 0x5428 */ /* BSD compatibility */
-#define TARGET_TIOCGSID TARGET_IOR('T', 41, pid_t) /* 0x5429 */ /* Return the session
-ID of FD */
-#define TARGET_TIOCGPTN TARGET_IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-m
-ux device) */
+#define TARGET_TIOCGSID TARGET_IOR('T', 41, pid_t) /* 0x5429 */ /* Return the session ID of FD */
+#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) */
#define TARGET_TIOCSPTLCK TARGET_IOW('T',0x31, int) /* Lock/unlock Pty */
#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41) /* Safely open the slave */
@@ -270,8 +295,7 @@ ux device) */
#define TARGET_TIOCSLCKTRMIOS 0x5457
#define TARGET_TIOCSERGSTRUCT TARGET_IOR('T', 88, int) /* 0x5458 */ /* For d
ebugging only */
-#define TARGET_TIOCSERGETLSR TARGET_IOR('T', 89, unsigned int) /* 0x5459 */ /* Get line sta
-tus register */
+#define TARGET_TIOCSERGETLSR TARGET_IOR('T', 89, unsigned int) /* 0x5459 */ /* Get line status register */
/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
# define TARGET_TIOCSER_TEMT 0x01 /* Transmitter physically empty */
#define TARGET_TIOCSERGETMULTI TARGET_IOR('T', 90, int) /* 0x545A
@@ -279,9 +303,7 @@ tus register */
#define TARGET_TIOCSERSETMULTI TARGET_IOW('T', 91, int) /* 0x545B
*/ /* Set multiport config */
-#define TARGET_TIOCMIWAIT TARGET_IO('T', 92) /* 0x545C */ /* wait for a change on
-serial input line(s) */
-#define TARGET_TIOCGICOUNT TARGET_IOR('T', 93, int) /* 0x545D */ /* read
-serial port inline interrupt counts */
+#define TARGET_TIOCMIWAIT TARGET_IO('T', 92) /* 0x545C */ /* wait for a change on serial input line(s) */
+#define TARGET_TIOCGICOUNT TARGET_IOR('T', 93, int) /* 0x545D */ /* read serial port inline interrupt counts */
#endif
--
2.52.0
next prev parent reply other threads:[~2026-01-23 20:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 20:52 [PULL 00/11] Linux user for v11 patches deller
2026-01-23 20:52 ` [PULL 01/11] linux-user: update statx emulation deller
2026-01-23 20:52 ` [PULL 02/11] linux-user: Add termios2 support deller
2026-01-23 20:52 ` [PULL 03/11] linux-user: Add termios2 support to alpha target deller
2026-01-23 20:52 ` [PULL 04/11] linux-user: Add termios2 support to hppa target deller
2026-01-23 20:52 ` [PULL 05/11] linux-user: Add termios2 support to mips target deller
2026-01-23 20:52 ` deller [this message]
2026-01-23 20:52 ` [PULL 07/11] linux-user: Add termios2 support to sparc target deller
2026-01-23 20:52 ` [PULL 08/11] linux-user: Add missing termios baud rates deller
2026-01-23 20:52 ` [PULL 09/11] linux-user: fixup termios2 related things on PowerPC deller
2026-01-23 20:52 ` [PULL 10/11] linux-user: strace: Fix 5th argument of futex syscall deller
2026-01-23 20:52 ` [PULL 11/11] linux-user: Fix MADV_XXX constants on hppa target deller
2026-01-24 0:56 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260123205230.33541-7-deller@kernel.org \
--to=deller@kernel.org \
--cc=deller@gmx.de \
--cc=jiaxun.yang@flygoat.com \
--cc=laurent@vivier.eu \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.