mirror of
https://github.com/qemu/qemu.git
synced 2026-04-05 21:50:33 +00:00
linux-user: Add missing termios baud rates
Add several missing baud rates and inputs baud rates in cflag_tbl. Add these missing definitions in termbits.h: - TARGET_BOTHER for alpha, hppa, ppc, sh4, sparc - TARGET_IBSHIFT for hppa, mips, ppc, sh4, sparc - Missing standard baud rates for hppa These are required for the glibc test tst-termios-linux. Link: https://lore.kernel.org/qemu-devel/20251203-linux-user-higher-baud-rates-v2-1-e45b35224437@iscas.ac.cn Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn> Reviewed-by: Helge Deller <deller@gmx.de>
This commit is contained in:
committed by
Helge Deller
parent
947b971cad
commit
4f22fcb5c6
@@ -149,6 +149,7 @@ struct target_ktermios {
|
||||
#define TARGET_B3000000 00034
|
||||
#define TARGET_B3500000 00035
|
||||
#define TARGET_B4000000 00036
|
||||
#define TARGET_BOTHER 00037
|
||||
|
||||
#define TARGET_CSIZE 00001400
|
||||
#define TARGET_CS5 00000000
|
||||
|
||||
@@ -157,7 +157,7 @@ struct target_ktermios {
|
||||
#define TARGET_B3000000 0010015
|
||||
#define TARGET_B3500000 0010016
|
||||
#define TARGET_B4000000 0010017
|
||||
#define TARGET_CIBAUD 002003600000 /* input baud rate (not used) */
|
||||
#define TARGET_CIBAUD 002003600000 /* input baud rate */
|
||||
#define TARGET_CMSPAR 010000000000 /* mark or space (stick) parity */
|
||||
#define TARGET_CRTSCTS 020000000000 /* flow control */
|
||||
|
||||
|
||||
@@ -123,14 +123,28 @@ struct target_ktermios {
|
||||
#define TARGET_HUPCL 0002000
|
||||
#define TARGET_CLOCAL 0004000
|
||||
#define TARGET_CBAUDEX 0010000
|
||||
#define TARGET_BOTHER 0010000
|
||||
#define TARGET_B57600 0010001
|
||||
#define TARGET_B115200 0010002
|
||||
#define TARGET_B230400 0010003
|
||||
#define TARGET_B460800 0010004
|
||||
#define TARGET_CIBAUD 002003600000 /* input baud rate (not used) */
|
||||
#define TARGET_B500000 0010005
|
||||
#define TARGET_B576000 0010006
|
||||
#define TARGET_B921600 0010007
|
||||
#define TARGET_B1000000 0010010
|
||||
#define TARGET_B1152000 0010011
|
||||
#define TARGET_B1500000 0010012
|
||||
#define TARGET_B2000000 0010013
|
||||
#define TARGET_B2500000 0010014
|
||||
#define TARGET_B3000000 0010015
|
||||
#define TARGET_B3500000 0010016
|
||||
#define TARGET_B4000000 0010017
|
||||
#define TARGET_CIBAUD 002003600000 /* input baud rate */
|
||||
#define TARGET_CMSPAR 010000000000 /* mark or space (stick) parity */
|
||||
#define TARGET_CRTSCTS 020000000000 /* flow control */
|
||||
|
||||
#define TARGET_IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
|
||||
|
||||
/* c_lflag bits */
|
||||
#define TARGET_ISIG 0000001
|
||||
#define TARGET_ICANON 0000002
|
||||
|
||||
@@ -139,10 +139,12 @@ struct target_ktermios {
|
||||
#define TARGET_B3000000 0010015
|
||||
#define TARGET_B3500000 0010016
|
||||
#define TARGET_B4000000 0010017
|
||||
#define TARGET_CIBAUD 002003600000 /* input baud rate (not used) */
|
||||
#define TARGET_CIBAUD 002003600000 /* input baud rate */
|
||||
#define TARGET_CMSPAR 010000000000 /* mark or space (stick) parity */
|
||||
#define TARGET_CRTSCTS 020000000000 /* flow control */
|
||||
|
||||
#define TARGET_IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
|
||||
|
||||
/* c_lflag bits */
|
||||
#define TARGET_ISIG 0000001
|
||||
#define TARGET_ICANON 0000002
|
||||
|
||||
@@ -129,6 +129,7 @@ struct target_termios {
|
||||
#define TARGET_B3000000 00034
|
||||
#define TARGET_B3500000 00035
|
||||
#define TARGET_B4000000 00036
|
||||
#define TARGET_BOTHER 00037
|
||||
|
||||
#define TARGET_CSIZE 00001400
|
||||
#define TARGET_CS5 00000000
|
||||
|
||||
@@ -142,6 +142,7 @@ struct target_ktermios {
|
||||
#define TARGET_HUPCL 0002000
|
||||
#define TARGET_CLOCAL 0004000
|
||||
#define TARGET_CBAUDEX 0010000
|
||||
#define TARGET_BOTHER 0010000
|
||||
#define TARGET_B57600 0010001
|
||||
#define TARGET_B115200 0010002
|
||||
#define TARGET_B230400 0010003
|
||||
@@ -157,10 +158,12 @@ struct target_ktermios {
|
||||
#define TARGET_B3000000 0010015
|
||||
#define TARGET_B3500000 0010016
|
||||
#define TARGET_B4000000 0010017
|
||||
#define TARGET_CIBAUD 002003600000 /* input baud rate (not used) */
|
||||
#define TARGET_CIBAUD 002003600000 /* input baud rate */
|
||||
#define TARGET_CMSPAR 010000000000 /* mark or space (stick) parity */
|
||||
#define TARGET_CRTSCTS 020000000000 /* flow control */
|
||||
|
||||
#define TARGET_IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
|
||||
|
||||
/* c_lflag bits */
|
||||
#define TARGET_ISIG 0000001
|
||||
#define TARGET_ICANON 0000002
|
||||
|
||||
@@ -150,6 +150,7 @@ struct target_ktermios {
|
||||
#define TARGET_HUPCL 0x00000400
|
||||
#define TARGET_CLOCAL 0x00000800
|
||||
#define TARGET_CBAUDEX 0x00001000
|
||||
#define TARGET_BOTHER 0x00001000
|
||||
/* We'll never see these speeds with the Zilogs, but for completeness... */
|
||||
#define TARGET_B57600 0x00001001
|
||||
#define TARGET_B115200 0x00001002
|
||||
@@ -176,10 +177,12 @@ struct target_ktermios {
|
||||
#define B3000000 0x00001011
|
||||
#define B3500000 0x00001012
|
||||
#define B4000000 0x00001013 */
|
||||
#define TARGET_CIBAUD 0x100f0000 /* input baud rate (not used) */
|
||||
#define TARGET_CIBAUD 0x100f0000 /* input baud rate */
|
||||
#define TARGET_CMSPAR 0x40000000 /* mark or space (stick) parity */
|
||||
#define TARGET_CRTSCTS 0x80000000 /* flow control */
|
||||
|
||||
#define TARGET_IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
|
||||
|
||||
/* c_lflag bits */
|
||||
#define TARGET_ISIG 0x00000001
|
||||
#define TARGET_ICANON 0x00000002
|
||||
|
||||
@@ -5762,27 +5762,70 @@ static const bitmask_transtbl oflag_tbl[] = {
|
||||
{ TARGET_FFDLY, TARGET_FF1, FFDLY, FF1 },
|
||||
};
|
||||
|
||||
#if defined(TARGET_CIBAUD) && defined(CIBAUD)
|
||||
|
||||
# define BAUD_TRANSTBL(baud) \
|
||||
{ TARGET_CBAUD, TARGET_##baud, CBAUD, baud }, \
|
||||
{ TARGET_CIBAUD, TARGET_##baud << TARGET_IBSHIFT, CIBAUD, baud << IBSHIFT },
|
||||
|
||||
#else
|
||||
|
||||
/* Alpha in particular does not have CIBAUD/IBSHIFT */
|
||||
|
||||
# define BAUD_TRANSTBL(baud) \
|
||||
{ TARGET_CBAUD, TARGET_##baud, CBAUD, baud },
|
||||
|
||||
#endif
|
||||
|
||||
static const bitmask_transtbl cflag_tbl[] = {
|
||||
{ TARGET_CBAUD, TARGET_B0, CBAUD, B0 },
|
||||
{ TARGET_CBAUD, TARGET_B50, CBAUD, B50 },
|
||||
{ TARGET_CBAUD, TARGET_B75, CBAUD, B75 },
|
||||
{ TARGET_CBAUD, TARGET_B110, CBAUD, B110 },
|
||||
{ TARGET_CBAUD, TARGET_B134, CBAUD, B134 },
|
||||
{ TARGET_CBAUD, TARGET_B150, CBAUD, B150 },
|
||||
{ TARGET_CBAUD, TARGET_B200, CBAUD, B200 },
|
||||
{ TARGET_CBAUD, TARGET_B300, CBAUD, B300 },
|
||||
{ TARGET_CBAUD, TARGET_B600, CBAUD, B600 },
|
||||
{ TARGET_CBAUD, TARGET_B1200, CBAUD, B1200 },
|
||||
{ TARGET_CBAUD, TARGET_B1800, CBAUD, B1800 },
|
||||
{ TARGET_CBAUD, TARGET_B2400, CBAUD, B2400 },
|
||||
{ TARGET_CBAUD, TARGET_B4800, CBAUD, B4800 },
|
||||
{ TARGET_CBAUD, TARGET_B9600, CBAUD, B9600 },
|
||||
{ TARGET_CBAUD, TARGET_B19200, CBAUD, B19200 },
|
||||
{ TARGET_CBAUD, TARGET_B38400, CBAUD, B38400 },
|
||||
{ TARGET_CBAUD, TARGET_B57600, CBAUD, B57600 },
|
||||
{ TARGET_CBAUD, TARGET_B115200, CBAUD, B115200 },
|
||||
{ TARGET_CBAUD, TARGET_B230400, CBAUD, B230400 },
|
||||
{ TARGET_CBAUD, TARGET_B460800, CBAUD, B460800 },
|
||||
BAUD_TRANSTBL(B0)
|
||||
BAUD_TRANSTBL(B50)
|
||||
BAUD_TRANSTBL(B75)
|
||||
BAUD_TRANSTBL(B110)
|
||||
BAUD_TRANSTBL(B134)
|
||||
BAUD_TRANSTBL(B150)
|
||||
BAUD_TRANSTBL(B200)
|
||||
BAUD_TRANSTBL(B300)
|
||||
BAUD_TRANSTBL(B600)
|
||||
BAUD_TRANSTBL(B1200)
|
||||
BAUD_TRANSTBL(B1800)
|
||||
BAUD_TRANSTBL(B2400)
|
||||
BAUD_TRANSTBL(B4800)
|
||||
BAUD_TRANSTBL(B9600)
|
||||
BAUD_TRANSTBL(B19200)
|
||||
BAUD_TRANSTBL(B38400)
|
||||
BAUD_TRANSTBL(B57600)
|
||||
BAUD_TRANSTBL(B115200)
|
||||
BAUD_TRANSTBL(B230400)
|
||||
BAUD_TRANSTBL(B460800)
|
||||
BAUD_TRANSTBL(B500000)
|
||||
BAUD_TRANSTBL(B576000)
|
||||
BAUD_TRANSTBL(B921600)
|
||||
BAUD_TRANSTBL(B1000000)
|
||||
BAUD_TRANSTBL(B1152000)
|
||||
BAUD_TRANSTBL(B1500000)
|
||||
BAUD_TRANSTBL(B2000000)
|
||||
|
||||
BAUD_TRANSTBL(BOTHER)
|
||||
|
||||
/* SPARC in particular is missing these higher baud rates */
|
||||
|
||||
#if defined(TARGET_B2500000) && defined(B2500000)
|
||||
BAUD_TRANSTBL(B2500000)
|
||||
#endif
|
||||
|
||||
#if defined(TARGET_B3000000) && defined(B3000000)
|
||||
BAUD_TRANSTBL(B3000000)
|
||||
#endif
|
||||
|
||||
#if defined(TARGET_B3500000) && defined(B3500000)
|
||||
BAUD_TRANSTBL(B3500000)
|
||||
#endif
|
||||
|
||||
#if defined(TARGET_B4000000) && defined(B4000000)
|
||||
BAUD_TRANSTBL(B4000000)
|
||||
#endif
|
||||
|
||||
{ TARGET_CSIZE, TARGET_CS5, CSIZE, CS5 },
|
||||
{ TARGET_CSIZE, TARGET_CS6, CSIZE, CS6 },
|
||||
{ TARGET_CSIZE, TARGET_CS7, CSIZE, CS7 },
|
||||
|
||||
Reference in New Issue
Block a user