From 1d5d66825610bb7be23e2229731261c8e99eaa28 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 20 Aug 2022 19:36:09 -0400 Subject: termios: uninline conversion helpers default go into drivers/tty/tty_ioctl.c, unusual - into arch/*/kernel/termios.c (only alpha and sparc have those). Signed-off-by: Al Viro Link: https://lore.kernel.org/r/YxDmeUBHo0s/Ew8b@ZenIV Signed-off-by: Greg Kroah-Hartman --- arch/alpha/include/asm/termios.h | 77 ++++------------------------------------ 1 file changed, 6 insertions(+), 71 deletions(-) (limited to 'arch/alpha/include') diff --git a/arch/alpha/include/asm/termios.h b/arch/alpha/include/asm/termios.h index b7c77bb1bfd2..bafbb0090024 100644 --- a/arch/alpha/include/asm/termios.h +++ b/arch/alpha/include/asm/termios.h @@ -12,76 +12,11 @@ */ #define INIT_C_CC "\004\000\000\177\027\025\022\000\003\034\032\000\021\023\026\025\001\000" -/* - * Translate a "termio" structure into a "termios". Ugh. - */ - -#define user_termio_to_kernel_termios(a_termios, u_termio) \ -({ \ - struct ktermios *k_termios = (a_termios); \ - struct termio k_termio; \ - int canon, ret; \ - \ - ret = copy_from_user(&k_termio, u_termio, sizeof(k_termio)); \ - if (!ret) { \ - /* Overwrite only the low bits. */ \ - *(unsigned short *)&k_termios->c_iflag = k_termio.c_iflag; \ - *(unsigned short *)&k_termios->c_oflag = k_termio.c_oflag; \ - *(unsigned short *)&k_termios->c_cflag = k_termio.c_cflag; \ - *(unsigned short *)&k_termios->c_lflag = k_termio.c_lflag; \ - canon = k_termio.c_lflag & ICANON; \ - \ - k_termios->c_cc[VINTR] = k_termio.c_cc[_VINTR]; \ - k_termios->c_cc[VQUIT] = k_termio.c_cc[_VQUIT]; \ - k_termios->c_cc[VERASE] = k_termio.c_cc[_VERASE]; \ - k_termios->c_cc[VKILL] = k_termio.c_cc[_VKILL]; \ - k_termios->c_cc[VEOL2] = k_termio.c_cc[_VEOL2]; \ - k_termios->c_cc[VSWTC] = k_termio.c_cc[_VSWTC]; \ - k_termios->c_cc[canon ? VEOF : VMIN] = k_termio.c_cc[_VEOF]; \ - k_termios->c_cc[canon ? VEOL : VTIME] = k_termio.c_cc[_VEOL]; \ - } \ - ret; \ -}) - -/* - * Translate a "termios" structure into a "termio". Ugh. - * - * Note the "fun" _VMIN overloading. - */ -#define kernel_termios_to_user_termio(u_termio, a_termios) \ -({ \ - struct ktermios *k_termios = (a_termios); \ - struct termio k_termio; \ - int canon; \ - \ - k_termio.c_iflag = k_termios->c_iflag; \ - k_termio.c_oflag = k_termios->c_oflag; \ - k_termio.c_cflag = k_termios->c_cflag; \ - canon = (k_termio.c_lflag = k_termios->c_lflag) & ICANON; \ - \ - k_termio.c_line = k_termios->c_line; \ - k_termio.c_cc[_VINTR] = k_termios->c_cc[VINTR]; \ - k_termio.c_cc[_VQUIT] = k_termios->c_cc[VQUIT]; \ - k_termio.c_cc[_VERASE] = k_termios->c_cc[VERASE]; \ - k_termio.c_cc[_VKILL] = k_termios->c_cc[VKILL]; \ - k_termio.c_cc[_VEOF] = k_termios->c_cc[canon ? VEOF : VMIN]; \ - k_termio.c_cc[_VEOL] = k_termios->c_cc[canon ? VEOL : VTIME]; \ - k_termio.c_cc[_VEOL2] = k_termios->c_cc[VEOL2]; \ - k_termio.c_cc[_VSWTC] = k_termios->c_cc[VSWTC]; \ - \ - copy_to_user(u_termio, &k_termio, sizeof(k_termio)); \ -}) - -#define user_termios_to_kernel_termios(k, u) \ - copy_from_user(k, u, sizeof(struct termios2)) - -#define kernel_termios_to_user_termios(u, k) \ - copy_to_user(u, k, sizeof(struct termios2)) - -#define user_termios_to_kernel_termios_1(k, u) \ - copy_from_user(k, u, sizeof(struct termios)) - -#define kernel_termios_to_user_termios_1(u, k) \ - copy_to_user(u, k, sizeof(struct termios)) +int user_termio_to_kernel_termios(struct ktermios *, struct termio __user *); +int kernel_termios_to_user_termio(struct termio __user *, struct ktermios *); +int user_termios_to_kernel_termios(struct ktermios *, struct termios2 __user *); +int kernel_termios_to_user_termios(struct termios2 __user *, struct ktermios *); +int user_termios_to_kernel_termios_1(struct ktermios *, struct termios __user *); +int kernel_termios_to_user_termios_1(struct termios __user *, struct ktermios *); #endif /* _ALPHA_TERMIOS_H */ -- cgit v1.2.3-59-g8ed1b From c9874d3ffeaf8ee215187692ed918b3031d996d1 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Thu, 16 Aug 2018 11:47:53 -0400 Subject: termios: start unifying non-UAPI parts of asm/termios.h * new header (linut/termios_internal.h), pulled by the users of those suckers * defaults for INIT_C_CC and externs for conversion helpers moved over there * remove termios-base.h (empty now) Signed-off-by: Al Viro Link: https://lore.kernel.org/r/YxDmptU7dNGZ+/Hn@ZenIV Signed-off-by: Greg Kroah-Hartman --- arch/alpha/include/asm/termios.h | 8 +------- arch/alpha/kernel/termios.c | 3 +-- arch/ia64/include/asm/termios.h | 16 ---------------- arch/mips/include/asm/termios.h | 9 --------- arch/parisc/include/asm/termios.h | 16 ---------------- arch/powerpc/include/asm/termios.h | 2 -- arch/s390/include/asm/termios.h | 14 -------------- arch/sparc/include/asm/termios.h | 8 +------- arch/sparc/kernel/termios.c | 4 ++-- drivers/tty/hvc/hvcs.c | 1 + drivers/tty/tty_io.c | 2 +- drivers/tty/tty_ioctl.c | 1 + drivers/tty/vcc.c | 1 + include/asm-generic/termios-base.h | 21 --------------------- include/asm-generic/termios.h | 20 -------------------- include/linux/termios_internal.h | 30 ++++++++++++++++++++++++++++++ 16 files changed, 39 insertions(+), 117 deletions(-) delete mode 100644 include/asm-generic/termios-base.h create mode 100644 include/linux/termios_internal.h (limited to 'arch/alpha/include') diff --git a/arch/alpha/include/asm/termios.h b/arch/alpha/include/asm/termios.h index bafbb0090024..17b109859e05 100644 --- a/arch/alpha/include/asm/termios.h +++ b/arch/alpha/include/asm/termios.h @@ -2,6 +2,7 @@ #ifndef _ALPHA_TERMIOS_H #define _ALPHA_TERMIOS_H +#include #include /* eof=^D eol=\0 eol2=\0 erase=del @@ -12,11 +13,4 @@ */ #define INIT_C_CC "\004\000\000\177\027\025\022\000\003\034\032\000\021\023\026\025\001\000" -int user_termio_to_kernel_termios(struct ktermios *, struct termio __user *); -int kernel_termios_to_user_termio(struct termio __user *, struct ktermios *); -int user_termios_to_kernel_termios(struct ktermios *, struct termios2 __user *); -int kernel_termios_to_user_termios(struct termios2 __user *, struct ktermios *); -int user_termios_to_kernel_termios_1(struct ktermios *, struct termios __user *); -int kernel_termios_to_user_termios_1(struct termios __user *, struct ktermios *); - #endif /* _ALPHA_TERMIOS_H */ diff --git a/arch/alpha/kernel/termios.c b/arch/alpha/kernel/termios.c index 1534f39cb9fe..a4c29a22edf7 100644 --- a/arch/alpha/kernel/termios.c +++ b/arch/alpha/kernel/termios.c @@ -1,6 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -#include -#include +#include int user_termio_to_kernel_termios(struct ktermios *termios, struct termio __user *termio) diff --git a/arch/ia64/include/asm/termios.h b/arch/ia64/include/asm/termios.h index e7b2654aeb6f..1cef02701401 100644 --- a/arch/ia64/include/asm/termios.h +++ b/arch/ia64/include/asm/termios.h @@ -10,20 +10,4 @@ #include - -/* intr=^C quit=^\ erase=del kill=^U - eof=^D vtime=\0 vmin=\1 sxtc=\0 - start=^Q stop=^S susp=^Z eol=\0 - reprint=^R discard=^U werase=^W lnext=^V - eol2=\0 -*/ -#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" - -int user_termio_to_kernel_termios(struct ktermios *, struct termio __user *); -int kernel_termios_to_user_termio(struct termio __user *, struct ktermios *); -int user_termios_to_kernel_termios(struct ktermios *, struct termios2 __user *); -int kernel_termios_to_user_termios(struct termios2 __user *, struct ktermios *); -int user_termios_to_kernel_termios_1(struct ktermios *, struct termios __user *); -int kernel_termios_to_user_termios_1(struct termios __user *, struct ktermios *); - #endif /* _ASM_IA64_TERMIOS_H */ diff --git a/arch/mips/include/asm/termios.h b/arch/mips/include/asm/termios.h index 5e8c9d137dee..dbb62330b7a4 100644 --- a/arch/mips/include/asm/termios.h +++ b/arch/mips/include/asm/termios.h @@ -21,13 +21,4 @@ */ #define INIT_C_CC "\003\034\177\025\1\0\0\0\021\023\032\0\022\017\027\026\004\0" -#include - -int user_termio_to_kernel_termios(struct ktermios *, struct termio __user *); -int kernel_termios_to_user_termio(struct termio __user *, struct ktermios *); -int user_termios_to_kernel_termios(struct ktermios *, struct termios2 __user *); -int kernel_termios_to_user_termios(struct termios2 __user *, struct ktermios *); -int user_termios_to_kernel_termios_1(struct ktermios *, struct termios __user *); -int kernel_termios_to_user_termios_1(struct termios __user *, struct ktermios *); - #endif /* _ASM_TERMIOS_H */ diff --git a/arch/parisc/include/asm/termios.h b/arch/parisc/include/asm/termios.h index fe21bad7d2b1..1850a90befb3 100644 --- a/arch/parisc/include/asm/termios.h +++ b/arch/parisc/include/asm/termios.h @@ -4,20 +4,4 @@ #include - -/* intr=^C quit=^\ erase=del kill=^U - eof=^D vtime=\0 vmin=\1 sxtc=\0 - start=^Q stop=^S susp=^Z eol=\0 - reprint=^R discard=^U werase=^W lnext=^V - eol2=\0 -*/ -#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" - -int user_termio_to_kernel_termios(struct ktermios *, struct termio __user *); -int kernel_termios_to_user_termio(struct termio __user *, struct ktermios *); -int user_termios_to_kernel_termios(struct ktermios *, struct termios2 __user *); -int kernel_termios_to_user_termios(struct termios2 __user *, struct ktermios *); -int user_termios_to_kernel_termios_1(struct ktermios *, struct termios __user *); -int kernel_termios_to_user_termios_1(struct termios __user *, struct ktermios *); - #endif /* _PARISC_TERMIOS_H */ diff --git a/arch/powerpc/include/asm/termios.h b/arch/powerpc/include/asm/termios.h index 205de8f8a9d3..5c003322fe29 100644 --- a/arch/powerpc/include/asm/termios.h +++ b/arch/powerpc/include/asm/termios.h @@ -13,6 +13,4 @@ /* ^C ^\ del ^U ^D 1 0 0 0 0 ^W ^R ^Z ^Q ^S ^V ^U */ #define INIT_C_CC "\003\034\177\025\004\001\000\000\000\000\027\022\032\021\023\026\025" -#include - #endif /* _ASM_POWERPC_TERMIOS_H */ diff --git a/arch/s390/include/asm/termios.h b/arch/s390/include/asm/termios.h index 46fa3020b41e..0e26fe97b0d4 100644 --- a/arch/s390/include/asm/termios.h +++ b/arch/s390/include/asm/termios.h @@ -9,18 +9,4 @@ #include - -/* intr=^C quit=^\ erase=del kill=^U - eof=^D vtime=\0 vmin=\1 sxtc=\0 - start=^Q stop=^S susp=^Z eol=\0 - reprint=^R discard=^U werase=^W lnext=^V - eol2=\0 -*/ -#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" - -#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) -#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) - -#include - #endif /* _S390_TERMIOS_H */ diff --git a/arch/sparc/include/asm/termios.h b/arch/sparc/include/asm/termios.h index 03bcb6e6abe8..bafd7768f309 100644 --- a/arch/sparc/include/asm/termios.h +++ b/arch/sparc/include/asm/termios.h @@ -3,6 +3,7 @@ #define _SPARC_TERMIOS_H #include +#include /* intr=^C quit=^\ erase=del kill=^U @@ -13,11 +14,4 @@ */ #define INIT_C_CC "\003\034\177\025\004\000\000\000\021\023\032\031\022\025\027\026\001" -int user_termio_to_kernel_termios(struct ktermios *, struct termio __user *); -int kernel_termios_to_user_termio(struct termio __user *, struct ktermios *); -int user_termios_to_kernel_termios(struct ktermios *, struct termios2 __user *); -int kernel_termios_to_user_termios(struct termios2 __user *, struct ktermios *); -int user_termios_to_kernel_termios_1(struct ktermios *, struct termios __user *); -int kernel_termios_to_user_termios_1(struct termios __user *, struct ktermios *); - #endif /* _SPARC_TERMIOS_H */ diff --git a/arch/sparc/kernel/termios.c b/arch/sparc/kernel/termios.c index 97e23d4ae2e2..ee64965c27cd 100644 --- a/arch/sparc/kernel/termios.c +++ b/arch/sparc/kernel/termios.c @@ -1,5 +1,5 @@ -#include -#include +// SPDX-License-Identifier: GPL-2.0 +#include /* * c_cc characters in the termio structure. Oh, how I love being diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c index b79ce8d34f11..4ba24963685e 100644 --- a/drivers/tty/hvc/hvcs.c +++ b/drivers/tty/hvc/hvcs.c @@ -69,6 +69,7 @@ #include #include #include +#include #include /* diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 82a8855981f7..571c94c81477 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -99,8 +99,8 @@ #include #include #include - #include +#include #include #include diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c index 026429276637..ce511557b98b 100644 --- a/drivers/tty/tty_ioctl.c +++ b/drivers/tty/tty_ioctl.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "tty.h" #include diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c index e11383ae1e7e..34ba6e54789a 100644 --- a/drivers/tty/vcc.c +++ b/drivers/tty/vcc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/include/asm-generic/termios-base.h b/include/asm-generic/termios-base.h deleted file mode 100644 index d6536b2214ae..000000000000 --- a/include/asm-generic/termios-base.h +++ /dev/null @@ -1,21 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* termios.h: generic termios/termio user copying/translation - */ - -#ifndef _ASM_GENERIC_TERMIOS_BASE_H -#define _ASM_GENERIC_TERMIOS_BASE_H - -#include - -#ifndef __ARCH_TERMIO_GETPUT - -int user_termio_to_kernel_termios(struct ktermios *, struct termio __user *); -int kernel_termios_to_user_termio(struct termio __user *, struct ktermios *); -int user_termios_to_kernel_termios(struct ktermios *, struct termios2 __user *); -int kernel_termios_to_user_termios(struct termios2 __user *, struct ktermios *); -int user_termios_to_kernel_termios_1(struct ktermios *, struct termios __user *); -int kernel_termios_to_user_termios_1(struct termios __user *, struct ktermios *); - -#endif /* __ARCH_TERMIO_GETPUT */ - -#endif /* _ASM_GENERIC_TERMIOS_BASE_H */ diff --git a/include/asm-generic/termios.h b/include/asm-generic/termios.h index 61b07d9ce8d0..da3b0fe25442 100644 --- a/include/asm-generic/termios.h +++ b/include/asm-generic/termios.h @@ -6,24 +6,4 @@ #include #include -/* intr=^C quit=^\ erase=del kill=^U - eof=^D vtime=\0 vmin=\1 sxtc=\0 - start=^Q stop=^S susp=^Z eol=\0 - reprint=^R discard=^U werase=^W lnext=^V - eol2=\0 -*/ -#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" - -int user_termio_to_kernel_termios(struct ktermios *, struct termio __user *); -int kernel_termios_to_user_termio(struct termio __user *, struct ktermios *); -#ifdef TCGETS2 -int user_termios_to_kernel_termios(struct ktermios *, struct termios2 __user *); -int kernel_termios_to_user_termios(struct termios2 __user *, struct ktermios *); -int user_termios_to_kernel_termios_1(struct ktermios *, struct termios __user *); -int kernel_termios_to_user_termios_1(struct termios __user *, struct ktermios *); -#else /* TCGETS2 */ -int user_termios_to_kernel_termios(struct ktermios *, struct termios __user *); -int kernel_termios_to_user_termios(struct termios __user *, struct ktermios *); -#endif /* TCGETS2 */ - #endif /* _ASM_GENERIC_TERMIOS_H */ diff --git a/include/linux/termios_internal.h b/include/linux/termios_internal.h new file mode 100644 index 000000000000..103ca0370948 --- /dev/null +++ b/include/linux/termios_internal.h @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_TERMIOS_CONV_H +#define _LINUX_TERMIOS_CONV_H + +#include +#include + +#ifndef INIT_C_CC +/* intr=^C quit=^\ erase=del kill=^U + eof=^D vtime=\0 vmin=\1 sxtc=\0 + start=^Q stop=^S susp=^Z eol=\0 + reprint=^R discard=^U werase=^W lnext=^V + eol2=\0 +*/ +#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" +#endif + +int user_termio_to_kernel_termios(struct ktermios *, struct termio __user *); +int kernel_termios_to_user_termio(struct termio __user *, struct ktermios *); +#ifdef TCGETS2 +int user_termios_to_kernel_termios(struct ktermios *, struct termios2 __user *); +int kernel_termios_to_user_termios(struct termios2 __user *, struct ktermios *); +int user_termios_to_kernel_termios_1(struct ktermios *, struct termios __user *); +int kernel_termios_to_user_termios_1(struct termios __user *, struct ktermios *); +#else /* TCGETS2 */ +int user_termios_to_kernel_termios(struct ktermios *, struct termios __user *); +int kernel_termios_to_user_termios(struct termios __user *, struct ktermios *); +#endif /* TCGETS2 */ + +#endif /* _LINUX_TERMIOS_CONV_H */ -- cgit v1.2.3-59-g8ed1b From 38fc315a73f7a1b2d19eb32dd55de089b78b2a54 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 9 Aug 2022 17:17:04 -0400 Subject: termios: consolidate values for VDISCARD in INIT_C_CC On old systems it used to be ^O. Linux had never actually used the value, but INIT_C_CC (on i386) did initialize it to ^O; unfortunately, it had a typo in the comment claiming that to be ^U. Most of the architectures copied the (correct) definition along with mistaken comment. alpha, powerpc and sparc tried to make the definition match comment. However, util-linux still resets it to ^O on any architecture, ^O is the historical value, kernel ignores it anyway and finally, Linus said "Just change everybody to do the same, nobody cares about VDISCARD". Signed-off-by: Al Viro Link: https://lore.kernel.org/r/YxDmy//MKzs3ye7l@ZenIV Signed-off-by: Greg Kroah-Hartman --- arch/alpha/include/asm/termios.h | 4 ++-- arch/mips/include/asm/termios.h | 2 +- arch/powerpc/include/asm/termios.h | 4 ++-- arch/sparc/include/asm/termios.h | 4 ++-- include/linux/termios_internal.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'arch/alpha/include') diff --git a/arch/alpha/include/asm/termios.h b/arch/alpha/include/asm/termios.h index 17b109859e05..9cc784d0a83c 100644 --- a/arch/alpha/include/asm/termios.h +++ b/arch/alpha/include/asm/termios.h @@ -8,9 +8,9 @@ /* eof=^D eol=\0 eol2=\0 erase=del werase=^W kill=^U reprint=^R sxtc=\0 intr=^C quit=^\ susp=^Z - start=^Q stop=^S lnext=^V discard=^U + start=^Q stop=^S lnext=^V discard=^O vmin=\1 vtime=\0 */ -#define INIT_C_CC "\004\000\000\177\027\025\022\000\003\034\032\000\021\023\026\025\001\000" +#define INIT_C_CC "\004\000\000\177\027\025\022\000\003\034\032\000\021\023\026\017\001\000" #endif /* _ALPHA_TERMIOS_H */ diff --git a/arch/mips/include/asm/termios.h b/arch/mips/include/asm/termios.h index dbb62330b7a4..059c800afaa1 100644 --- a/arch/mips/include/asm/termios.h +++ b/arch/mips/include/asm/termios.h @@ -16,7 +16,7 @@ * intr=^C quit=^\ erase=del kill=^U * vmin=\1 vtime=\0 eol2=\0 swtc=\0 * start=^Q stop=^S susp=^Z vdsusp= - * reprint=^R discard=^U werase=^W lnext=^V + * reprint=^R discard=^O werase=^W lnext=^V * eof=^D eol=\0 */ #define INIT_C_CC "\003\034\177\025\1\0\0\0\021\023\032\0\022\017\027\026\004\0" diff --git a/arch/powerpc/include/asm/termios.h b/arch/powerpc/include/asm/termios.h index 5c003322fe29..e18a05a6ed34 100644 --- a/arch/powerpc/include/asm/termios.h +++ b/arch/powerpc/include/asm/termios.h @@ -10,7 +10,7 @@ #include -/* ^C ^\ del ^U ^D 1 0 0 0 0 ^W ^R ^Z ^Q ^S ^V ^U */ -#define INIT_C_CC "\003\034\177\025\004\001\000\000\000\000\027\022\032\021\023\026\025" +/* ^C ^\ del ^U ^D 1 0 0 0 0 ^W ^R ^Z ^Q ^S ^V ^O */ +#define INIT_C_CC "\003\034\177\025\004\001\000\000\000\000\027\022\032\021\023\026\017" #endif /* _ASM_POWERPC_TERMIOS_H */ diff --git a/arch/sparc/include/asm/termios.h b/arch/sparc/include/asm/termios.h index bafd7768f309..60f90465fc12 100644 --- a/arch/sparc/include/asm/termios.h +++ b/arch/sparc/include/asm/termios.h @@ -9,9 +9,9 @@ /* intr=^C quit=^\ erase=del kill=^U eof=^D eol=\0 eol2=\0 sxtc=\0 start=^Q stop=^S susp=^Z dsusp=^Y - reprint=^R discard=^U werase=^W lnext=^V + reprint=^R discard=^O werase=^W lnext=^V vmin=\1 vtime=\0 */ -#define INIT_C_CC "\003\034\177\025\004\000\000\000\021\023\032\031\022\025\027\026\001" +#define INIT_C_CC "\003\034\177\025\004\000\000\000\021\023\032\031\022\017\027\026\001" #endif /* _SPARC_TERMIOS_H */ diff --git a/include/linux/termios_internal.h b/include/linux/termios_internal.h index 103ca0370948..7eb3598c109d 100644 --- a/include/linux/termios_internal.h +++ b/include/linux/termios_internal.h @@ -9,7 +9,7 @@ /* intr=^C quit=^\ erase=del kill=^U eof=^D vtime=\0 vmin=\1 sxtc=\0 start=^Q stop=^S susp=^Z eol=\0 - reprint=^R discard=^U werase=^W lnext=^V + reprint=^R discard=^O werase=^W lnext=^V eol2=\0 */ #define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" -- cgit v1.2.3-59-g8ed1b From d04f9915fa44b52d7a91080677381a082238e9c4 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 9 Sep 2018 17:57:42 -0400 Subject: make generic INIT_C_CC a bit more generic turn it into an array initializer; then alpha, mips and powerpc variants fold into it. Signed-off-by: Al Viro Link: https://lore.kernel.org/r/YxDm7M6M91gC2RPL@ZenIV Signed-off-by: Greg Kroah-Hartman --- arch/alpha/include/asm/termios.h | 8 -------- arch/mips/include/asm/termios.h | 9 --------- arch/powerpc/include/asm/termios.h | 3 --- include/linux/termios_internal.h | 15 ++++++++++++++- 4 files changed, 14 insertions(+), 21 deletions(-) (limited to 'arch/alpha/include') diff --git a/arch/alpha/include/asm/termios.h b/arch/alpha/include/asm/termios.h index 9cc784d0a83c..3894fd92c508 100644 --- a/arch/alpha/include/asm/termios.h +++ b/arch/alpha/include/asm/termios.h @@ -5,12 +5,4 @@ #include #include -/* eof=^D eol=\0 eol2=\0 erase=del - werase=^W kill=^U reprint=^R sxtc=\0 - intr=^C quit=^\ susp=^Z - start=^Q stop=^S lnext=^V discard=^O - vmin=\1 vtime=\0 -*/ -#define INIT_C_CC "\004\000\000\177\027\025\022\000\003\034\032\000\021\023\026\017\001\000" - #endif /* _ALPHA_TERMIOS_H */ diff --git a/arch/mips/include/asm/termios.h b/arch/mips/include/asm/termios.h index 059c800afaa1..12bc56857bf1 100644 --- a/arch/mips/include/asm/termios.h +++ b/arch/mips/include/asm/termios.h @@ -12,13 +12,4 @@ #include #include -/* - * intr=^C quit=^\ erase=del kill=^U - * vmin=\1 vtime=\0 eol2=\0 swtc=\0 - * start=^Q stop=^S susp=^Z vdsusp= - * reprint=^R discard=^O werase=^W lnext=^V - * eof=^D eol=\0 - */ -#define INIT_C_CC "\003\034\177\025\1\0\0\0\021\023\032\0\022\017\027\026\004\0" - #endif /* _ASM_TERMIOS_H */ diff --git a/arch/powerpc/include/asm/termios.h b/arch/powerpc/include/asm/termios.h index e18a05a6ed34..83794533f607 100644 --- a/arch/powerpc/include/asm/termios.h +++ b/arch/powerpc/include/asm/termios.h @@ -10,7 +10,4 @@ #include -/* ^C ^\ del ^U ^D 1 0 0 0 0 ^W ^R ^Z ^Q ^S ^V ^O */ -#define INIT_C_CC "\003\034\177\025\004\001\000\000\000\000\027\022\032\021\023\026\017" - #endif /* _ASM_POWERPC_TERMIOS_H */ diff --git a/include/linux/termios_internal.h b/include/linux/termios_internal.h index 7eb3598c109d..8a53141ab44a 100644 --- a/include/linux/termios_internal.h +++ b/include/linux/termios_internal.h @@ -12,7 +12,20 @@ reprint=^R discard=^O werase=^W lnext=^V eol2=\0 */ -#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" +#define INIT_C_CC { \ + [VINTR] = 'C'-0x40, \ + [VQUIT] = '\\'-0x40, \ + [VERASE] = '\177', \ + [VKILL] = 'U'-0x40, \ + [VEOF] = 'D'-0x40, \ + [VSTART] = 'Q'-0x40, \ + [VSTOP] = 'S'-0x40, \ + [VSUSP] = 'Z'-0x40, \ + [VREPRINT] = 'R'-0x40, \ + [VDISCARD] = 'O'-0x40, \ + [VWERASE] = 'W'-0x40, \ + [VLNEXT] = 'V'-0x40, \ + [VMIN] = 1 } #endif int user_termio_to_kernel_termios(struct ktermios *, struct termio __user *); -- cgit v1.2.3-59-g8ed1b From 89bbeb7e3199e1514729aa6de8057289e6375fe6 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 9 Aug 2022 19:41:40 -0400 Subject: termios: get rid of non-UAPI asm/termios.h All non-UAPI asm/termios.h consist of include of UAPI counterpart and, possibly, include of linux/uaccess.h The latter can't be simply removed, even though nothing in linux/termios.h doesn't depend upon it anymore - there are several places that rely upon that indirect chain of includes to pull linux/uaccess.h. So the include needs to be lifted out of there - we lift into tty_driver.h, serdev.h and places that pull asm/termios.h, but none of * linux/uaccess.h (obvious) * net/sock.h (pulls uaccess.h) * linux/{tty,tty_driver,serdev}.h (tty.h pulls tty_driver.h) That leaves us just with the include of UAPI asm/termios.h, which is what will resolve to if we simply remove non-UAPI header. Signed-off-by: Al Viro Link: https://lore.kernel.org/r/YxDnKvYCHn/ogBUv@ZenIV Signed-off-by: Greg Kroah-Hartman --- arch/alpha/include/asm/termios.h | 8 -------- arch/arm/mach-ep93xx/core.c | 1 + arch/arm/mach-versatile/integrator_ap.c | 1 + arch/ia64/include/asm/termios.h | 13 ------------- arch/mips/include/asm/termios.h | 15 --------------- arch/parisc/include/asm/termios.h | 7 ------- arch/powerpc/include/asm/termios.h | 13 ------------- arch/s390/include/asm/termios.h | 12 ------------ arch/sparc/include/asm/termios.h | 8 -------- drivers/net/wwan/wwan_core.c | 1 + include/asm-generic/termios.h | 9 --------- include/linux/serdev.h | 1 + include/linux/tty_driver.h | 1 + 13 files changed, 5 insertions(+), 85 deletions(-) delete mode 100644 arch/alpha/include/asm/termios.h delete mode 100644 arch/ia64/include/asm/termios.h delete mode 100644 arch/mips/include/asm/termios.h delete mode 100644 arch/parisc/include/asm/termios.h delete mode 100644 arch/powerpc/include/asm/termios.h delete mode 100644 arch/s390/include/asm/termios.h delete mode 100644 arch/sparc/include/asm/termios.h delete mode 100644 include/asm-generic/termios.h (limited to 'arch/alpha/include') diff --git a/arch/alpha/include/asm/termios.h b/arch/alpha/include/asm/termios.h deleted file mode 100644 index 3894fd92c508..000000000000 --- a/arch/alpha/include/asm/termios.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ALPHA_TERMIOS_H -#define _ALPHA_TERMIOS_H - -#include -#include - -#endif /* _ALPHA_TERMIOS_H */ diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 2d58e273c96d..95e731676cea 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/arm/mach-versatile/integrator_ap.c b/arch/arm/mach-versatile/integrator_ap.c index e216fac917d0..4bd6712e9f52 100644 --- a/arch/arm/mach-versatile/integrator_ap.c +++ b/arch/arm/mach-versatile/integrator_ap.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/ia64/include/asm/termios.h b/arch/ia64/include/asm/termios.h deleted file mode 100644 index 1cef02701401..000000000000 --- a/arch/ia64/include/asm/termios.h +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Modified 1999 - * David Mosberger-Tang , Hewlett-Packard Co - * - * 99/01/28 Added N_IRDA and N_SMSBLOCK - */ -#ifndef _ASM_IA64_TERMIOS_H -#define _ASM_IA64_TERMIOS_H - -#include - -#endif /* _ASM_IA64_TERMIOS_H */ diff --git a/arch/mips/include/asm/termios.h b/arch/mips/include/asm/termios.h deleted file mode 100644 index 12bc56857bf1..000000000000 --- a/arch/mips/include/asm/termios.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1995, 1996, 2000, 2001 by Ralf Baechle - * Copyright (C) 2000, 2001 Silicon Graphics, Inc. - */ -#ifndef _ASM_TERMIOS_H -#define _ASM_TERMIOS_H - -#include -#include - -#endif /* _ASM_TERMIOS_H */ diff --git a/arch/parisc/include/asm/termios.h b/arch/parisc/include/asm/termios.h deleted file mode 100644 index 1850a90befb3..000000000000 --- a/arch/parisc/include/asm/termios.h +++ /dev/null @@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _PARISC_TERMIOS_H -#define _PARISC_TERMIOS_H - -#include - -#endif /* _PARISC_TERMIOS_H */ diff --git a/arch/powerpc/include/asm/termios.h b/arch/powerpc/include/asm/termios.h deleted file mode 100644 index 83794533f607..000000000000 --- a/arch/powerpc/include/asm/termios.h +++ /dev/null @@ -1,13 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * Liberally adapted from alpha/termios.h. In particular, the c_cc[] - * fields have been reordered so that termio & termios share the - * common subset in the same order (for brain dead programs that don't - * know or care about the differences). - */ -#ifndef _ASM_POWERPC_TERMIOS_H -#define _ASM_POWERPC_TERMIOS_H - -#include - -#endif /* _ASM_POWERPC_TERMIOS_H */ diff --git a/arch/s390/include/asm/termios.h b/arch/s390/include/asm/termios.h deleted file mode 100644 index 0e26fe97b0d4..000000000000 --- a/arch/s390/include/asm/termios.h +++ /dev/null @@ -1,12 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * S390 version - * - * Derived from "include/asm-i386/termios.h" - */ -#ifndef _S390_TERMIOS_H -#define _S390_TERMIOS_H - -#include - -#endif /* _S390_TERMIOS_H */ diff --git a/arch/sparc/include/asm/termios.h b/arch/sparc/include/asm/termios.h deleted file mode 100644 index 1b85721f4e6b..000000000000 --- a/arch/sparc/include/asm/termios.h +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _SPARC_TERMIOS_H -#define _SPARC_TERMIOS_H - -#include -#include - -#endif /* _SPARC_TERMIOS_H */ diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c index b8c7843730ed..62e9f7d6c9fe 100644 --- a/drivers/net/wwan/wwan_core.c +++ b/drivers/net/wwan/wwan_core.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/include/asm-generic/termios.h b/include/asm-generic/termios.h deleted file mode 100644 index da3b0fe25442..000000000000 --- a/include/asm-generic/termios.h +++ /dev/null @@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_GENERIC_TERMIOS_H -#define _ASM_GENERIC_TERMIOS_H - - -#include -#include - -#endif /* _ASM_GENERIC_TERMIOS_H */ diff --git a/include/linux/serdev.h b/include/linux/serdev.h index 3368c261ab62..66f624fc618c 100644 --- a/include/linux/serdev.h +++ b/include/linux/serdev.h @@ -7,6 +7,7 @@ #include #include +#include #include #include diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index b2456b545ba0..f961164a5274 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3-59-g8ed1b