From: Andreas Schwab <schwab@linux-m68k.org>
To: Luca Bonissi <qemu@bonslack.org>
Cc: Richard Henderson <richard.henderson@linaro.org>,
Laurent Vivier <laurent@vivier.eu>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 1/7] Add termios2 support to linux-user
Date: Sun, 31 Aug 2025 15:45:38 +0200 [thread overview]
Message-ID: <87y0qzzjst.fsf@igel.home> (raw)
In-Reply-To: <4bfb150f-7f5a-459b-808f-b0d1abc3b830@bonslack.org> (Luca Bonissi's message of "Sat, 30 Aug 2025 15:14:56 +0200")
On Aug 30 2025, Luca Bonissi wrote:
> @@ -5887,6 +5888,85 @@ static const StructEntry struct_termios_def = {
> .print = print_termios,
> };
>
> +#ifdef TARGET_TCGETS2
> +static void target_to_host_termios2 (void *dst, const void *src)
> +{
> + struct host_termios2 *host = dst;
> + const struct target_termios2 *target = src;
> +
> + host->c_iflag =
> + target_to_host_bitmask(tswap32(target->c_iflag), iflag_tbl);
> + host->c_oflag =
> + target_to_host_bitmask(tswap32(target->c_oflag), oflag_tbl);
> + host->c_cflag =
> + target_to_host_bitmask(tswap32(target->c_cflag), cflag_tbl);
> + host->c_lflag =
> + target_to_host_bitmask(tswap32(target->c_lflag), lflag_tbl);
> + host->c_line = target->c_line;
> +
> + memset(host->c_cc, 0, sizeof(host->c_cc));
> + host->c_cc[VINTR] = target->c_cc[TARGET_VINTR];
> + host->c_cc[VQUIT] = target->c_cc[TARGET_VQUIT];
> + host->c_cc[VERASE] = target->c_cc[TARGET_VERASE];
> + host->c_cc[VKILL] = target->c_cc[TARGET_VKILL];
> + host->c_cc[VEOF] = target->c_cc[TARGET_VEOF];
> + host->c_cc[VTIME] = target->c_cc[TARGET_VTIME];
> + host->c_cc[VMIN] = target->c_cc[TARGET_VMIN];
> + host->c_cc[VSWTC] = target->c_cc[TARGET_VSWTC];
> + host->c_cc[VSTART] = target->c_cc[TARGET_VSTART];
> + host->c_cc[VSTOP] = target->c_cc[TARGET_VSTOP];
> + host->c_cc[VSUSP] = target->c_cc[TARGET_VSUSP];
> + host->c_cc[VEOL] = target->c_cc[TARGET_VEOL];
> + host->c_cc[VREPRINT] = target->c_cc[TARGET_VREPRINT];
> + host->c_cc[VDISCARD] = target->c_cc[TARGET_VDISCARD];
> + host->c_cc[VWERASE] = target->c_cc[TARGET_VWERASE];
> + host->c_cc[VLNEXT] = target->c_cc[TARGET_VLNEXT];
> + host->c_cc[VEOL2] = target->c_cc[TARGET_VEOL2];
> +}
> +
> +static void host_to_target_termios2 (void *dst, const void *src)
> +{
> + struct target_termios2 *target = dst;
> + const struct host_termios2 *host = src;
> +
> + target->c_iflag =
> + tswap32(host_to_target_bitmask(host->c_iflag, iflag_tbl));
> + target->c_oflag =
> + tswap32(host_to_target_bitmask(host->c_oflag, oflag_tbl));
> + target->c_cflag =
> + tswap32(host_to_target_bitmask(host->c_cflag, cflag_tbl));
> + target->c_lflag =
> + tswap32(host_to_target_bitmask(host->c_lflag, lflag_tbl));
> + target->c_line = host->c_line;
> +
> + memset(target->c_cc, 0, sizeof(target->c_cc));
> + target->c_cc[TARGET_VINTR] = host->c_cc[VINTR];
> + target->c_cc[TARGET_VQUIT] = host->c_cc[VQUIT];
> + target->c_cc[TARGET_VERASE] = host->c_cc[VERASE];
> + target->c_cc[TARGET_VKILL] = host->c_cc[VKILL];
> + target->c_cc[TARGET_VEOF] = host->c_cc[VEOF];
> + target->c_cc[TARGET_VTIME] = host->c_cc[VTIME];
> + target->c_cc[TARGET_VMIN] = host->c_cc[VMIN];
> + target->c_cc[TARGET_VSWTC] = host->c_cc[VSWTC];
> + target->c_cc[TARGET_VSTART] = host->c_cc[VSTART];
> + target->c_cc[TARGET_VSTOP] = host->c_cc[VSTOP];
> + target->c_cc[TARGET_VSUSP] = host->c_cc[VSUSP];
> + target->c_cc[TARGET_VEOL] = host->c_cc[VEOL];
> + target->c_cc[TARGET_VREPRINT] = host->c_cc[VREPRINT];
> + target->c_cc[TARGET_VDISCARD] = host->c_cc[VDISCARD];
> + target->c_cc[TARGET_VWERASE] = host->c_cc[VWERASE];
> + target->c_cc[TARGET_VLNEXT] = host->c_cc[VLNEXT];
> + target->c_cc[TARGET_VEOL2] = host->c_cc[VEOL2];
> +}
That fails to copy c_[io]speed.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
next prev parent reply other threads:[~2025-08-31 13:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-30 13:14 [PATCH 1/7] Add termios2 support to linux-user Luca Bonissi
2025-08-31 13:45 ` Andreas Schwab [this message]
2025-10-31 12:42 ` Luca Bonissi
-- strict thread matches above, loose matches on Subject: below --
2025-10-31 13:23 Luca Bonissi
2025-11-02 10:29 ` Andreas Schwab
2025-12-03 12:15 ` Daniel P. Berrangé
2025-12-03 14:37 ` Luca Bonissi
2025-12-04 12:48 ` Heinrich Schuchardt
2025-12-15 16:42 ` Icenowy Zheng
2025-12-16 6:26 ` Icenowy Zheng
2025-12-15 16:44 ` Icenowy Zheng
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=87y0qzzjst.fsf@igel.home \
--to=schwab@linux-m68k.org \
--cc=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=qemu@bonslack.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.