From patchwork Mon Oct 15 20:49:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 148886 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4251296lji; Mon, 15 Oct 2018 13:50:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV62PhlVhtI5Ki0Mc6PRJ6E72ZeE6Psli5STfxJVWrymMQ5gJGI8+3zaii33a+NGSVabNQ8D8 X-Received: by 2002:a17:902:7c0b:: with SMTP id x11-v6mr18398474pll.60.1539636615517; Mon, 15 Oct 2018 13:50:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539636615; cv=none; d=google.com; s=arc-20160816; b=v1b91xrutDuFVnpskIFfvwC4erpUrWL96GUx7hAEaPT28Eo7FfW5BuYhbT8xZ7OMXr Qlunot9syxKHOYCm4TUD9eo6KL4STfyjEqlD3Y2oRPTEYhw8wBPaD63CFvvynEsHegyf lXLBtHNZ1wOM04KNef4F8C4yVIMhvUbUIMKE3Qsi96pjO+zm8GGf2edmQhNhH7V1pI2G CFalIl8RCzPxCbrB+geLftp3E6Oeq2+5GtC7Wazn6M111JYNXwb3NsfDiOlN1xPbLELO 1NnkQbzoU0PevQmkJLMKMs2RXjL+r2orccqrN/tWk/JB6Nb594Mu1amtiMfWT76UWz6/ Sc8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=XmI5DpuNIJheobh6YBPom6nsLX0GsY6et+MfjjKCuK8=; b=XkkAk+TztWR/fFVTWnncZ7hcYXp6vtEZ+g7iNyW18ap8kGBMAoUFMsl9Ht/J845Cr1 7f8t7WhoQOrP3im1UdGIDditzlRqlLYy9UNrDQ/V29D4BytqAL0T9fmLnVeppawD5upA 6JZ3FEZgsGFYBuD9ni2FQ4Ohzi3ud02pQrfpwPmWZRni1PooeseomEuEkUrCGzqjbiNB ugbe7liQ5CVnAcftL6GlqE8RTaiyI1nqA+GsRNuzKFE9iiPJSYp3oEnUuYui/U8cnzAR GBi/xYv4PSmm0qDc5jWsktJ7+tIo0LPRui/6jLN/aYhnjtMyjtM+uDasgzjSsfmobD3h R7Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=EmaJ7zg2; dkim=pass header.i=@linaro.org header.s=google header.b=Ro6CC+bG; spf=pass (google.com: domain of libc-alpha-return-96436-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96436-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id p19-v6si11760164pfi.12.2018.10.15.13.50.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 13:50:15 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-96436-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=EmaJ7zg2; dkim=pass header.i=@linaro.org header.s=google header.b=Ro6CC+bG; spf=pass (google.com: domain of libc-alpha-return-96436-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96436-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=TVkXSBz75OyqVdprIc+t/emsMDnDVgs0KXbMcu/oRGuTGuEu108XL KiVOLyvBSoG/4pH9hIpIe+UU8LGodldDJelvg0wMjfMazm7riu+MIdcI4Tl+g/WL JWx2FHUhS0rrhf+f0HK4uevNVZwGF+IZgWbLssOxa1TESRmbtapsCk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=CUlPH6D5sfBPcPQm922POthO+U0=; b=EmaJ7zg2NUZf2DNDnPsb/+IfbRhI W5aCseW60PdzzlXj5bc1bdOFyr4WnB79ZIinFGltjROV6YTCOKf8zgmXo3LAgDAY DO/nluwrLbCENCQKeb/KaTMzMjtJR0yMSqbqYezONAtWNNGc+ma9a02gV7NGcx7t osZJ1TClhXz7uR8= Received: (qmail 13927 invoked by alias); 15 Oct 2018 20:50:06 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 13899 invoked by uid 89); 15 Oct 2018 20:50:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=1986, Hx-spam-relays-external:209.85.222.194, H*RU:209.85.222.194 X-HELO: mail-qk1-f194.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=XmI5DpuNIJheobh6YBPom6nsLX0GsY6et+MfjjKCuK8=; b=Ro6CC+bGouXCoqYLu8Vo7lSoNyXbEP13qqHKZiVkL/5EmVREfzyvoBrMWNhzx/rjws SP6S0FBJkpj6yRbpqGjJc7Z43JANEzwEcVmkud0CHQjvQApSyuPMs/BWpe4baRAtUt2q CFjlzCFeKQl0OiN/WR0fmZeIUo+pZcQYW3Dtk= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: hpa@zytor.com Subject: [PATCH 01/12] termios: Define TIOCSER_TEMT with __USE_MISC (BZ#17783) Date: Mon, 15 Oct 2018 17:49:45 -0300 Message-Id: <20181015204956.25558-1-adhemerval.zanella@linaro.org> This patch defines TIOCSER_TEMT on all architectures using the __USE_MISC guards similar to BZ#17782 fix. Latest Linux UAPI defines TIOCSER_TEMT with the same value for all architectures, so it is safe to use the value as default for all ABIs. Checked on x86_64linux-gnu and build against sparc64-linux-gnu and powerpc64le-linux-gnu. * sysdeps/unix/sysv/linux/bits/termios.h [__USE_MISC] (TIOCSER_TEMT): Define. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h [__USE_MISC] (TIOCSER_TEMT): Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h [__USE_MISC] (TEOCSER_TEMT): Likewise. --- sysdeps/unix/sysv/linux/bits/termios.h | 5 +++++ sysdeps/unix/sysv/linux/powerpc/bits/termios.h | 4 +++- sysdeps/unix/sysv/linux/sparc/bits/termios.h | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h index 35efa97576..1e567affc3 100644 --- a/sysdeps/unix/sysv/linux/bits/termios.h +++ b/sysdeps/unix/sysv/linux/bits/termios.h @@ -198,6 +198,11 @@ struct termios # define EXTPROC 0200000 #endif +#ifdef __USE_MISC +/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ +# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ +#endif + /* tcflow() and TCXONC use these */ #define TCOOFF 0 #define TCOON 1 diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h index 1362cce551..afe592d5e4 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h @@ -273,7 +273,9 @@ struct ltchars { #define _VEOL2 8 #define _VSWTC 9 +#ifdef __USE_MISC /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ +# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ +#endif #endif /* __USE_MISC */ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h index 4489b6c2fd..ffe8483694 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/termios.h @@ -203,9 +203,9 @@ struct termios # define EXTPROC 0x00010000 #endif -# if defined __USE_GNU +#ifdef __USE_MISC /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ +# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ #endif /* tcflow() and TCXONC use these */ From patchwork Mon Oct 15 20:49:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 148887 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4251452lji; Mon, 15 Oct 2018 13:50:28 -0700 (PDT) X-Google-Smtp-Source: ACcGV62af5sUHwhTzfaL/3pb3q8lsbW306naiDUJX7GsNh8fnahaHReWr1UqatzADtvqOCnpz5U5 X-Received: by 2002:a62:aa17:: with SMTP id e23-v6mr19183106pff.211.1539636627877; Mon, 15 Oct 2018 13:50:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539636627; cv=none; d=google.com; s=arc-20160816; b=DshZL9bsE1z9RTJt7mWWvzAgeSJZa0W+jWi0Vts/G3HL6c5hbmYnZDEA5Txx0X1d+Q Wz/YNdjl7YqTpf08wwsehcrEa+0bSiSgWoh+OIeAERt0Bqnbky20lbVSDPTNcMYhm4x6 KLVR3xSLuCfw14PXDdbF/su9PI+gM5SWirj6jvdgoBfDxVkyFsqzsOzy1yr3D4xJTadj +wPr0SCf6IeOtV7e0lOS59iuDOdGaIHkslU/nbbWJfl2OTf63sIQOV9OQpoUymwHIIeb ck1CWKLz+HttRIaSk51kwrjbkCvqqn1oisv3MpajS02dCmB465Tt8qd1Gd1OQj4vQEl4 pOxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=9lHgxBA5eGG9tFrI2HfuCpBK28+k1wTpuDImcllQC5A=; b=W+eY/hY4vCJVozqEg7TQKhmyneLpQN2TCtZEDfJF1PUnfjBBymG60Es7u/lh3b9klt Rdx9DGG+R5wXrWjlZ/09rZpPe786eQIGDidZjYll4h1Tw2u0vAxZi2yBwIssdOOYalbL uhB/tTGJ0Ausvhj209lGy1wdrtbmMJ7PZLUkHp7ztgqzDHy0E9WrqgpE7a9Tx5j9awyp 8DkSaaRQQ5uswh/6q8pEMKXqIsXCgQdq4C9dRmPXctIf4aRtLYvUGajQGe1JAV2PP0uw L//jwxBmzBtpsbLxNMQlCOAGsdhtgRRvL0zmzQUHL/UFaasOyxIq1c0f7bpnQzAgjpGk b7Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=JLeVCU4t; dkim=pass header.i=@linaro.org header.s=google header.b=f4bc5Yjv; spf=pass (google.com: domain of libc-alpha-return-96437-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96437-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y76-v6si12418137pfd.254.2018.10.15.13.50.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 13:50:27 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-96437-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=JLeVCU4t; dkim=pass header.i=@linaro.org header.s=google header.b=f4bc5Yjv; spf=pass (google.com: domain of libc-alpha-return-96437-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96437-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=S8K1+H+NdsVkdED5MsXPlZIfabTKPEI W6TlUQenQOH+c+G+QUt3EYfzADLoTPIj/RgdIEtWIsRrIDHegBxkUb4xLmcAA4O4 hWC/tJPJy+ZmE3ubTLrSfz4zuCkQ5RKWV76b284YCe/lgsaDg2TLkA7/0MKrtyJQ aGiqyObdA5Lo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=pnQD1/R+1zoJA3X4kHT4ucd9a/I=; b=JLeVC U4t7q02+PfqsRpgYiCj34Rkpgt0EuZOnJb6hZKeKiLILJBGhbhA/bZOLx7+l0hEq RTalYNAhbaOYElbFGZjOlCkDbd2EGPd44Z4VHb5wcfxXBe6SyHUvBvEeKGw3RmEd GgRKBl++1agXLQ+0eOl2JZzyOr6LKfdoMS7lgo= Received: (qmail 15051 invoked by alias); 15 Oct 2018 20:50:15 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 14353 invoked by uid 89); 15 Oct 2018 20:50:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:optiona, consolidate, Consolidate, discipline X-HELO: mail-qt1-f196.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9lHgxBA5eGG9tFrI2HfuCpBK28+k1wTpuDImcllQC5A=; b=f4bc5YjvKnZ+C+boMSOJeHqvxd4MMsfhADMG64KO2pv9X70xh+CF21gSU10WXiH9/K KHsEopZf3KvCxTluffTPv2khg2Rvyf1alxSKP5tHbhWdKqLVNVlfLXDsbpR08+N0ql/a gMrSgSZE6s+FZI8TDrbWRKgrKMUxXsrnYbK/k= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: hpa@zytor.com Subject: [PATCH 02/12] termios: Consolidate struct termios Date: Mon, 15 Oct 2018 17:49:46 -0300 Message-Id: <20181015204956.25558-2-adhemerval.zanella@linaro.org> In-Reply-To: <20181015204956.25558-1-adhemerval.zanella@linaro.org> References: <20181015204956.25558-1-adhemerval.zanella@linaro.org> This patch consolidates the struct termios definition on its own header and adds arch-defined ones for ABIs that deviate from generic implementation. They are: - alpha which has a slight different layout than generic one (c_cc field is defined prior c_line). - sparc and mips which do not have the c_ispeed/c_ospeed fields. No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/alpha/bits/termios-struct.h: New file. * sysdeps/unix/sysv/linux/bits/termios-struct.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios-struct.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios-struct.h: Likewise. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add termios-struct.h. * sysdeps/unix/sysv/linux/bits/termios.h (struct termios): Move to termios-struct.h. * sysdeps/unix/sysv/linux/alpha/bits/termios.h (struct termios): Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h (struct termios): Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h (struct termios): Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h (struct termios): Likewise. * sysdeps/unix/sysv/linux/kernel_termios.h (_HAVE_C_ISPEED, _HAVE_C_OSPEED): Define. * sysdeps/unix/sysv/linux/mips/kernel_termios.h (_HAVE_C_ISPEED, _HAVE_C_OSPEED): Likewise. * sysdeps/unix/sysv/linux/sparc/kernel_termios.h (_HAVE_C_ISPEED, _HAVE_C_OSPEED): Likewise. * sysdeps/unix/sysv/linux/speed.c [_HAVE_STRUCT_TERMIOS_C_OSPEED] (cfsetospeed): Check for define value instead of existence. [_HAVE_STRUCT_TERMIOS_C_ISPEED] (cfsetispeed): Likewise. * sysdeps/unix/sysv/linux/tcgetattr.c [_HAVE_STRUCT_TERMIOS_C_ISPEED && _HAVE_C_ISPEED] (__tcgetattr): Likewise. * sysdeps/unix/sysv/linux/tcsetattr.c [_HAVE_STRUCT_TERMIOS_C_ISPEED && _HAVE_C_ISPEED] (__tcsetattr): Likewise. --- sysdeps/unix/sysv/linux/Makefile | 2 +- .../sysv/linux/alpha/bits/termios-struct.h | 37 +++++++++++++++++++ sysdeps/unix/sysv/linux/alpha/bits/termios.h | 15 +------- sysdeps/unix/sysv/linux/bits/termios-struct.h | 36 ++++++++++++++++++ sysdeps/unix/sysv/linux/bits/termios.h | 15 +------- sysdeps/unix/sysv/linux/kernel_termios.h | 3 ++ .../sysv/linux/mips/bits/termios-struct.h | 34 +++++++++++++++++ sysdeps/unix/sysv/linux/mips/bits/termios.h | 11 +----- sysdeps/unix/sysv/linux/mips/kernel_termios.h | 3 ++ .../unix/sysv/linux/powerpc/bits/termios.h | 20 +--------- .../sysv/linux/sparc/bits/termios-struct.h | 34 +++++++++++++++++ sysdeps/unix/sysv/linux/sparc/bits/termios.h | 11 +----- .../unix/sysv/linux/sparc/kernel_termios.h | 3 ++ sysdeps/unix/sysv/linux/speed.c | 4 +- sysdeps/unix/sysv/linux/tcgetattr.c | 8 ++-- sysdeps/unix/sysv/linux/tcsetattr.c | 4 +- 16 files changed, 164 insertions(+), 76 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/termios-struct.h create mode 100644 sysdeps/unix/sysv/linux/bits/termios-struct.h create mode 100644 sysdeps/unix/sysv/linux/mips/bits/termios-struct.h create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/termios-struct.h -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index ff4535cdca..184a5b19e1 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -43,7 +43,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ bits/siginfo-arch.h bits/siginfo-consts-arch.h \ bits/procfs.h bits/procfs-id.h bits/procfs-extra.h \ bits/procfs-prregset.h bits/mman-map-flags-generic.h \ - bits/msq-pad.h + bits/msq-pad.h bits/termios-struct.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios-struct.h b/sysdeps/unix/sysv/linux/alpha/bits/termios-struct.h new file mode 100644 index 0000000000..268988c1a4 --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios-struct.h @@ -0,0 +1,37 @@ +/* struct termios definition. Linux/alpha version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* Alpha has C_CC before C_LINE compare to Linux generic definition. */ +#define NCCS 32 +struct 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_cc[NCCS]; /* control characters */ + cc_t c_line; /* line discipline (== c_cc[33]) */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ +#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1 +#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1 + }; diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h index 24423e8fc9..fe358dd8f5 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/termios.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios.h @@ -24,20 +24,7 @@ typedef unsigned char cc_t; typedef unsigned int speed_t; typedef unsigned int tcflag_t; -#define NCCS 32 -struct 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_cc[NCCS]; /* control characters */ - cc_t c_line; /* line discipline (== c_cc[33]) */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1 -#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1 - }; +#include /* c_cc characters */ #define VEOF 0 diff --git a/sysdeps/unix/sysv/linux/bits/termios-struct.h b/sysdeps/unix/sysv/linux/bits/termios-struct.h new file mode 100644 index 0000000000..ba56a547c1 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/termios-struct.h @@ -0,0 +1,36 @@ +/* struct termios definition. Linux/generic version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +#define NCCS 32 +struct 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[NCCS]; /* control characters */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ +#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1 +#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1 + }; diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h index 1e567affc3..93536130aa 100644 --- a/sysdeps/unix/sysv/linux/bits/termios.h +++ b/sysdeps/unix/sysv/linux/bits/termios.h @@ -24,20 +24,7 @@ typedef unsigned char cc_t; typedef unsigned int speed_t; typedef unsigned int tcflag_t; -#define NCCS 32 -struct 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[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1 -#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1 - }; +#include /* c_cc characters */ #define VINTR 0 diff --git a/sysdeps/unix/sysv/linux/kernel_termios.h b/sysdeps/unix/sysv/linux/kernel_termios.h index 6f505c7b61..cd000af833 100644 --- a/sysdeps/unix/sysv/linux/kernel_termios.h +++ b/sysdeps/unix/sysv/linux/kernel_termios.h @@ -31,4 +31,7 @@ struct __kernel_termios cc_t c_cc[__KERNEL_NCCS]; /* control characters */ }; +#define _HAVE_C_ISPEED 0 +#define _HAVE_C_OSPEED 0 + #endif /* kernel_termios.h */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios-struct.h b/sysdeps/unix/sysv/linux/mips/bits/termios-struct.h new file mode 100644 index 0000000000..f7684e51f1 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/bits/termios-struct.h @@ -0,0 +1,34 @@ +/* struct termios definition. Linux/mips version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +#define NCCS 32 +struct 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[NCCS]; /* control characters */ +#define _HAVE_STRUCT_TERMIOS_C_ISPEED 0 +#define _HAVE_STRUCT_TERMIOS_C_OSPEED 0 + }; diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h index 7969144633..2b2f873f35 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/termios.h +++ b/sysdeps/unix/sysv/linux/mips/bits/termios.h @@ -24,16 +24,7 @@ typedef unsigned char cc_t; typedef unsigned int speed_t; typedef unsigned int tcflag_t; -#define NCCS 32 -struct 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[NCCS]; /* control characters */ - }; +#include /* c_cc characters */ #define VINTR 0 /* Interrupt character [ISIG]. */ diff --git a/sysdeps/unix/sysv/linux/mips/kernel_termios.h b/sysdeps/unix/sysv/linux/mips/kernel_termios.h index 1c54b19428..5f88c745a0 100644 --- a/sysdeps/unix/sysv/linux/mips/kernel_termios.h +++ b/sysdeps/unix/sysv/linux/mips/kernel_termios.h @@ -31,4 +31,7 @@ struct __kernel_termios cc_t c_cc[__KERNEL_NCCS]; /* control characters */ }; +#define _HAVE_C_ISPEED 0 +#define _HAVE_C_OSPEED 0 + #endif /* kernel_termios.h */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h index afe592d5e4..ddb32bd7e5 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h @@ -23,25 +23,7 @@ typedef unsigned char cc_t; typedef unsigned int speed_t; typedef unsigned int tcflag_t; -/* - * termios type and macro definitions. Be careful about adding stuff - * to this file since it's used in GNU libc and there are strict rules - * concerning namespace pollution. - */ - -#define NCCS 32 -struct 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 (== c_cc[19]) */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -#define _HAVE_STRUCT_TERMIOS_C_ISPEED 1 -#define _HAVE_STRUCT_TERMIOS_C_OSPEED 1 -}; +#include /* c_cc characters */ #define VINTR 0 diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios-struct.h b/sysdeps/unix/sysv/linux/sparc/bits/termios-struct.h new file mode 100644 index 0000000000..7c3489e1b9 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/bits/termios-struct.h @@ -0,0 +1,34 @@ +/* struct termios definition. Linux/sparc version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +#define NCCS 17 +struct 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[NCCS]; /* control characters */ +#define _HAVE_STRUCT_TERMIOS_C_ISPEED 0 +#define _HAVE_STRUCT_TERMIOS_C_OSPEED 0 + }; diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h index ffe8483694..5fd6055c8e 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/termios.h @@ -24,16 +24,7 @@ typedef unsigned char cc_t; typedef unsigned int speed_t; typedef unsigned int tcflag_t; -#define NCCS 17 -struct 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[NCCS]; /* control characters */ - }; +#include /* c_cc characters */ #define VINTR 0 diff --git a/sysdeps/unix/sysv/linux/sparc/kernel_termios.h b/sysdeps/unix/sysv/linux/sparc/kernel_termios.h index 31c717ea9d..3a27382d36 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel_termios.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel_termios.h @@ -34,4 +34,7 @@ struct __kernel_termios cc_t c_cc[__KERNEL_NCCS]; /* control characters */ }; +#define _HAVE_C_ISPEED 0 +#define _HAVE_C_OSPEED 0 + #endif /* kernel_termios.h */ diff --git a/sysdeps/unix/sysv/linux/speed.c b/sysdeps/unix/sysv/linux/speed.c index 7db9e998c3..23834c10b5 100644 --- a/sysdeps/unix/sysv/linux/speed.c +++ b/sysdeps/unix/sysv/linux/speed.c @@ -58,7 +58,7 @@ cfsetospeed (struct termios *termios_p, speed_t speed) && (speed < B57600 || speed > __MAX_BAUD)) return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); -#ifdef _HAVE_STRUCT_TERMIOS_C_OSPEED +#if _HAVE_STRUCT_TERMIOS_C_OSPEED termios_p->c_ospeed = speed; #endif termios_p->c_cflag &= ~(CBAUD | CBAUDEX); @@ -80,7 +80,7 @@ cfsetispeed (struct termios *termios_p, speed_t speed) && (speed < B57600 || speed > __MAX_BAUD)) return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); -#ifdef _HAVE_STRUCT_TERMIOS_C_ISPEED +#if _HAVE_STRUCT_TERMIOS_C_ISPEED termios_p->c_ispeed = speed; #endif if (speed == 0) diff --git a/sysdeps/unix/sysv/linux/tcgetattr.c b/sysdeps/unix/sysv/linux/tcgetattr.c index 9748bc8cc4..b79d9f1462 100644 --- a/sysdeps/unix/sysv/linux/tcgetattr.c +++ b/sysdeps/unix/sysv/linux/tcgetattr.c @@ -44,15 +44,15 @@ __tcgetattr (int fd, struct termios *termios_p) termios_p->c_cflag = k_termios.c_cflag; termios_p->c_lflag = k_termios.c_lflag; termios_p->c_line = k_termios.c_line; -#ifdef _HAVE_STRUCT_TERMIOS_C_ISPEED -# ifdef _HAVE_C_ISPEED +#if _HAVE_STRUCT_TERMIOS_C_ISPEED +# if _HAVE_C_ISPEED termios_p->c_ispeed = k_termios.c_ispeed; # else termios_p->c_ispeed = k_termios.c_cflag & (CBAUD | CBAUDEX); # endif #endif -#ifdef _HAVE_STRUCT_TERMIOS_C_OSPEED -# ifdef _HAVE_C_OSPEED +#if _HAVE_STRUCT_TERMIOS_C_OSPEED +# if _HAVE_C_OSPEED termios_p->c_ospeed = k_termios.c_ospeed; # else termios_p->c_ospeed = k_termios.c_cflag & (CBAUD | CBAUDEX); diff --git a/sysdeps/unix/sysv/linux/tcsetattr.c b/sysdeps/unix/sysv/linux/tcsetattr.c index a916e70253..f8025a0473 100644 --- a/sysdeps/unix/sysv/linux/tcsetattr.c +++ b/sysdeps/unix/sysv/linux/tcsetattr.c @@ -66,10 +66,10 @@ __tcsetattr (int fd, int optional_actions, const struct termios *termios_p) k_termios.c_cflag = termios_p->c_cflag; k_termios.c_lflag = termios_p->c_lflag; k_termios.c_line = termios_p->c_line; -#if defined _HAVE_C_ISPEED && defined _HAVE_STRUCT_TERMIOS_C_ISPEED +#if _HAVE_C_ISPEED && _HAVE_STRUCT_TERMIOS_C_ISPEED k_termios.c_ispeed = termios_p->c_ispeed; #endif -#if defined _HAVE_C_OSPEED && defined _HAVE_STRUCT_TERMIOS_C_OSPEED +#if _HAVE_C_OSPEED && _HAVE_STRUCT_TERMIOS_C_OSPEED k_termios.c_ospeed = termios_p->c_ospeed; #endif memcpy (&k_termios.c_cc[0], &termios_p->c_cc[0], From patchwork Mon Oct 15 20:49:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 148889 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4251715lji; Mon, 15 Oct 2018 13:50:48 -0700 (PDT) X-Google-Smtp-Source: ACcGV63xIyoq2MSayqvDABycAhQR+5yn5ltXRK727tNE1HDJzIlVUprq+yNsRv670RY7YnEos7M8 X-Received: by 2002:a63:4e18:: with SMTP id c24-v6mr12997170pgb.6.1539636648270; Mon, 15 Oct 2018 13:50:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539636648; cv=none; d=google.com; s=arc-20160816; b=gg4pNRyoTurRDz5zVVcFvZ4313JqKXqWUEoibp9B1SYDEFYDdlbNUOAcjrUzxQj8qQ Iu0FyFc2cGTIYaWjd4G8y/4tbZEqKL7K7uzhfXBStx56u7yt6CvZw5OYmlI7iGOkbHRC StvoroJG1AQ0/hXi4BprukapvUdKcr4v1MjLZj63aipcuJ+fXYkDZfiZ71dABfZ2VfPc iEfmDykGPb49NsrnqjsL1aJR+EghV2KugksVOO6wozQz/uHmy+tkK2k/se/gWmUd7pbv wFEKG9iCbgMHdgT8i3C4odEk7ROeUgp2XRWLDxlNnhCM61MgNDrpI0X0zD6wcxkXKQKM BUIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=kbahxbjWIvsfMFmV6uGckKEzVSQzS6o7ox2Qc0ZRkCA=; b=Esq6MBw3IfNxSxlfrxBUN89Wg0L1nQgB0XH/AXCc3qMUCrb7PKijSWSGUdZpZ0fyRJ bt2kN7mbFC8lH0QF0otprsHF7czY+bca/GyZgZ1gA88l/qp1edmR519mrGo4hXxS1zLF 17RYwWJ0Wsq2V6HTG1dH6HNpJK5i/g8ba40ySefRxDQi8ZiplaqFcrSHxmej+f1vH8Bw efknH4KA1l3NCngaeDK4XFqNTiAVcAXPsxWHBr4NjfA3AY33OUZ1R9qCFd8lZxWyF9qQ 4CcoL81DiYIKgCim/mCwSoEBAuavsuZN1HQqWbJzqCnAYrfd/S3PGGiXi2DHST8F6wjw qiKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=nk7xIcTB; dkim=pass header.i=@linaro.org header.s=google header.b="Kp3a/hvz"; spf=pass (google.com: domain of libc-alpha-return-96439-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96439-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id i3-v6si11857271pgm.77.2018.10.15.13.50.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 13:50:48 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-96439-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=nk7xIcTB; dkim=pass header.i=@linaro.org header.s=google header.b="Kp3a/hvz"; spf=pass (google.com: domain of libc-alpha-return-96439-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96439-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=Li5elN186KBzpoSMKALfwcAGCYdTvG2 oJafOzD7ctO3NUAL5i07Cy02O9qWY0e1RsKvSHQhdF/s0Zg3Md30k2ZOSSGwe7Wa qX3zunoL+GW0raLYmaQC9kEJSY16jIW8esv345ZpmdvroFTG0rG7PLfHUvcujgz7 EYOXzHYUQfbE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=GNQyoAMtADI7KJGQrtZqdCdVpGw=; b=nk7xI cTBFjDX379X3vM9bZehgBzK5ervUJ+p3pNY3DWr0pC7hBOKp9j6j5vTIU0JQFznM gZaVjL4aJE5+fm1R1vXLXxoyMuE/FTKAkgXkgcxCwGhIydfxqd0h76Gdrv/6xfXj k0Fh8SERpmv2MX+09Iu3b58q3SaIkJe6xBFM4o= Received: (qmail 15322 invoked by alias); 15 Oct 2018 20:50:17 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 15040 invoked by uid 89); 15 Oct 2018 20:50:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=consolidate, Consolidate, Quit X-HELO: mail-qt1-f193.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kbahxbjWIvsfMFmV6uGckKEzVSQzS6o7ox2Qc0ZRkCA=; b=Kp3a/hvz++0alyn7npXgpdxG8tXW7YyQt2KNWztT11hyjIelIy7tQ6Bz5FGZVpusU9 Nv2flk9Dyd/IYi5XuGAE6fTE1gnBRKyWqzEzpuj8uG9akpOYqPAhPQcV5wJKO6cd5id2 ilfnSmWqyoUEpQxsLP9ClcN2PuwgQdpWprEyU= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: hpa@zytor.com Subject: [PATCH 03/12] termios: Consolidate termios c_cc symbolic constants Date: Mon, 15 Oct 2018 17:49:47 -0300 Message-Id: <20181015204956.25558-3-adhemerval.zanella@linaro.org> In-Reply-To: <20181015204956.25558-1-adhemerval.zanella@linaro.org> References: <20181015204956.25558-1-adhemerval.zanella@linaro.org> This patch consolidates the termios symbolic constants used as subscript for the array c_cc on its own header. The Linux generic implementation values match the kernel UAPI and each architecture with deviate values have their own implementation (in this case alpha, mips64, and sparc64). No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdeps_headers): Add termios-cc.h. * sysdeps/unix/sysv/linux/bits/termios-c_cc.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/termios-c_cc.h: New file. * sysdeps/unix/sysv/linux/mips/bits/termios-c_cc.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cc.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios-c_cc.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h (VINTR, VQUIT, VERASE, VKILL, VEOF, VTIME, VMIN, VSWTC, VSTART, VSTOP, VSUSP, VEOL, VREPRINT, VDISCARD, VWERASE, VLNEXT, VEOLF2): Move to termios-cc.h. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise. --- sysdeps/unix/sysv/linux/Makefile | 2 +- .../unix/sysv/linux/alpha/bits/termios-c_cc.h | 40 +++++++++++++++++ sysdeps/unix/sysv/linux/alpha/bits/termios.h | 20 +-------- sysdeps/unix/sysv/linux/bits/termios-c_cc.h | 40 +++++++++++++++++ sysdeps/unix/sysv/linux/bits/termios.h | 20 +-------- .../unix/sysv/linux/mips/bits/termios-c_cc.h | 43 +++++++++++++++++++ sysdeps/unix/sysv/linux/mips/bits/termios.h | 23 +--------- .../sysv/linux/powerpc/bits/termios-c_cc.h | 41 ++++++++++++++++++ .../unix/sysv/linux/powerpc/bits/termios.h | 21 +-------- .../unix/sysv/linux/sparc/bits/termios-c_cc.h | 43 +++++++++++++++++++ sysdeps/unix/sysv/linux/sparc/bits/termios.h | 23 +--------- 11 files changed, 213 insertions(+), 103 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/termios-c_cc.h create mode 100644 sysdeps/unix/sysv/linux/bits/termios-c_cc.h create mode 100644 sysdeps/unix/sysv/linux/mips/bits/termios-c_cc.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cc.h create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/termios-c_cc.h -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 184a5b19e1..ace8dcb631 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -43,7 +43,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ bits/siginfo-arch.h bits/siginfo-consts-arch.h \ bits/procfs.h bits/procfs-id.h bits/procfs-extra.h \ bits/procfs-prregset.h bits/mman-map-flags-generic.h \ - bits/msq-pad.h bits/termios-struct.h + bits/msq-pad.h bits/termios-struct.h bits/termios-c_cc.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios-c_cc.h b/sysdeps/unix/sysv/linux/alpha/bits/termios-c_cc.h new file mode 100644 index 0000000000..9ad1336ef6 --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios-c_cc.h @@ -0,0 +1,40 @@ +/* termios c_cc symbolic constant definitions. Linux/alpha version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_cc characters */ +#define VEOF 0 +#define VEOL 1 +#define VEOL2 2 +#define VERASE 3 +#define VWERASE 4 +#define VKILL 5 +#define VREPRINT 6 +#define VSWTC 7 +#define VINTR 8 +#define VQUIT 9 +#define VSUSP 10 +#define VSTART 12 +#define VSTOP 13 +#define VLNEXT 14 +#define VDISCARD 15 +#define VMIN 16 +#define VTIME 17 diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h index fe358dd8f5..25159890b5 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/termios.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios.h @@ -25,25 +25,7 @@ typedef unsigned int speed_t; typedef unsigned int tcflag_t; #include - -/* c_cc characters */ -#define VEOF 0 -#define VEOL 1 -#define VEOL2 2 -#define VERASE 3 -#define VWERASE 4 -#define VKILL 5 -#define VREPRINT 6 -#define VSWTC 7 -#define VINTR 8 -#define VQUIT 9 -#define VSUSP 10 -#define VSTART 12 -#define VSTOP 13 -#define VLNEXT 14 -#define VDISCARD 15 -#define VMIN 16 -#define VTIME 17 +#include /* c_iflag bits */ #define IGNBRK 0000001 diff --git a/sysdeps/unix/sysv/linux/bits/termios-c_cc.h b/sysdeps/unix/sysv/linux/bits/termios-c_cc.h new file mode 100644 index 0000000000..80d5e6d2ce --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/termios-c_cc.h @@ -0,0 +1,40 @@ +/* termios c_cc symbolic constant definitions. Linux/generic version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_cc characters */ +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VEOF 4 +#define VTIME 5 +#define VMIN 6 +#define VSWTC 7 +#define VSTART 8 +#define VSTOP 9 +#define VSUSP 10 +#define VEOL 11 +#define VREPRINT 12 +#define VDISCARD 13 +#define VWERASE 14 +#define VLNEXT 15 +#define VEOL2 16 diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h index 93536130aa..1fba973734 100644 --- a/sysdeps/unix/sysv/linux/bits/termios.h +++ b/sysdeps/unix/sysv/linux/bits/termios.h @@ -25,25 +25,7 @@ typedef unsigned int speed_t; typedef unsigned int tcflag_t; #include - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 +#include /* c_iflag bits */ #define IGNBRK 0000001 diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios-c_cc.h b/sysdeps/unix/sysv/linux/mips/bits/termios-c_cc.h new file mode 100644 index 0000000000..573efbc9d3 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/bits/termios-c_cc.h @@ -0,0 +1,43 @@ +/* termios c_cc symbolic constant definitions. Linux/mips version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_cc characters */ +#define VINTR 0 /* Interrupt character [ISIG]. */ +#define VQUIT 1 /* Quit character [ISIG]. */ +#define VERASE 2 /* Erase character [ICANON]. */ +#define VKILL 3 /* Kill-line character [ICANON]. */ +#define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */ +#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */ +#define VEOL2 6 /* Second EOL character [ICANON]. */ +#define VSWTC 7 +#define VSWTCH VSWTC +#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */ +#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */ +#define VSUSP 10 /* Suspend character [ISIG]. */ + /* VDSUSP is not supported on Linux. */ +/* #define VDSUSP 11 / * Delayed suspend character [ISIG]. */ +#define VREPRINT 12 /* Reprint-line character [ICANON]. */ +#define VDISCARD 13 /* Discard character [IEXTEN]. */ +#define VWERASE 14 /* Word-erase character [ICANON]. */ +#define VLNEXT 15 /* Literal-next character [IEXTEN]. */ +#define VEOF 16 /* End-of-file character [ICANON]. */ +#define VEOL 17 /* End-of-line character [ICANON]. */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h index 2b2f873f35..1153763ae8 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/termios.h +++ b/sysdeps/unix/sysv/linux/mips/bits/termios.h @@ -25,28 +25,7 @@ typedef unsigned int speed_t; typedef unsigned int tcflag_t; #include - -/* c_cc characters */ -#define VINTR 0 /* Interrupt character [ISIG]. */ -#define VQUIT 1 /* Quit character [ISIG]. */ -#define VERASE 2 /* Erase character [ICANON]. */ -#define VKILL 3 /* Kill-line character [ICANON]. */ -#define VMIN 4 /* Minimum number of bytes read at once [!ICANON]. */ -#define VTIME 5 /* Time-out value (tenths of a second) [!ICANON]. */ -#define VEOL2 6 /* Second EOL character [ICANON]. */ -#define VSWTC 7 -#define VSWTCH VSWTC -#define VSTART 8 /* Start (X-ON) character [IXON, IXOFF]. */ -#define VSTOP 9 /* Stop (X-OFF) character [IXON, IXOFF]. */ -#define VSUSP 10 /* Suspend character [ISIG]. */ - /* VDSUSP is not supported on Linux. */ -/* #define VDSUSP 11 / * Delayed suspend character [ISIG]. */ -#define VREPRINT 12 /* Reprint-line character [ICANON]. */ -#define VDISCARD 13 /* Discard character [IEXTEN]. */ -#define VWERASE 14 /* Word-erase character [ICANON]. */ -#define VLNEXT 15 /* Literal-next character [IEXTEN]. */ -#define VEOF 16 /* End-of-file character [ICANON]. */ -#define VEOL 17 /* End-of-line character [ICANON]. */ +#include /* c_iflag bits */ #define IGNBRK 0000001 /* Ignore break condition. */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cc.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cc.h new file mode 100644 index 0000000000..8c75e25339 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cc.h @@ -0,0 +1,41 @@ +/* termios c_cc symbolic constant definitions. Linux/powerpc version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_cc characters */ +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VEOF 4 +#define VMIN 5 +#define VEOL 6 +#define VTIME 7 +#define VEOL2 8 +#define VSWTC 9 + +#define VWERASE 10 +#define VREPRINT 11 +#define VSUSP 12 +#define VSTART 13 +#define VSTOP 14 +#define VLNEXT 15 +#define VDISCARD 16 diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h index ddb32bd7e5..2253143734 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h @@ -24,26 +24,7 @@ typedef unsigned int speed_t; typedef unsigned int tcflag_t; #include - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VMIN 5 -#define VEOL 6 -#define VTIME 7 -#define VEOL2 8 -#define VSWTC 9 - -#define VWERASE 10 -#define VREPRINT 11 -#define VSUSP 12 -#define VSTART 13 -#define VSTOP 14 -#define VLNEXT 15 -#define VDISCARD 16 +#include /* c_iflag bits */ #define IGNBRK 0000001 diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios-c_cc.h b/sysdeps/unix/sysv/linux/sparc/bits/termios-c_cc.h new file mode 100644 index 0000000000..09b504273b --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/bits/termios-c_cc.h @@ -0,0 +1,43 @@ +/* termios c_cc symbolic constant definitions. Linux/sparc version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_cc characters */ +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VEOF 4 +#define VEOL 5 +#define VEOL2 6 +#define VSWTC 7 +#define VSTART 8 +#define VSTOP 9 +#define VSUSP 10 +#define VDSUSP 11 /* SunOS POSIX nicety I do believe... */ +#define VREPRINT 12 +#define VDISCARD 13 +#define VWERASE 14 +#define VLNEXT 15 + +/* User apps assume vmin/vtime is shared with eof/eol */ +#define VMIN VEOF +#define VTIME VEOL diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h index 5fd6055c8e..a2588c2158 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/termios.h @@ -25,28 +25,7 @@ typedef unsigned int speed_t; typedef unsigned int tcflag_t; #include - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VEOL 5 -#define VEOL2 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VDSUSP 11 /* SunOS POSIX nicety I do believe... */ -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 - -/* User apps assume vmin/vtime is shared with eof/eol */ -#define VMIN VEOF -#define VTIME VEOL +#include /* c_iflag bits */ #define IGNBRK 0x00000001 From patchwork Mon Oct 15 20:49:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 148888 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4251572lji; Mon, 15 Oct 2018 13:50:36 -0700 (PDT) X-Google-Smtp-Source: ACcGV61eqbnjmva1k4uqa5SZt5jyR9oupgD6Iu5TZC2JFGpZY/OBwHc0Xd/aHbh7qOxeDFvNkrvz X-Received: by 2002:a62:4e09:: with SMTP id c9-v6mr19087458pfb.105.1539636636503; Mon, 15 Oct 2018 13:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539636636; cv=none; d=google.com; s=arc-20160816; b=ytc105iXRQUL+rekmTOpN/XTIBVk1eedU3XY1kezzod7VOK+C6VeD3GP5wmNRVzX+k I6Rq51r2xFgLuWn/9hyRB8Ezmn6oiYTlVYE/Sw6g8ii3+Cl93RJjZy7p5O4DntqXYStv E9ZLivpwu4U+zBcIzKOxfUs7rzZ8dspIkrBueCKkfLI7B2nXSoJHnHyoMd7qmqKkf9Ke Wugb57P19XdMrsjJ1xBzsDWZNreL7QkvFOHMNSqmwQAsiNEjV7Z99AjxxHFDt2Gctkw4 OuuMBALmdYlI7XrxxeteuzoWVKgpGJf220JeEjHMjBS1jX5XY4KKxGwQwdscwshM5VvP 95gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=+L4hbbdMls/sBsgSqQ3N0I3Y/C/lKc3xotHSGEKWVfA=; b=0Dgc25x3D3X7d48ky8qRqvKFtsaXpm6FsYKtqiP9QTimwpoYVMtR7qir72cm6Dsis8 uok8t+reS3orG9+E6pBka3OxpIunHlmnp3uOFM2NU2HjZdF3b4Ib5TfFTYKT1u0LSxkV ld0oaCXmhbpEWo6buVTOm2e4ZmyTPTmHKQaHO6H4HWmZA1gFV9XHFElfN0p/zIGb8Mc4 TkT8S33/ctj+mON+GsyxsTYHshVruS3aUjn28oKLcmpAu/g2T4yx/W0/KN/slrhXh/9J VzHYdr/o8UTNOC5ZQ+eLkfMOyQNV3n99YRrGnnslZaVFCU3pfD/YLTQQYyUZgjS2dB4l 3XGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=f4N06UqO; dkim=pass header.i=@linaro.org header.s=google header.b=Gu2RFyF6; spf=pass (google.com: domain of libc-alpha-return-96438-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96438-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y198-v6si7989925pfb.59.2018.10.15.13.50.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 13:50:36 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-96438-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=f4N06UqO; dkim=pass header.i=@linaro.org header.s=google header.b=Gu2RFyF6; spf=pass (google.com: domain of libc-alpha-return-96438-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96438-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=Nk4hMdgBomtoymBK01MHUdhNYXkrZpk +Yp1T8BDwC/OTVp04xb04GXcRBil7j5qB3rOYhzHR+quh9PFNh7nVNfokllFKkVP p9vHEXf/5RYj/iSAKjNw0MwF6ZjntL58GzJkmBpUoFFEPmJ61I6uPIR1BAHatmtC CPf+9SW/xXkw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=JIsb2HgJEVGDS1pZWg8BGVKK0Fg=; b=f4N06 UqOh7qi+7VCfkTQ95g5paREeIgrecGYtXPJYjNfTUoE53N58+jgfarTU23cgMiPH 5KiETPckh7BDuJkp2cvybU2Ir0ofn1nnHo9ddBm6ukv0dnJRoGjw+0ojOhgFTZd0 ZdcTMuasopCQHHYQb0+fhrlaae1ZjOJcgqJN+E= Received: (qmail 15146 invoked by alias); 15 Oct 2018 20:50:16 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 15027 invoked by uid 89); 15 Oct 2018 20:50:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.3 required=5.0 tests=AWL, BAYES_00, FUZZY_XPILL, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=bell, consolidate, 0000002, Consolidate X-HELO: mail-qk1-f194.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+L4hbbdMls/sBsgSqQ3N0I3Y/C/lKc3xotHSGEKWVfA=; b=Gu2RFyF6tk0SLcuqXyXP8C4CaP3Ez2Af9B3A2NWTWa3rSNyXJaD5s9INkVnZU9D8gt QWHveDNKSu7fATttj6/dfpHXMduapjD0LdCJ8ZJBauVSgsUnoLbnqLOSNiV5Bw/sQIDP sjmGLdG3nx28rO0Vuis8/EYk5smbyMNQdEWdE= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: hpa@zytor.com Subject: [PATCH 04/12] termios: Consolidate Input Modes definitions. Date: Mon, 15 Oct 2018 17:49:48 -0300 Message-Id: <20181015204956.25558-4-adhemerval.zanella@linaro.org> In-Reply-To: <20181015204956.25558-1-adhemerval.zanella@linaro.org> References: <20181015204956.25558-1-adhemerval.zanella@linaro.org> This patch consolidates the termios symbolic constants used for input modes with c_iflag member on its own header. The Linux generic implementation values match the kernel UAPI and each architecture with deviate values have their own implementation (in this case alpha and powerpc). No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdeps_headers): Add termios-c_iflag.h. * sysdeps/unix/sysv/linux/bits/termios-c_iflag.h: New file. * sysdeps/unix/sysv/linux/alpha/bits/termios-c_iflag.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios-c_iflag.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h (IGNBRK, BRKINT, IGNPAR, PARMRK, INPCK, ISTRIP, INLCR, IGNCR, ICRNL, IXON, IXOFF, IXANY, IUCLC, IMAXBEL, IUTF8): Move to termios-c_iflag.h. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise. --- sysdeps/unix/sysv/linux/Makefile | 3 +- .../sysv/linux/alpha/bits/termios-c_iflag.h | 38 ++++++++++++++++++ sysdeps/unix/sysv/linux/alpha/bits/termios.h | 18 +-------- .../unix/sysv/linux/bits/termios-c_iflag.h | 40 +++++++++++++++++++ sysdeps/unix/sysv/linux/bits/termios.h | 18 +-------- sysdeps/unix/sysv/linux/mips/bits/termios.h | 18 +-------- .../sysv/linux/powerpc/bits/termios-c_iflag.h | 38 ++++++++++++++++++ .../unix/sysv/linux/powerpc/bits/termios.h | 18 +-------- sysdeps/unix/sysv/linux/sparc/bits/termios.h | 18 +-------- 9 files changed, 123 insertions(+), 86 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/termios-c_iflag.h create mode 100644 sysdeps/unix/sysv/linux/bits/termios-c_iflag.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/termios-c_iflag.h -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index ace8dcb631..2f5a59cb11 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -43,7 +43,8 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ bits/siginfo-arch.h bits/siginfo-consts-arch.h \ bits/procfs.h bits/procfs-id.h bits/procfs-extra.h \ bits/procfs-prregset.h bits/mman-map-flags-generic.h \ - bits/msq-pad.h bits/termios-struct.h bits/termios-c_cc.h + bits/msq-pad.h bits/termios-struct.h bits/termios-c_cc.h \ + bits/termios-c_iflag.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios-c_iflag.h b/sysdeps/unix/sysv/linux/alpha/bits/termios-c_iflag.h new file mode 100644 index 0000000000..11584250d5 --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios-c_iflag.h @@ -0,0 +1,38 @@ +/* termios input mode definitions. Linux/alpha version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_iflag bits */ +#define IGNBRK 0000001 +#define BRKINT 0000002 +#define IGNPAR 0000004 +#define PARMRK 0000010 +#define INPCK 0000020 +#define ISTRIP 0000040 +#define INLCR 0000100 +#define IGNCR 0000200 +#define ICRNL 0000400 +#define IXON 0001000 +#define IXOFF 0002000 +#define IXANY 0004000 +#define IUCLC 0010000 +#define IMAXBEL 0020000 +#define IUTF8 0040000 diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h index 25159890b5..4d49c66aa8 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/termios.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios.h @@ -26,23 +26,7 @@ typedef unsigned int tcflag_t; #include #include - -/* c_iflag bits */ -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IXON 0001000 -#define IXOFF 0002000 -#define IXANY 0004000 -#define IUCLC 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 +#include /* c_oflag bits */ #define OPOST 0000001 diff --git a/sysdeps/unix/sysv/linux/bits/termios-c_iflag.h b/sysdeps/unix/sysv/linux/bits/termios-c_iflag.h new file mode 100644 index 0000000000..c365b82262 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/termios-c_iflag.h @@ -0,0 +1,40 @@ +/* termios input mode definitions. Linux/generic version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_iflag bits */ +#define IGNBRK 0000001 /* Ignore break condition. */ +#define BRKINT 0000002 /* Signal interrupt on break. */ +#define IGNPAR 0000004 /* Ignore characters with parity errors. */ +#define PARMRK 0000010 /* Mark parity and framing errors. */ +#define INPCK 0000020 /* Enable input parity check. */ +#define ISTRIP 0000040 /* Strip 8th bit off characters. */ +#define INLCR 0000100 /* Map NL to CR on input. */ +#define IGNCR 0000200 /* Ignore CR. */ +#define ICRNL 0000400 /* Map CR to NL on input. */ +#define IUCLC 0001000 /* Map uppercase characters to lowercase on input + (not in POSIX). */ +#define IXON 0002000 /* Enable start/stop output control. */ +#define IXANY 0004000 /* Enable any character to restart output. */ +#define IXOFF 0010000 /* Enable start/stop input control. */ +#define IMAXBEL 0020000 /* Ring bell when input queue is full + (not in POSIX). */ +#define IUTF8 0040000 /* Input is UTF8 (not in POSIX). */ diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h index 1fba973734..6ce5c56049 100644 --- a/sysdeps/unix/sysv/linux/bits/termios.h +++ b/sysdeps/unix/sysv/linux/bits/termios.h @@ -26,23 +26,7 @@ typedef unsigned int tcflag_t; #include #include - -/* c_iflag bits */ -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 +#include /* c_oflag bits */ #define OPOST 0000001 diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h index 1153763ae8..a8a37ff176 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/termios.h +++ b/sysdeps/unix/sysv/linux/mips/bits/termios.h @@ -26,23 +26,7 @@ typedef unsigned int tcflag_t; #include #include - -/* c_iflag bits */ -#define IGNBRK 0000001 /* Ignore break condition. */ -#define BRKINT 0000002 /* Signal interrupt on break. */ -#define IGNPAR 0000004 /* Ignore characters with parity errors. */ -#define PARMRK 0000010 /* Mark parity and framing errors. */ -#define INPCK 0000020 /* Enable input parity check. */ -#define ISTRIP 0000040 /* Strip 8th bit off characters. */ -#define INLCR 0000100 /* Map NL to CR on input. */ -#define IGNCR 0000200 /* Ignore CR. */ -#define ICRNL 0000400 /* Map CR to NL on input. */ -#define IUCLC 0001000 /* Map upper case to lower case on input. */ -#define IXON 0002000 /* Enable start/stop output control. */ -#define IXANY 0004000 /* Any character will restart after stop. */ -#define IXOFF 0010000 /* Enable start/stop input control. */ -#define IMAXBEL 0020000 /* Ring bell when input queue is full. */ -#define IUTF8 0040000 /* Input is UTF8. */ +#include /* c_oflag bits */ #define OPOST 0000001 /* Perform output processing. */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_iflag.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_iflag.h new file mode 100644 index 0000000000..c728b4d110 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_iflag.h @@ -0,0 +1,38 @@ +/* termios input mode definitions. Linux/powerpc version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_iflag bits */ +#define IGNBRK 0000001 +#define BRKINT 0000002 +#define IGNPAR 0000004 +#define PARMRK 0000010 +#define INPCK 0000020 +#define ISTRIP 0000040 +#define INLCR 0000100 +#define IGNCR 0000200 +#define ICRNL 0000400 +#define IXON 0001000 +#define IXOFF 0002000 +#define IXANY 0004000 +#define IUCLC 0010000 +#define IMAXBEL 0020000 +#define IUTF8 0040000 diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h index 2253143734..4ccabd7095 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h @@ -25,23 +25,7 @@ typedef unsigned int tcflag_t; #include #include - -/* c_iflag bits */ -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IXON 0001000 -#define IXOFF 0002000 -#define IXANY 0004000 -#define IUCLC 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 +#include /* c_oflag bits */ #define OPOST 0000001 diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h index a2588c2158..4123ed7aaa 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/termios.h @@ -26,23 +26,7 @@ typedef unsigned int tcflag_t; #include #include - -/* c_iflag bits */ -#define IGNBRK 0x00000001 -#define BRKINT 0x00000002 -#define IGNPAR 0x00000004 -#define PARMRK 0x00000008 -#define INPCK 0x00000010 -#define ISTRIP 0x00000020 -#define INLCR 0x00000040 -#define IGNCR 0x00000080 -#define ICRNL 0x00000100 -#define IUCLC 0x00000200 -#define IXON 0x00000400 -#define IXANY 0x00000800 -#define IXOFF 0x00001000 -#define IMAXBEL 0x00002000 -#define IUTF8 0x00004000 +#include /* c_oflag bits */ #define OPOST 0x00000001 From patchwork Mon Oct 15 20:49:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 148890 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4251849lji; Mon, 15 Oct 2018 13:50:59 -0700 (PDT) X-Google-Smtp-Source: ACcGV62YIlh2hrx2h8mdSSMGZZUTi0fpggIMKhsx1v3UAbFWcCzcn5dz+uxv5cmaIk9+tvopemxT X-Received: by 2002:a62:174e:: with SMTP id 75-v6mr10855233pfx.117.1539636659093; Mon, 15 Oct 2018 13:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539636659; cv=none; d=google.com; s=arc-20160816; b=N54dMZYa1RWslvHR52DX7SFxrfW1SU65W2j5UOnZ0RkybzV7Aku2kIEdWYtPdzqX9c AJQkpbkgvS3ZnaPB/e3ys4b9NjGayLdo2+d4ayv+m94Czkvtm3ox94ruaWFiyi+/Peow hnmpRrhrTdbaOIlloTzwovqtcFLlczgMEiQdgW2cXBhenQa1+ICq7Tt6mPhICX0nZC1l 4Z1NkjZE2NuDjIDY2Q29aYB7JNIrmZcjfqmDRMhotYJ3YaFOQY8UvOlgook5i3h0yWzt LBjiFlU/XwIJUQFc/fP/9blU6lJ+C7hahVn0NHLwF60YBzdjmWLa2+Ur9tP8SpDwZZD+ gM1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=1CMAsmCrUa/QTa8s6etJDXOyrpZlR7bZ7eas3BfHxwM=; b=kCqW2j3zqhoGttnHUG0M4uFPJNhKJNtEdR9jxK+BXM26tKivIXx1cYHp7pBL2xyQfT arwEss4Gexim/+2XuTHd5fkyGEri0iFi9GHB5xsq4SxoWzC2QZwCIbK8ZaIE4D8NiaCl vivT0vGXve+5zne9c+oegg2N/lubi2Z323ru/Jsg79cyugnQrFRVpiwgrChLmZNNGks1 8cHKUI48QnM/5xWDDRe47gOvRLUOI32FJThYXWVlpOtjZ+mJtqmxobCOpznMJovsE9ID pgpNIHuT2FHtjqX0Z9I9ie7+voWNqcbg5VUAJjsI3dqXKsxuIH2A9ziE2svr/48uIhTP KaDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=xB6r+hW7; dkim=pass header.i=@linaro.org header.s=google header.b=UER7Eoh2; spf=pass (google.com: domain of libc-alpha-return-96440-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96440-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id w11-v6si10721878pfn.212.2018.10.15.13.50.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 13:50:59 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-96440-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=xB6r+hW7; dkim=pass header.i=@linaro.org header.s=google header.b=UER7Eoh2; spf=pass (google.com: domain of libc-alpha-return-96440-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96440-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=Ns0AfKWk+53bs7d187ueDZdPYGYMZB6 roaEKtt2+1DQ8biJFzsLznMM8xOmUelSq8Q8KA66jfl8K26UaxwRQi2sf9WN7qj6 0l+KmCL2Nvlvtnws66UVTapESvOX6XYHI2R9IK2bMDi+4wWNwUv3gZ4r3tVqrqCA X0IvIm20ARys= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=jjHmTBPyFgSaLOIl7NYg5y6758c=; b=xB6r+ hW7Eu6eBzI7WvgUhvcGWhGeqZ5gpWvnkXHjqZZwk5hL5/7PILVlRxLLnBPLxA6y/ 8hS9lABGtdB42HqhgGXqxsYe5me5LJNSLFrIrBF7SycPrWjweBwuw6mui29G1VVb DrGCQ/9YPWe716OOc8NV7psf0zXRytvjgNA8mU= Received: (qmail 15388 invoked by alias); 15 Oct 2018 20:50:18 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 15145 invoked by uid 89); 15 Oct 2018 20:50:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=delays, 0000002 X-HELO: mail-qk1-f193.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1CMAsmCrUa/QTa8s6etJDXOyrpZlR7bZ7eas3BfHxwM=; b=UER7Eoh2iEisN5JEuzfKur1opmbs2ZEZ1bAHIlaqktsdsyCIikRojiL2pmlhdpcJZQ 1ZcYYGnNJhZFfPIS30Prod7/VKs9lqd9F0KxBXW7mv8mP2S4B7RLBG5lwVtXpaVcBVaX aef8d0RKoF4apyEs+NgYFdmZxlWr5zpal+myk= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: hpa@zytor.com Subject: [PATCH 05/12] termios: Consolidate Output Modes definitions Date: Mon, 15 Oct 2018 17:49:49 -0300 Message-Id: <20181015204956.25558-5-adhemerval.zanella@linaro.org> In-Reply-To: <20181015204956.25558-1-adhemerval.zanella@linaro.org> References: <20181015204956.25558-1-adhemerval.zanella@linaro.org> This patch consolidates the termios symbolic constants used for ouput modes with c_oflag member on its own header. The Linux generic implementation values match the kernel UAPI and each architecture with deviate values have their own implementation (in this case alpha, powerpc, and sparc). No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Add termios-c_oflag.h. * sysdeps/unix/sysv/linux/bits/termios-c_oflag.h: New file. * sysdeps/unix/sysv/linux/alpha/bits/termios-c_oflag.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios-c_oflag.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios-c_oflag.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h (OPOST, OLCUC, ONLCR, OCRNL, ONOCR, ONLRET, OFILL, OFDEL, VTDLY, VT0, VT1): Move to termios-c_oflag.h. [__USE_MISC || __USE_XOPEN] (NLDLY, NL0, NL1, CRDLY, CR0, CR1, CR2, CR3, TABDLY, TAB0, TAB1, TAB2, TAB3, BSDLY, BS0, BS1, FFDLY, FF0, FFR1): Likewise. [USE_MISC] (XTABS): Likewise. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h Likewise. --- sysdeps/unix/sysv/linux/Makefile | 2 +- .../sysv/linux/alpha/bits/termios-c_oflag.h | 66 +++++++++++++++++++ sysdeps/unix/sysv/linux/alpha/bits/termios.h | 46 +------------ .../unix/sysv/linux/bits/termios-c_oflag.h | 61 +++++++++++++++++ sysdeps/unix/sysv/linux/bits/termios.h | 40 +---------- sysdeps/unix/sysv/linux/mips/bits/termios.h | 40 +---------- .../sysv/linux/powerpc/bits/termios-c_oflag.h | 65 ++++++++++++++++++ .../unix/sysv/linux/powerpc/bits/termios.h | 45 +------------ .../sysv/linux/sparc/bits/termios-c_oflag.h | 64 ++++++++++++++++++ sysdeps/unix/sysv/linux/sparc/bits/termios.h | 44 +------------ 10 files changed, 262 insertions(+), 211 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/termios-c_oflag.h create mode 100644 sysdeps/unix/sysv/linux/bits/termios-c_oflag.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/termios-c_oflag.h create mode 100644 sysdeps/unix/sysv/linux/sparc/bits/termios-c_oflag.h -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 2f5a59cb11..097107c82c 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -44,7 +44,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ bits/procfs.h bits/procfs-id.h bits/procfs-extra.h \ bits/procfs-prregset.h bits/mman-map-flags-generic.h \ bits/msq-pad.h bits/termios-struct.h bits/termios-c_cc.h \ - bits/termios-c_iflag.h + bits/termios-c_iflag.h bits/termios-c_oflag.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios-c_oflag.h b/sysdeps/unix/sysv/linux/alpha/bits/termios-c_oflag.h new file mode 100644 index 0000000000..6458f6556b --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios-c_oflag.h @@ -0,0 +1,66 @@ +/* termios output mode definitions. Linux/alpha version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_oflag bits */ +#define OPOST 0000001 +#define ONLCR 0000002 +#define OLCUC 0000004 + +#define OCRNL 0000010 +#define ONOCR 0000020 +#define ONLRET 0000040 + +#define OFILL 00000100 +#define OFDEL 00000200 +#if defined __USE_MISC || defined __USE_XOPEN +# define NLDLY 00001400 +# define NL0 00000000 +# define NL1 00000400 +# if defined __USE_MISC +# define NL2 00001000 +# define NL3 00001400 +# endif +# define TABDLY 00006000 +# define TAB0 00000000 +# define TAB1 00002000 +# define TAB2 00004000 +# define TAB3 00006000 +# define CRDLY 00030000 +# define CR0 00000000 +# define CR1 00010000 +# define CR2 00020000 +# define CR3 00030000 +# define FFDLY 00040000 +# define FF0 00000000 +# define FF1 00040000 +# define BSDLY 00100000 +# define BS0 00000000 +# define BS1 00100000 +#endif + +#define VTDLY 00200000 +#define VT0 00000000 +#define VT1 00200000 + +#ifdef __USE_MISC +# define XTABS TAB3 +#endif diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h index 4d49c66aa8..7259c1dd30 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/termios.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios.h @@ -27,51 +27,7 @@ typedef unsigned int tcflag_t; #include #include #include - -/* c_oflag bits */ -#define OPOST 0000001 -#define ONLCR 0000002 -#define OLCUC 0000004 - -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 - -#define OFILL 00000100 -#define OFDEL 00000200 -#if defined __USE_MISC || defined __USE_XOPEN -# define NLDLY 00001400 -# define NL0 00000000 -# define NL1 00000400 -# if defined __USE_MISC -# define NL2 00001000 -# define NL3 00001400 -# endif -# define TABDLY 00006000 -# define TAB0 00000000 -# define TAB1 00002000 -# define TAB2 00004000 -# define TAB3 00006000 -# define CRDLY 00030000 -# define CR0 00000000 -# define CR1 00010000 -# define CR2 00020000 -# define CR3 00030000 -# define FFDLY 00040000 -# define FF0 00000000 -# define FF1 00040000 -# define BSDLY 00100000 -# define BS0 00000000 -# define BS1 00100000 -#endif - -#define VTDLY 00200000 -#define VT0 00000000 -#define VT1 00200000 - -#ifdef __USE_MISC -# define XTABS TAB3 -#endif +#include /* c_cflag bit meaning */ #ifdef __USE_MISC diff --git a/sysdeps/unix/sysv/linux/bits/termios-c_oflag.h b/sysdeps/unix/sysv/linux/bits/termios-c_oflag.h new file mode 100644 index 0000000000..038005b1cb --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/termios-c_oflag.h @@ -0,0 +1,61 @@ +/* termios output mode definitions. Linux/generic version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_oflag bits */ +#define OPOST 0000001 /* Post-process output. */ +#define OLCUC 0000002 /* Map lowercase characters to uppercase on output. + (not in POSIX). */ +#define ONLCR 0000004 /* Map NL to CR-NL on output. */ +#define OCRNL 0000010 /* Map CR to NL on output. */ +#define ONOCR 0000020 /* No CR output at column 0. */ +#define ONLRET 0000040 /* NL performs CR function. */ +#define OFILL 0000100 /* Use fill characters for delay. */ +#define OFDEL 0000200 /* Fill is DEL. */ +#if defined __USE_MISC || defined __USE_XOPEN +# define NLDLY 0000400 /* Select newline delays: */ +# define NL0 0000000 /* Newline type 0. */ +# define NL1 0000400 /* Newline type 1. */ +# define CRDLY 0003000 /* Select carriage-return delays: */ +# define CR0 0000000 /* Carriage-return delay type 0. */ +# define CR1 0001000 /* Carriage-return delay type 1. */ +# define CR2 0002000 /* Carriage-return delay type 2. */ +# define CR3 0003000 /* Carriage-return delay type 3. */ +# define TABDLY 0014000 /* Select horizontal-tab delays: */ +# define TAB0 0000000 /* Horizontal-tab delay type 0. */ +# define TAB1 0004000 /* Horizontal-tab delay type 1. */ +# define TAB2 0010000 /* Horizontal-tab delay type 2. */ +# define TAB3 0014000 /* Expand tabs to spaces. */ +# define BSDLY 0020000 /* Select backspace delays: */ +# define BS0 0000000 /* Backspace-delay type 0. */ +# define BS1 0020000 /* Backspace-delay type 1. */ +# define FFDLY 0100000 /* Select form-feed delays: */ +# define FF0 0000000 /* Form-feed delay type 0. */ +# define FF1 0100000 /* Form-feed delay type 1. */ +#endif + +#define VTDLY 0040000 /* Select vertical-tab delays: */ +#define VT0 0000000 /* Vertical-tab delay type 0. */ +#define VT1 0040000 /* Vertical-tab delay type 1. */ + +#ifdef __USE_MISC +# define XTABS 0014000 +#endif diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h index 6ce5c56049..15b279b01e 100644 --- a/sysdeps/unix/sysv/linux/bits/termios.h +++ b/sysdeps/unix/sysv/linux/bits/termios.h @@ -27,45 +27,7 @@ typedef unsigned int tcflag_t; #include #include #include - -/* c_oflag bits */ -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#if defined __USE_MISC || defined __USE_XOPEN -# define NLDLY 0000400 -# define NL0 0000000 -# define NL1 0000400 -# define CRDLY 0003000 -# define CR0 0000000 -# define CR1 0001000 -# define CR2 0002000 -# define CR3 0003000 -# define TABDLY 0014000 -# define TAB0 0000000 -# define TAB1 0004000 -# define TAB2 0010000 -# define TAB3 0014000 -# define BSDLY 0020000 -# define BS0 0000000 -# define BS1 0020000 -# define FFDLY 0100000 -# define FF0 0000000 -# define FF1 0100000 -#endif - -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 - -#ifdef __USE_MISC -# define XTABS 0014000 -#endif +#include /* c_cflag bit meaning */ #ifdef __USE_MISC diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h index a8a37ff176..f851adbfe1 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/termios.h +++ b/sysdeps/unix/sysv/linux/mips/bits/termios.h @@ -27,45 +27,7 @@ typedef unsigned int tcflag_t; #include #include #include - -/* c_oflag bits */ -#define OPOST 0000001 /* Perform output processing. */ -#define OLCUC 0000002 /* Map lower case to upper case on output. */ -#define ONLCR 0000004 /* Map NL to CR-NL on output. */ -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#if defined __USE_MISC || defined __USE_XOPEN -# define NLDLY 0000400 -# define NL0 0000000 -# define NL1 0000400 -# define CRDLY 0003000 -# define CR0 0000000 -# define CR1 0001000 -# define CR2 0002000 -# define CR3 0003000 -# define TABDLY 0014000 -# define TAB0 0000000 -# define TAB1 0004000 -# define TAB2 0010000 -# define TAB3 0014000 -# define BSDLY 0020000 -# define BS0 0000000 -# define BS1 0020000 -# define FFDLY 0100000 -# define FF0 0000000 -# define FF1 0100000 -#endif - -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 - -#ifdef __USE_MISC -# define XTABS 0014000 -#endif +#include /* c_cflag bit meaning */ #ifdef __USE_MISC diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_oflag.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_oflag.h new file mode 100644 index 0000000000..5e944df7cc --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_oflag.h @@ -0,0 +1,65 @@ +/* termios output mode definitions. Linux/powerpc version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_oflag bits */ +#define OPOST 0000001 +#define ONLCR 0000002 +#define OLCUC 0000004 + +#define OCRNL 0000010 +#define ONOCR 0000020 +#define ONLRET 0000040 + +#define OFILL 00000100 +#define OFDEL 00000200 +#if defined __USE_MISC || defined __USE_XOPEN +# define NLDLY 00001400 +# define NL0 00000000 +# define NL1 00000400 +# if defined __USE_MISC +# define NL2 00001000 +# define NL3 00001400 +# endif +# define TABDLY 00006000 +# define TAB0 00000000 +# define TAB1 00002000 +# define TAB2 00004000 +# define TAB3 00006000 +# define CRDLY 00030000 +# define CR0 00000000 +# define CR1 00010000 +# define CR2 00020000 +# define CR3 00030000 +# define FFDLY 00040000 +# define FF0 00000000 +# define FF1 00040000 +# define BSDLY 00100000 +# define BS0 00000000 +# define BS1 00100000 +#endif +#define VTDLY 00200000 +#define VT0 00000000 +#define VT1 00200000 + +#ifdef __USE_MISC +# define XTABS 00006000 +#endif diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h index 4ccabd7095..4045274af9 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h @@ -26,50 +26,7 @@ typedef unsigned int tcflag_t; #include #include #include - -/* c_oflag bits */ -#define OPOST 0000001 -#define ONLCR 0000002 -#define OLCUC 0000004 - -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 - -#define OFILL 00000100 -#define OFDEL 00000200 -#if defined __USE_MISC || defined __USE_XOPEN -# define NLDLY 00001400 -# define NL0 00000000 -# define NL1 00000400 -# if defined __USE_MISC -# define NL2 00001000 -# define NL3 00001400 -# endif -# define TABDLY 00006000 -# define TAB0 00000000 -# define TAB1 00002000 -# define TAB2 00004000 -# define TAB3 00006000 -# define CRDLY 00030000 -# define CR0 00000000 -# define CR1 00010000 -# define CR2 00020000 -# define CR3 00030000 -# define FFDLY 00040000 -# define FF0 00000000 -# define FF1 00040000 -# define BSDLY 00100000 -# define BS0 00000000 -# define BS1 00100000 -#endif -#define VTDLY 00200000 -#define VT0 00000000 -#define VT1 00200000 - -#ifdef __USE_MISC -# define XTABS 00006000 -#endif +#include /* c_cflag bit meaning */ #ifdef __USE_MISC diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios-c_oflag.h b/sysdeps/unix/sysv/linux/sparc/bits/termios-c_oflag.h new file mode 100644 index 0000000000..fab3072782 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/bits/termios-c_oflag.h @@ -0,0 +1,64 @@ +/* termios output mode definitions. Linux/sparc version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_oflag bits */ +#define OPOST 0x00000001 +#define OLCUC 0x00000002 +#define ONLCR 0x00000004 +#define OCRNL 0x00000008 +#define ONOCR 0x00000010 +#define ONLRET 0x00000020 +#define OFILL 0x00000040 +#define OFDEL 0x00000080 +#if defined __USE_MISC || defined __USE_XOPEN +# define NLDLY 0x00000100 +# define NL0 0x00000000 +# define NL1 0x00000100 +# define CRDLY 0x00000600 +# define CR0 0x00000000 +# define CR1 0x00000200 +# define CR2 0x00000400 +# define CR3 0x00000600 +# define TABDLY 0x00001800 +# define TAB0 0x00000000 +# define TAB1 0x00000800 +# define TAB2 0x00001000 +# define TAB3 0x00001800 +# define BSDLY 0x00002000 +# define BS0 0x00000000 +# define BS1 0x00002000 +#define FFDLY 0x00008000 +#define FF0 0x00000000 +#define FF1 0x00008000 +#endif +#define VTDLY 0x00004000 +#define VT0 0x00000000 +#define VT1 0x00004000 + +# if defined __USE_GNU +#define PAGEOUT 0x00010000 /* SUNOS specific */ +#define WRAP 0x00020000 /* SUNOS specific */ +# endif + +#ifdef __USE_MISC +# define XTABS 0x00001800 +#endif diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h index 4123ed7aaa..9c884eb791 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/termios.h @@ -27,49 +27,7 @@ typedef unsigned int tcflag_t; #include #include #include - -/* c_oflag bits */ -#define OPOST 0x00000001 -#define OLCUC 0x00000002 -#define ONLCR 0x00000004 -#define OCRNL 0x00000008 -#define ONOCR 0x00000010 -#define ONLRET 0x00000020 -#define OFILL 0x00000040 -#define OFDEL 0x00000080 -#if defined __USE_MISC || defined __USE_XOPEN -# define NLDLY 0x00000100 -# define NL0 0x00000000 -# define NL1 0x00000100 -# define CRDLY 0x00000600 -# define CR0 0x00000000 -# define CR1 0x00000200 -# define CR2 0x00000400 -# define CR3 0x00000600 -# define TABDLY 0x00001800 -# define TAB0 0x00000000 -# define TAB1 0x00000800 -# define TAB2 0x00001000 -# define TAB3 0x00001800 -# define BSDLY 0x00002000 -# define BS0 0x00000000 -# define BS1 0x00002000 -#define FFDLY 0x00008000 -#define FF0 0x00000000 -#define FF1 0x00008000 -#endif -#define VTDLY 0x00004000 -#define VT0 0x00000000 -#define VT1 0x00004000 - -# if defined __USE_GNU -#define PAGEOUT 0x00010000 /* SUNOS specific */ -#define WRAP 0x00020000 /* SUNOS specific */ -# endif - -#ifdef __USE_MISC -# define XTABS 0x00001800 -#endif +#include /* c_cflag bit meaning */ #ifdef __USE_MISC From patchwork Mon Oct 15 20:49:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 148892 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4252085lji; Mon, 15 Oct 2018 13:51:18 -0700 (PDT) X-Google-Smtp-Source: ACcGV61PIXQuWkjewKBjlMEu98xH+/MhPY/6eFBnEoQGABdjg1mRFg2wdMwE7zWUBfZy1Vk+4RW7 X-Received: by 2002:a17:902:3041:: with SMTP id u59-v6mr5743405plb.279.1539636678445; Mon, 15 Oct 2018 13:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539636678; cv=none; d=google.com; s=arc-20160816; b=u6BSksTtyVvQGTNDS1uTMqFBrNQrtl4upUDTwrCntFJrjluTX7bv3Hu41Umu+jU3s2 cojOF8xL9vJJICG5KwZqQkoBL4ZKQUT1VH+a2v2H719PQSG/AKEbJHHA/BmnMWopEkXx n90eWhwho9NHRyvizM24BMuAVr3/5Yqn+m4QCRv+FbfvEMYmSVxU+dzbqbbYNCZx9jlK c+iKDJkjDUHZFvPZ4sN2FViEK/RK9g5AAaChQZZqueaLC7S+ZQysvc19p1k8RHaB/oAh Qen1pZqRwS0pNJNm+o3SUSlcE8Mr4lVyN5K6RBOQHfp3pOYzT/6UVpppWY4PN0J/PHh2 e1wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=QT5WjgRTwm0BxEhNdXZazYfoHGcDVOeYw1rcsetxBS8=; b=OO3TeIK89oXgQ4jLY5Sfjd8X27E2xwf8wUwHSiS6lcraHc9zSjkZ0DSrQVupQll7/q senMFeA+J8AGExGVUPHT7qYyQB0OusEj8f+/i2V1QBSvUX0VmO/B8mcYk3gVWxvnOpbo bGYrCr6uzmgm1UrnbkCxs6x8Of/Mdse2ShOVluJHwmGuyv21lgDGsODNTT+siBuTPLn5 0CO9Svu7bRVIDmuqHn2CMOUUri1Nw4h5UDqy2WpqRpAn6mbcHs0FB0De7rfONlLp5hAA L/LmuTqGYUHisGJmnPR9ATIsoyi04fteC0dGE3hNH2aA2u9T1PCFONVI5WvWiMeOIS4s 0mwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=KHB6YQe+; dkim=pass header.i=@linaro.org header.s=google header.b=ZRqArsng; spf=pass (google.com: domain of libc-alpha-return-96442-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96442-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id a3-v6si11187651pgv.158.2018.10.15.13.51.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 13:51:18 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-96442-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=KHB6YQe+; dkim=pass header.i=@linaro.org header.s=google header.b=ZRqArsng; spf=pass (google.com: domain of libc-alpha-return-96442-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96442-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=ujhMOSURrKeBsDvD+GVzS8oFnc0rLaM SIWTKpv3lwcx4w+d8SFUMQV7WFVfg1hutleyCuJBoJn6Ke/GDU/IoaEGpyp4XP/b 0Yz0XPu3Jd2KZ/Huez+cUXShEEAab/LTAv4l/akSdnLLm0XA/GVj8wPAIEEvwie/ putcENjB5a9k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=ExlCJUhzkzRfNMmaBWRxoxakufE=; b=KHB6Y Qe+GUUbsFhr2XHBjZH7aK4aAWIiYIX81cxyz09ByuZafUCWpPnVkaZk6En4lX+cX 46/tnJRUdufGcFM0rWegfRP2wwTfnIj5ghGIoSWUt8Fy0i/oEZOB78n3Vzm6+iH9 mQL/OfSQxc4QTJQNbYhzxz3XsDxPFRfVGfOeBU= Received: (qmail 15698 invoked by alias); 15 Oct 2018 20:50:19 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 15537 invoked by uid 89); 15 Oct 2018 20:50:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=stick, Selection X-HELO: mail-qt1-f194.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QT5WjgRTwm0BxEhNdXZazYfoHGcDVOeYw1rcsetxBS8=; b=ZRqArsngklwRniRNqkY9rh0X+Jh5DUUwZtxNZc+eXvmZOr7xYBr9YaseJuh/5Q/wj+ f0qVnncGkvMdT57I8tHycpuAGpiy6IbuFZH6av7yM6fH12oXZXGBB6Ows5z8mA0eOQkL lqvixXsmyfJBL4XB+av38uRVH5gBqtBXy5IWI= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: hpa@zytor.com Subject: [PATCH 06/12] termios: Consolidate Baud Rate Selection definitions Date: Mon, 15 Oct 2018 17:49:50 -0300 Message-Id: <20181015204956.25558-6-adhemerval.zanella@linaro.org> In-Reply-To: <20181015204956.25558-1-adhemerval.zanella@linaro.org> References: <20181015204956.25558-1-adhemerval.zanella@linaro.org> This patch consolidates the termios symbolic constants used for baud rates selection used along with speed_t on its own header. The Linux generic implementation values match the kernel UAPI and each architecture with deviate values have their own implementation (in this case alpha and powerpc). No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add termios-baud.h. * sysdeps/unix/sysv/linux/bits/termios-baud.h: New file. * sysdeps/unix/sysv/linux/alpha/bits/termios-baud.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios-baud.h: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/termios.h (B57600, B115200, B230400, B460800, B500000, B576000, B921600, B1000000, B1152000, B1500000, B2000000, B2500000, B3000000, B3500000, B4000000, __MAX_BAUD): Move to termios-baud.h. [__USE_MISC] (CBAUD, CBAUDEX): Likewise. * sysdeps/unix/sysv/linux/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise. --- sysdeps/unix/sysv/linux/Makefile | 3 +- .../unix/sysv/linux/alpha/bits/termios-baud.h | 46 ++++++++++++++++++ sysdeps/unix/sysv/linux/alpha/bits/termios.h | 26 +--------- sysdeps/unix/sysv/linux/bits/termios-baud.h | 48 +++++++++++++++++++ sysdeps/unix/sysv/linux/bits/termios.h | 29 +---------- sysdeps/unix/sysv/linux/mips/bits/termios.h | 28 +---------- .../sysv/linux/powerpc/bits/termios-baud.h | 45 +++++++++++++++++ .../unix/sysv/linux/powerpc/bits/termios.h | 25 +--------- sysdeps/unix/sysv/linux/sparc/bits/termios.h | 30 +----------- 9 files changed, 149 insertions(+), 131 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/termios-baud.h create mode 100644 sysdeps/unix/sysv/linux/bits/termios-baud.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/termios-baud.h -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 097107c82c..1af8145b13 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -44,7 +44,8 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ bits/procfs.h bits/procfs-id.h bits/procfs-extra.h \ bits/procfs-prregset.h bits/mman-map-flags-generic.h \ bits/msq-pad.h bits/termios-struct.h bits/termios-c_cc.h \ - bits/termios-c_iflag.h bits/termios-c_oflag.h + bits/termios-c_iflag.h bits/termios-c_oflag.h \ + bits/termios-baud.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios-baud.h b/sysdeps/unix/sysv/linux/alpha/bits/termios-baud.h new file mode 100644 index 0000000000..eba263a67d --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios-baud.h @@ -0,0 +1,46 @@ +/* termios baud rate selection definitions. Linux/alpha version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +#ifdef __USE_MISC +# define CBAUD 0000037 +# define CBAUDEX 0000000 +# define CMSPAR 010000000000 /* mark or space (stick) parity */ +# define CRTSCTS 020000000000 /* flow control */ +#endif + +#define B57600 00020 +#define B115200 00021 +#define B230400 00022 +#define B460800 00023 +#define B500000 00024 +#define B576000 00025 +#define B921600 00026 +#define B1000000 00027 +#define B1152000 00030 +#define B1500000 00031 +#define B2000000 00032 +#define B2500000 00033 +#define B3000000 00034 +#define B3500000 00035 +#define B4000000 00036 + +#define __MAX_BAUD B4000000 diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h index 7259c1dd30..530dd48410 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/termios.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios.h @@ -30,9 +30,6 @@ typedef unsigned int tcflag_t; #include /* c_cflag bit meaning */ -#ifdef __USE_MISC -# define CBAUD 0000037 -#endif #define B0 0000000 /* hang up */ #define B50 0000001 #define B75 0000002 @@ -52,25 +49,8 @@ typedef unsigned int tcflag_t; #ifdef __USE_MISC # define EXTA B19200 # define EXTB B38400 -# define CBAUDEX 0000000 #endif -#define B57600 00020 -#define B115200 00021 -#define B230400 00022 -#define B460800 00023 -#define B500000 00024 -#define B576000 00025 -#define B921600 00026 -#define B1000000 00027 -#define B1152000 00030 -#define B1500000 00031 -#define B2000000 00032 -#define B2500000 00033 -#define B3000000 00034 -#define B3500000 00035 -#define B4000000 00036 - -#define __MAX_BAUD B4000000 +#include #define CSIZE 00001400 #define CS5 00000000 @@ -85,10 +65,6 @@ typedef unsigned int tcflag_t; #define HUPCL 00040000 #define CLOCAL 00100000 -#ifdef __USE_MISC -# define CMSPAR 010000000000 /* mark or space (stick) parity */ -# define CRTSCTS 020000000000 /* flow control */ -#endif /* c_lflag bits */ #define ISIG 0x00000080 diff --git a/sysdeps/unix/sysv/linux/bits/termios-baud.h b/sysdeps/unix/sysv/linux/bits/termios-baud.h new file mode 100644 index 0000000000..7f7f9c511c --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/termios-baud.h @@ -0,0 +1,48 @@ +/* termios baud rate selection definitions. Linux/generic version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +#ifdef __USE_MISC +# define CBAUD 000000010017 /* Baud speed mask (not in POSIX). */ +# define CBAUDEX 000000010000 /* Extra baud speed mask, included in CBAUD. + (not in POSIX). */ +# define CIBAUD 002003600000 /* Input baud rate (not used). */ +# define CMSPAR 010000000000 /* Mark or space (stick) parity. */ +# define CRTSCTS 020000000000 /* Flow control. */ +#endif + +/* Extra output baud rates (not in POSIX). */ +#define B57600 0010001 +#define B115200 0010002 +#define B230400 0010003 +#define B460800 0010004 +#define B500000 0010005 +#define B576000 0010006 +#define B921600 0010007 +#define B1000000 0010010 +#define B1152000 0010011 +#define B1500000 0010012 +#define B2000000 0010013 +#define B2500000 0010014 +#define B3000000 0010015 +#define B3500000 0010016 +#define B4000000 0010017 +#define __MAX_BAUD B4000000 diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h index 15b279b01e..07ffdf9779 100644 --- a/sysdeps/unix/sysv/linux/bits/termios.h +++ b/sysdeps/unix/sysv/linux/bits/termios.h @@ -30,9 +30,6 @@ typedef unsigned int tcflag_t; #include /* c_cflag bit meaning */ -#ifdef __USE_MISC -# define CBAUD 0010017 -#endif #define B0 0000000 /* hang up */ #define B50 0000001 #define B75 0000002 @@ -53,6 +50,8 @@ typedef unsigned int tcflag_t; # define EXTA B19200 # define EXTB B38400 #endif +#include + #define CSIZE 0000060 #define CS5 0000000 #define CS6 0000020 @@ -64,30 +63,6 @@ typedef unsigned int tcflag_t; #define PARODD 0001000 #define HUPCL 0002000 #define CLOCAL 0004000 -#ifdef __USE_MISC -# define CBAUDEX 0010000 -#endif -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 -#define __MAX_BAUD B4000000 -#ifdef __USE_MISC -# define CIBAUD 002003600000 /* input baud rate (not used) */ -# define CMSPAR 010000000000 /* mark or space (stick) parity */ -# define CRTSCTS 020000000000 /* flow control */ -#endif /* c_lflag bits */ #define ISIG 0000001 diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h index f851adbfe1..008527577f 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/termios.h +++ b/sysdeps/unix/sysv/linux/mips/bits/termios.h @@ -30,9 +30,6 @@ typedef unsigned int tcflag_t; #include /* c_cflag bit meaning */ -#ifdef __USE_MISC -# define CBAUD 0010017 -#endif #define B0 0000000 /* hang up */ #define B50 0000001 #define B75 0000002 @@ -53,6 +50,8 @@ typedef unsigned int tcflag_t; # define EXTA B19200 # define EXTB B38400 #endif +#include + #define CSIZE 0000060 /* Number of bits per byte (mask). */ #define CS5 0000000 /* 5 bits per byte. */ #define CS6 0000020 /* 6 bits per byte. */ @@ -64,29 +63,6 @@ typedef unsigned int tcflag_t; #define PARODD 0001000 /* Odd parity instead of even. */ #define HUPCL 0002000 /* Hang up on last close. */ #define CLOCAL 0004000 /* Ignore modem status lines. */ -#ifdef __USE_MISC -# define CBAUDEX 0010000 -#endif -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 -#define __MAX_BAUD B4000000 -#ifdef __USE_MISC -# define CIBAUD 002003600000 /* input baud rate (not used) */ -# define CRTSCTS 020000000000 /* flow control */ -#endif /* c_lflag bits */ #define ISIG 0000001 /* Enable signals. */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios-baud.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios-baud.h new file mode 100644 index 0000000000..4f490a929f --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios-baud.h @@ -0,0 +1,45 @@ +/* termios baud rate selection definitions. Linux/powerpc version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +#ifdef __USE_MISC +# define CBAUD 0000377 +# define CBAUDEX 0000020 +# define CMSPAR 010000000000 /* mark or space (stick) parity */ +# define CRTSCTS 020000000000 /* flow control */ +#endif + +#define B57600 00020 +#define B115200 00021 +#define B230400 00022 +#define B460800 00023 +#define B500000 00024 +#define B576000 00025 +#define B921600 00026 +#define B1000000 00027 +#define B1152000 00030 +#define B1500000 00031 +#define B2000000 00032 +#define B2500000 00033 +#define B3000000 00034 +#define B3500000 00035 +#define B4000000 00036 +#define __MAX_BAUD B4000000 diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h index 4045274af9..2f928d5217 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h @@ -29,9 +29,6 @@ typedef unsigned int tcflag_t; #include /* c_cflag bit meaning */ -#ifdef __USE_MISC -# define CBAUD 0000377 -#endif #define B0 0000000 /* hang up */ #define B50 0000001 #define B75 0000002 @@ -51,24 +48,8 @@ typedef unsigned int tcflag_t; #ifdef __USE_MISC # define EXTA B19200 # define EXTB B38400 -# define CBAUDEX 0000020 #endif -#define B57600 00020 -#define B115200 00021 -#define B230400 00022 -#define B460800 00023 -#define B500000 00024 -#define B576000 00025 -#define B921600 00026 -#define B1000000 00027 -#define B1152000 00030 -#define B1500000 00031 -#define B2000000 00032 -#define B2500000 00033 -#define B3000000 00034 -#define B3500000 00035 -#define B4000000 00036 -#define __MAX_BAUD B4000000 +#include #define CSIZE 00001400 #define CS5 00000000 @@ -83,10 +64,6 @@ typedef unsigned int tcflag_t; #define HUPCL 00040000 #define CLOCAL 00100000 -#ifdef __USE_MISC -# define CMSPAR 010000000000 /* mark or space (stick) parity */ -# define CRTSCTS 020000000000 /* flow control */ -#endif /* c_lflag bits */ #define ISIG 0x00000080 diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h index 9c884eb791..d612080754 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/termios.h @@ -30,9 +30,6 @@ typedef unsigned int tcflag_t; #include /* c_cflag bit meaning */ -#ifdef __USE_MISC -# define CBAUD 0x0000100f -#endif #define B0 0x00000000 /* hang up */ #define B50 0x00000001 #define B75 0x00000002 @@ -53,6 +50,8 @@ typedef unsigned int tcflag_t; # define EXTA B19200 # define EXTB B38400 #endif +#include + #define CSIZE 0x00000030 #define CS5 0x00000000 #define CS6 0x00000010 @@ -64,31 +63,6 @@ typedef unsigned int tcflag_t; #define PARODD 0x00000200 #define HUPCL 0x00000400 #define CLOCAL 0x00000800 -#ifdef __USE_MISC -# define CBAUDEX 0x00001000 -#endif -#define B57600 0x00001001 -#define B115200 0x00001002 -#define B230400 0x00001003 -#define B460800 0x00001004 -#define B76800 0x00001005 -#define B153600 0x00001006 -#define B307200 0x00001007 -#define B614400 0x00001008 -#define B921600 0x00001009 -#define B500000 0x0000100a -#define B576000 0x0000100b -#define B1000000 0x0000100c -#define B1152000 0x0000100d -#define B1500000 0x0000100e -#define B2000000 0x0000100f -#define __MAX_BAUD B2000000 - -#ifdef __USE_MISC -# define CIBAUD 0x100f0000 /* input baud rate (not used) */ -# define CMSPAR 0x40000000 /* mark or space (stick) parity */ -# define CRTSCTS 0x80000000 /* flow control */ -#endif /* c_lflag bits */ #define ISIG 0x00000001 From patchwork Mon Oct 15 20:49:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 148891 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4251967lji; Mon, 15 Oct 2018 13:51:09 -0700 (PDT) X-Google-Smtp-Source: ACcGV60x1gs5iE7cselQc4zTVA4cvlLP/nk3/NyEA/Vj7T4NYboQ7G8zda6FKqdLQVmbwcQA5PIw X-Received: by 2002:a17:902:9696:: with SMTP id n22-v6mr9886580plp.282.1539636669049; Mon, 15 Oct 2018 13:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539636669; cv=none; d=google.com; s=arc-20160816; b=NcdvZIfvII7jQUyAdfAxWV7unwo+lGlUm7kwK43Db2eU/WCQ6MO/2E3tXO3YQnZTh/ McQxDwqYH2HxhNpwmVVrinMWalOyVc4CV3bNrgVCwI0loaHXV0+LaehTvGdUH6JMsyEI nIF8Cn4f3EON80b90PFgdh1yYsZ1V6RTHMKkkeXIBwIgDEkaeOe+Q2IRkFCLUh9Tm8Qe 9za4mHMgjEBd+5ETukg9XNPH111VppCcM96ifNDMh76y9u7E6cMXKSek7l7j9zbpQmoO usP1RyEn6NHKfKEDO/gYvRFVp91mfAzQFm9ZgD+rK2rrXA0i8eEVEKU1NlWTcUylEgn8 /swA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=bn5iydqR+XB1np1FqmZ07SNUw6D9S64W1mSnWG9iSXg=; b=zH9kNNvz19mVlNs8p2TiaAprVBToXyJSwu6vYHL9Z7xdf/GyuLAIfJzSoSwA2fwRju Q2FLLVNI4jRnYtwxxI437ZUVlwZhsgCkO3OceCsqJ1fWmaZil9zZ6vX/J3T5SE6gKSqY cU4JQN6/Qb5SKdol6Ikpo/HuTsGc6Vs5AE82o0mL3dB03rtkYRA6A0Rppv8iMRIX6zGS cijoUSy5QD+3A418WQ0/YU+nTY9i33Ymn8eJ7SyeSfV7i72fzFgJgI6kpEVCDD93esvw XMASmGnd4rQpbgBT/lKDwbAoou5rnikZJvkKNCqtsOEyrdjZwh2SLyIJ7pU9Senj3ec0 c5Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=hZT8LuUZ; dkim=pass header.i=@linaro.org header.s=google header.b=ZiNRTyJ+; spf=pass (google.com: domain of libc-alpha-return-96441-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96441-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id l15-v6si11943818pfg.176.2018.10.15.13.51.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 13:51:09 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-96441-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=hZT8LuUZ; dkim=pass header.i=@linaro.org header.s=google header.b=ZiNRTyJ+; spf=pass (google.com: domain of libc-alpha-return-96441-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96441-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=vgHxu/K5EN7zfdb/7WfZI+VGDLL03O6 gEGIAYfWimYozY6+tCrI//Hoi1eWU1z1sEF/pvK2aLYO8hjhyO8Q+w+9lB3BuKuC IQOgNDzYmx1AsO2yg8ZUEFyeUkbZss9ehEf6MDYgLHkSLZnBifXBGf9OJVPAeGeK zkuLcgqAaDfQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=ObjYlttaYnP7fX/UI4LdlSIDfxw=; b=hZT8L uUZGJsz9KKoccm2n1fN5QQe1EH13HLiOk9LWr04Zwer4+hFp0A7YwqT3o/NXe1Hw OY6XKswsND2T9tTiWaPoc1PHl+JApU4xNTzpcj2+cveCGExEE88F5tMFPJEv4/Sg XeQfXpH1Cyvm95fKO6r0e69SwC9vMOgWvxOZtE= Received: (qmail 15604 invoked by alias); 15 Oct 2018 20:50:19 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 15394 invoked by uid 89); 15 Oct 2018 20:50:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Two X-HELO: mail-qk1-f196.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bn5iydqR+XB1np1FqmZ07SNUw6D9S64W1mSnWG9iSXg=; b=ZiNRTyJ+rGNbMytZz82ZKL3MHJ0fMPuS/eLREI16g/9FbE/paRpjnoOWPbYs+iC5F6 MElQ+i1PI5+bJ8tqv5M5h+HB4uKKYwNfGusFH4Om4I6PHyEb2g7+YqklQwRsdMOjJx7/ soAO9/kGcswMLOkVuLz3UCL3PdskfMLOie3AY= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: hpa@zytor.com Subject: [PATCH 07/12] termios: Consolidate control mode definitions Date: Mon, 15 Oct 2018 17:49:51 -0300 Message-Id: <20181015204956.25558-7-adhemerval.zanella@linaro.org> In-Reply-To: <20181015204956.25558-1-adhemerval.zanella@linaro.org> References: <20181015204956.25558-1-adhemerval.zanella@linaro.org> This patch consolidates the termios symbolic constants used for output mode with c_oflag memver on its own header. The Linux generic implementation values match the kernel UAPI and each architecture with deviate values have their own implementation (in this case alpha and powerpc). No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add termios-c_cflag.h. * sysdeps/unix/sysv/linux/bits/termios-c_cflag.h: New file. * sysdeps/unix/sysv/linux/alpha/bits/termios-c_cflag.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cflag.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h (CSIZE, CS5, CS6, CS7, CS8, CSTOPB, CREAD, PARENB, PARODD, HUPCL, CLOCAL): Move to termios-c_cflag.h. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise. --- sysdeps/unix/sysv/linux/Makefile | 2 +- .../sysv/linux/alpha/bits/termios-c_cflag.h | 35 +++++++++++++++++++ sysdeps/unix/sysv/linux/alpha/bits/termios.h | 14 +------- .../unix/sysv/linux/bits/termios-c_cflag.h | 34 ++++++++++++++++++ sysdeps/unix/sysv/linux/bits/termios.h | 12 +------ sysdeps/unix/sysv/linux/mips/bits/termios.h | 12 +------ .../sysv/linux/powerpc/bits/termios-c_cflag.h | 35 +++++++++++++++++++ .../unix/sysv/linux/powerpc/bits/termios.h | 14 +------- sysdeps/unix/sysv/linux/sparc/bits/termios.h | 12 +------ 9 files changed, 110 insertions(+), 60 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/termios-c_cflag.h create mode 100644 sysdeps/unix/sysv/linux/bits/termios-c_cflag.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cflag.h -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 1af8145b13..11a497e8e9 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -45,7 +45,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ bits/procfs-prregset.h bits/mman-map-flags-generic.h \ bits/msq-pad.h bits/termios-struct.h bits/termios-c_cc.h \ bits/termios-c_iflag.h bits/termios-c_oflag.h \ - bits/termios-baud.h + bits/termios-baud.h bits/termios-c_cflag.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios-c_cflag.h b/sysdeps/unix/sysv/linux/alpha/bits/termios-c_cflag.h new file mode 100644 index 0000000000..f0948a9019 --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios-c_cflag.h @@ -0,0 +1,35 @@ +/* termios control mode definitions. Linux/alpha version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +#define CSIZE 00001400 +#define CS5 00000000 +#define CS6 00000400 +#define CS7 00001000 +#define CS8 00001400 + +#define CSTOPB 00002000 +#define CREAD 00004000 +#define PARENB 00010000 +#define PARODD 00020000 +#define HUPCL 00040000 + +#define CLOCAL 00100000 diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h index 530dd48410..e0963df7fa 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/termios.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios.h @@ -52,19 +52,7 @@ typedef unsigned int tcflag_t; #endif #include -#define CSIZE 00001400 -#define CS5 00000000 -#define CS6 00000400 -#define CS7 00001000 -#define CS8 00001400 - -#define CSTOPB 00002000 -#define CREAD 00004000 -#define PARENB 00010000 -#define PARODD 00020000 -#define HUPCL 00040000 - -#define CLOCAL 00100000 +#include /* c_lflag bits */ #define ISIG 0x00000080 diff --git a/sysdeps/unix/sysv/linux/bits/termios-c_cflag.h b/sysdeps/unix/sysv/linux/bits/termios-c_cflag.h new file mode 100644 index 0000000000..605a830498 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/termios-c_cflag.h @@ -0,0 +1,34 @@ +/* termios control mode definitions. Linux/generic version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_cflag bits. */ +#define CSIZE 0000060 +#define CS5 0000000 +#define CS6 0000020 +#define CS7 0000040 +#define CS8 0000060 +#define CSTOPB 0000100 +#define CREAD 0000200 +#define PARENB 0000400 +#define PARODD 0001000 +#define HUPCL 0002000 +#define CLOCAL 0004000 diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h index 07ffdf9779..8ead02e00a 100644 --- a/sysdeps/unix/sysv/linux/bits/termios.h +++ b/sysdeps/unix/sysv/linux/bits/termios.h @@ -52,17 +52,7 @@ typedef unsigned int tcflag_t; #endif #include -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define PARENB 0000400 -#define PARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 +#include /* c_lflag bits */ #define ISIG 0000001 diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h index 008527577f..b846099b09 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/termios.h +++ b/sysdeps/unix/sysv/linux/mips/bits/termios.h @@ -52,17 +52,7 @@ typedef unsigned int tcflag_t; #endif #include -#define CSIZE 0000060 /* Number of bits per byte (mask). */ -#define CS5 0000000 /* 5 bits per byte. */ -#define CS6 0000020 /* 6 bits per byte. */ -#define CS7 0000040 /* 7 bits per byte. */ -#define CS8 0000060 /* 8 bits per byte. */ -#define CSTOPB 0000100 /* Two stop bits instead of one. */ -#define CREAD 0000200 /* Enable receiver. */ -#define PARENB 0000400 /* Parity enable. */ -#define PARODD 0001000 /* Odd parity instead of even. */ -#define HUPCL 0002000 /* Hang up on last close. */ -#define CLOCAL 0004000 /* Ignore modem status lines. */ +#include /* c_lflag bits */ #define ISIG 0000001 /* Enable signals. */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cflag.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cflag.h new file mode 100644 index 0000000000..0f33de096e --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_cflag.h @@ -0,0 +1,35 @@ +/* termios control mode definitions. Linux/powerpc version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +#define CSIZE 00001400 +#define CS5 00000000 +#define CS6 00000400 +#define CS7 00001000 +#define CS8 00001400 + +#define CSTOPB 00002000 +#define CREAD 00004000 +#define PARENB 00010000 +#define PARODD 00020000 +#define HUPCL 00040000 + +#define CLOCAL 00100000 diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h index 2f928d5217..d49a882ed9 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h @@ -51,19 +51,7 @@ typedef unsigned int tcflag_t; #endif #include -#define CSIZE 00001400 -#define CS5 00000000 -#define CS6 00000400 -#define CS7 00001000 -#define CS8 00001400 - -#define CSTOPB 00002000 -#define CREAD 00004000 -#define PARENB 00010000 -#define PARODD 00020000 -#define HUPCL 00040000 - -#define CLOCAL 00100000 +#include /* c_lflag bits */ #define ISIG 0x00000080 diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h index d612080754..31d588caeb 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/termios.h @@ -52,17 +52,7 @@ typedef unsigned int tcflag_t; #endif #include -#define CSIZE 0x00000030 -#define CS5 0x00000000 -#define CS6 0x00000010 -#define CS7 0x00000020 -#define CS8 0x00000030 -#define CSTOPB 0x00000040 -#define CREAD 0x00000080 -#define PARENB 0x00000100 -#define PARODD 0x00000200 -#define HUPCL 0x00000400 -#define CLOCAL 0x00000800 +#include /* c_lflag bits */ #define ISIG 0x00000001 From patchwork Mon Oct 15 20:49:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 148894 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4252363lji; Mon, 15 Oct 2018 13:51:39 -0700 (PDT) X-Google-Smtp-Source: ACcGV62YYwtrixqrR8bYJZXRfAJGr+cU1MZ3jSWP+hd1QiVaTZWRc7HMkvs8p+qiOozkYfEYrFbQ X-Received: by 2002:a17:902:4d45:: with SMTP id o5-v6mr18116857plh.42.1539636699401; Mon, 15 Oct 2018 13:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539636699; cv=none; d=google.com; s=arc-20160816; b=j0QU4LY41KSGEBIH3rz2df4FnhLt3Usl2aP/0VII4PmlDqov5K68cjYAjEZXBN+u8d CnKTgk07ZB4rARXpOgn4Jhsl4n6I7crdoMPjKNPYyaT3nZK04/pAEtiQpOlQpDORsibw 03dEjzpUYN49xqP0laUx+BgHqONNilAlsoR0W+omywX4VKIWBabnV0XRThV/k+lBW78A kUsFtAnLczMZwGaJaD8fdiBnSGYEOFbjG4+jztzndL1FsqFhN5c0LJNmm85cHkR2spEg UEv2+CW+bLfMYW21ifDSrXCMExzmVAz3nxLYe7Szbl2llDdvqKh9hZvU34lSqiNIUIoI 77Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=hy+92jYqzmYNusKp+qrhFoODkQ7y+n2MgY2piaJwdaU=; b=IO4R/RkvCvY0vVpFwoTAhUcdoLpi1UCy6Fp8BmDkqAZ5YqziNSufWTgWrTacwfZjN4 580Ygm3gJ/C2RbX3jNeFQA4FqYTBuiy84JOo069YlceVJQCfZEbtOmR0ra61319nXm7G 1Fg15QhrEdSulHEB7ITrQfyr2YwYVt/1wB5Ep0U7AVDq8KThdhGhXkdxd9VFb9ZdXc64 YNLOnabbVYpVvJ8Vgmq6AJk0PbX2gxHY6vD69rqTCajZsynoF2nqEc9TlxQDhVaYvBMG peJvVZyTEa6MsBEO871aQJxuKR2P31CMs7udFkI62cQgG/No+6vYCxLUXhldjbv0BZ48 UeUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=yZlZHIPe; dkim=pass header.i=@linaro.org header.s=google header.b=XDA9DiVP; spf=pass (google.com: domain of libc-alpha-return-96444-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96444-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id e1-v6si11621009ple.195.2018.10.15.13.51.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 13:51:39 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-96444-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=yZlZHIPe; dkim=pass header.i=@linaro.org header.s=google header.b=XDA9DiVP; spf=pass (google.com: domain of libc-alpha-return-96444-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96444-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=Ms5xVhuGnERunsHy8KuQKEHSoULt4hY M/L5PG7e0ytofxlZfk6UJOQND9pYJLEQW7PjIRpc1uQLAqrzG2E7FKuhTR4hpBMN MvshKH8fJVaA+iDWshNvV3sgD3QDPdQn9v6cCJiVp96ACTZaNYo6oqwJLIQaIWmY rDirxGO0rfoY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=CVujXogplJa6/H87Uh3Lrf8B6Gg=; b=yZlZH IPe2VMqM0Yq5kh4lE9WDc7MCUM+bo32o9wUfH/vVTCCyXA6daL/6mU1ZaKHqrqF+ 2xNmtm7WEezla4gmhP76BaCLBjpREP8iF2GVvX8RXtfmYTZ6+QZZJXSGv7xSx7ow 8ac02Zf2HkJOwEmWsEc+GFYtHm30HkRZ9zCppI= Received: (qmail 16031 invoked by alias); 15 Oct 2018 20:50:22 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 15874 invoked by uid 89); 15 Oct 2018 20:50:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=pending, 0x10000000 X-HELO: mail-qk1-f195.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hy+92jYqzmYNusKp+qrhFoODkQ7y+n2MgY2piaJwdaU=; b=XDA9DiVPFzELoOUjThHqrpn0hESjJWTloZAoEeaqTsOrtaQqKcE0tXsA5Zso78qrZj MswQgt99+v0mYLvZxmDvDFGFGu1ILbCR2ih35nh0ouQ2dgMm61J5+S5qhZaHQiAEg3Hq UpbzZi/5PWnLn8kizkQaTDpOuL+JJ2268SWH4= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: hpa@zytor.com Subject: [PATCH 08/12] termios: Consolidate local mode definitions Date: Mon, 15 Oct 2018 17:49:52 -0300 Message-Id: <20181015204956.25558-8-adhemerval.zanella@linaro.org> In-Reply-To: <20181015204956.25558-1-adhemerval.zanella@linaro.org> References: <20181015204956.25558-1-adhemerval.zanella@linaro.org> This patch consolidates the termios symbolic constants used for local mode with c_lflag member on its own header. The Linux generic implementation values match the kernel UAPI and each architecture with deviate values have their own implementation (in this case alpha, mips, and powerpc). No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add termios-c_lflag.h. * sysdeps/unix/sysv/linux/bits/termios-c_lflag.h: New file. * sysdeps/unix/sysv/linux/alpha/bits/termios-c_lflag.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios-c_lflag.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios-c_lflag.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h (ISIG, ISCANON, ECHO, ECHOE, ECHOK, ECHONL, NOFLSH, TOSTOP, IEXTEN): Move to termios-c_lflag.h. [__USE_MISC || (__USE_XOPEN && !__USE_XOPEN2K)] (XCASE): Likewise. [__USE_MISC] (ECHOCTL, ECHOPRT, ECHOKE, FLUSHO, PENDIN, EXTPROC): Likewise. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise. --- sysdeps/unix/sysv/linux/Makefile | 3 +- .../sysv/linux/alpha/bits/termios-c_lflag.h | 42 ++++++++++++++ sysdeps/unix/sysv/linux/alpha/bits/termios.h | 22 +------ .../unix/sysv/linux/bits/termios-c_lflag.h | 58 +++++++++++++++++++ sysdeps/unix/sysv/linux/bits/termios.h | 25 +------- .../sysv/linux/mips/bits/termios-c_lflag.h | 46 +++++++++++++++ sysdeps/unix/sysv/linux/mips/bits/termios.h | 26 +-------- .../sysv/linux/powerpc/bits/termios-c_lflag.h | 45 ++++++++++++++ .../unix/sysv/linux/powerpc/bits/termios.h | 25 +------- sysdeps/unix/sysv/linux/sparc/bits/termios.h | 26 +-------- 10 files changed, 198 insertions(+), 120 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/alpha/bits/termios-c_lflag.h create mode 100644 sysdeps/unix/sysv/linux/bits/termios-c_lflag.h create mode 100644 sysdeps/unix/sysv/linux/mips/bits/termios-c_lflag.h create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/termios-c_lflag.h -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 11a497e8e9..52a2e1aaf8 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -45,7 +45,8 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ bits/procfs-prregset.h bits/mman-map-flags-generic.h \ bits/msq-pad.h bits/termios-struct.h bits/termios-c_cc.h \ bits/termios-c_iflag.h bits/termios-c_oflag.h \ - bits/termios-baud.h bits/termios-c_cflag.h + bits/termios-baud.h bits/termios-c_cflag.h \ + bits/termios-c_lflag.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios-c_lflag.h b/sysdeps/unix/sysv/linux/alpha/bits/termios-c_lflag.h new file mode 100644 index 0000000000..c1424bb317 --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios-c_lflag.h @@ -0,0 +1,42 @@ +/* termios local mode definitions. Linux/alpha version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_lflag bits */ +#define ISIG 0x00000080 +#define ICANON 0x00000100 +#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) +# define XCASE 0x00004000 +#endif +#define ECHO 0x00000008 +#define ECHOE 0x00000002 +#define ECHOK 0x00000004 +#define ECHONL 0x00000010 +#define NOFLSH 0x80000000 +#define TOSTOP 0x00400000 +#ifdef __USE_MISC +# define ECHOCTL 0x00000040 +# define ECHOPRT 0x00000020 +# define ECHOKE 0x00000001 +# define FLUSHO 0x00800000 +# define PENDIN 0x20000000 +#endif +#define IEXTEN 0x00000400 diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h index e0963df7fa..0d92853b9a 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/termios.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios.h @@ -53,27 +53,7 @@ typedef unsigned int tcflag_t; #include #include - -/* c_lflag bits */ -#define ISIG 0x00000080 -#define ICANON 0x00000100 -#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) -# define XCASE 0x00004000 -#endif -#define ECHO 0x00000008 -#define ECHOE 0x00000002 -#define ECHOK 0x00000004 -#define ECHONL 0x00000010 -#define NOFLSH 0x80000000 -#define TOSTOP 0x00400000 -#ifdef __USE_MISC -# define ECHOCTL 0x00000040 -# define ECHOPRT 0x00000020 -# define ECHOKE 0x00000001 -# define FLUSHO 0x00800000 -# define PENDIN 0x20000000 -#endif -#define IEXTEN 0x00000400 +#include /* Values for the ACTION argument to `tcflow'. */ #define TCOOFF 0 diff --git a/sysdeps/unix/sysv/linux/bits/termios-c_lflag.h b/sysdeps/unix/sysv/linux/bits/termios-c_lflag.h new file mode 100644 index 0000000000..64f9272893 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/termios-c_lflag.h @@ -0,0 +1,58 @@ +/* termios local mode definitions. Linux/generic version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_lflag bits */ +#define ISIG 0000001 /* Enable signals. */ +#define ICANON 0000002 /* Canonical input (erase and kill processing). */ +#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) +# define XCASE 0000004 +#endif +#define ECHO 0000010 /* Enable echo. */ +#define ECHOE 0000020 /* Echo erase character as error-correcting + backspace. */ +#define ECHOK 0000040 /* Echo KILL. */ +#define ECHONL 0000100 /* Echo NL. */ +#define NOFLSH 0000200 /* Disable flush after interrupt or quit. */ +#define TOSTOP 0000400 /* Send SIGTTOU for background output. */ +#ifdef __USE_MISC +# define ECHOCTL 0001000 /* If ECHO is also set, terminal special characters + other than TAB, NL, START, and STOP are echoed as + ^X, where X is the character with ASCII code 0x40 + greater than the special character + (not in POSIX). */ +# define ECHOPRT 0002000 /* If ICANON and ECHO are also set, characters are + printed as they are being erased + (not in POSIX). */ +# define ECHOKE 0004000 /* If ICANON is also set, KILL is echoed by erasing + each character on the line, as specified by ECHOE + and ECHOPRT (not in POSIX). */ +# define FLUSHO 0010000 /* Output is being flushed. This flag is toggled by + typing the DISCARD character (not in POSIX). */ +# define PENDIN 0040000 /* All characters in the input queue are reprinted + when the next character is read + (not in POSIX). */ +#endif +#define IEXTEN 0100000 /* Enable implementation-defined input + processing. */ +#ifdef __USE_MISC +# define EXTPROC 0200000 +#endif diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h index 8ead02e00a..5664069de9 100644 --- a/sysdeps/unix/sysv/linux/bits/termios.h +++ b/sysdeps/unix/sysv/linux/bits/termios.h @@ -53,30 +53,7 @@ typedef unsigned int tcflag_t; #include #include - -/* c_lflag bits */ -#define ISIG 0000001 -#define ICANON 0000002 -#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) -# define XCASE 0000004 -#endif -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 -#ifdef __USE_MISC -# define ECHOCTL 0001000 -# define ECHOPRT 0002000 -# define ECHOKE 0004000 -# define FLUSHO 0010000 -# define PENDIN 0040000 -#endif -#define IEXTEN 0100000 -#ifdef __USE_MISC -# define EXTPROC 0200000 -#endif +#include #ifdef __USE_MISC /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios-c_lflag.h b/sysdeps/unix/sysv/linux/mips/bits/termios-c_lflag.h new file mode 100644 index 0000000000..5a3b3db410 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/bits/termios-c_lflag.h @@ -0,0 +1,46 @@ +/* termios local mode definitions. Linux/mips version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_lflag bits */ +#define ISIG 0000001 /* Enable signals. */ +#define ICANON 0000002 /* Do erase and kill processing. */ +#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) +# define XCASE 0000004 +#endif +#define ECHO 0000010 /* Enable echo. */ +#define ECHOE 0000020 /* Visual erase for ERASE. */ +#define ECHOK 0000040 /* Echo NL after KILL. */ +#define ECHONL 0000100 /* Echo NL even if ECHO is off. */ +#define NOFLSH 0000200 /* Disable flush after interrupt. */ +#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */ +#ifdef __USE_MISC +# define ECHOCTL 0001000 /* Echo control characters as ^X. */ +# define ECHOPRT 0002000 /* Hardcopy visual erase. */ +# define ECHOKE 0004000 /* Visual erase for KILL. */ +# define FLUSHO 0020000 +# define PENDIN 0040000 /* Retype pending input (state). */ +#endif +#define TOSTOP 0100000 /* Send SIGTTOU for background output. */ +#define ITOSTOP TOSTOP +#ifdef __USE_MISC +# define EXTPROC 0200000 +#endif diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h index b846099b09..26535090b3 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/termios.h +++ b/sysdeps/unix/sysv/linux/mips/bits/termios.h @@ -53,31 +53,7 @@ typedef unsigned int tcflag_t; #include #include - -/* c_lflag bits */ -#define ISIG 0000001 /* Enable signals. */ -#define ICANON 0000002 /* Do erase and kill processing. */ -#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) -# define XCASE 0000004 -#endif -#define ECHO 0000010 /* Enable echo. */ -#define ECHOE 0000020 /* Visual erase for ERASE. */ -#define ECHOK 0000040 /* Echo NL after KILL. */ -#define ECHONL 0000100 /* Echo NL even if ECHO is off. */ -#define NOFLSH 0000200 /* Disable flush after interrupt. */ -#define IEXTEN 0000400 /* Enable DISCARD and LNEXT. */ -#ifdef __USE_MISC -# define ECHOCTL 0001000 /* Echo control characters as ^X. */ -# define ECHOPRT 0002000 /* Hardcopy visual erase. */ -# define ECHOKE 0004000 /* Visual erase for KILL. */ -# define FLUSHO 0020000 -# define PENDIN 0040000 /* Retype pending input (state). */ -#endif -#define TOSTOP 0100000 /* Send SIGTTOU for background output. */ -#define ITOSTOP TOSTOP -#ifdef __USE_MISC -# define EXTPROC 0200000 -#endif +#include #ifdef __USE_MISC /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_lflag.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_lflag.h new file mode 100644 index 0000000000..a0ceae04f0 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios-c_lflag.h @@ -0,0 +1,45 @@ +/* termios local mode definitions. Linux/powerpc version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* c_lflag bits */ +#define ISIG 0x00000080 +#define ICANON 0x00000100 +#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) +# define XCASE 0x00004000 +#endif +#define ECHO 0x00000008 +#define ECHOE 0x00000002 +#define ECHOK 0x00000004 +#define ECHONL 0x00000010 +#define NOFLSH 0x80000000 +#define TOSTOP 0x00400000 +#ifdef __USE_MISC +# define ECHOCTL 0x00000040 +# define ECHOPRT 0x00000020 +# define ECHOKE 0x00000001 +# define FLUSHO 0x00800000 +# define PENDIN 0x20000000 +#endif +#define IEXTEN 0x00000400 +#ifdef __USE_MISC +# define EXTPROC 0x10000000 +#endif diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h index d49a882ed9..74c6bf8352 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h @@ -52,30 +52,7 @@ typedef unsigned int tcflag_t; #include #include - -/* c_lflag bits */ -#define ISIG 0x00000080 -#define ICANON 0x00000100 -#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) -# define XCASE 0x00004000 -#endif -#define ECHO 0x00000008 -#define ECHOE 0x00000002 -#define ECHOK 0x00000004 -#define ECHONL 0x00000010 -#define NOFLSH 0x80000000 -#define TOSTOP 0x00400000 -#ifdef __USE_MISC -# define ECHOCTL 0x00000040 -# define ECHOPRT 0x00000020 -# define ECHOKE 0x00000001 -# define FLUSHO 0x00800000 -# define PENDIN 0x20000000 -#endif -#define IEXTEN 0x00000400 -#ifdef __USE_MISC -# define EXTPROC 0x10000000 -#endif +#include /* Values for the ACTION argument to `tcflow'. */ #define TCOOFF 0 diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h index 31d588caeb..04408ae60c 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/termios.h @@ -53,31 +53,7 @@ typedef unsigned int tcflag_t; #include #include - -/* c_lflag bits */ -#define ISIG 0x00000001 -#define ICANON 0x00000002 -#if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) -# define XCASE 0x00000004 -#endif -#define ECHO 0x00000008 -#define ECHOE 0x00000010 -#define ECHOK 0x00000020 -#define ECHONL 0x00000040 -#define NOFLSH 0x00000080 -#define TOSTOP 0x00000100 -#ifdef __USE_MISC -# define ECHOCTL 0x00000200 -# define ECHOPRT 0x00000400 -# define ECHOKE 0x00000800 -# define DEFECHO 0x00001000 /* SUNOS thing, what is it? */ -# define FLUSHO 0x00002000 -# define PENDIN 0x00004000 -#endif -#define IEXTEN 0x00008000 -#ifdef __USE_MISC -# define EXTPROC 0x00010000 -#endif +#include #ifdef __USE_MISC /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ From patchwork Mon Oct 15 20:49:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 148895 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4252457lji; Mon, 15 Oct 2018 13:51:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV60rPYY6V4Ti+2add8Kf3acuGPwRbneGGjBihDLUgglGtuHhJHl+gecu9oQFHW0dwi8+d70D X-Received: by 2002:a17:902:a9:: with SMTP id a38-v6mr13252329pla.273.1539636708957; Mon, 15 Oct 2018 13:51:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539636708; cv=none; d=google.com; s=arc-20160816; b=n1oftYYejqWCZ9GXEV7YHBv09ZwaXoFqOO/Ml9hT4VGqrJiLnswJSDADpxiycrkJz7 rLNZ6ESXLcEot2bvuNfaIe02Z1+fTnmvXlrLoUcNqcP3KOmWWeuAetynSjxf8vCkrbzz bldc9qcPqNnEysjydegvH/RpTIivtSsRSfILxWn1oeWHUYCjBEeriXLpmmemoHbDJww5 GoJ8m/Jb2RgtBpATL2AlhTxcJUgLZ04YZOggEp2Y8qbPy71yj9gK77nmQOBshO5qPE2K jspC+NRyuQDTumMse2PpHNwxkSf3coxVlmnp0EVV3OQirS0D3quwP3I4Ows1lTifPet5 HTSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=630NDPOJZRnG5Izk/M2/Q3rabPFqOEVyXCf77TIQ2V8=; b=p13DcOsGkrs04OiN/ooU+15sxvpMDzgNOAXKYOgOKhnbJyVVbCQIyRSLYZntFywO2Y Q5WWvFUqciI5p7jhkwLVOMlBiWhV22JP2ty4kTNp88rgW0cRvPn78U9Fb9yrJwFwT5m+ 5C+5VAy1eOWZGorT+eCL9aXiLdew/aEk23ZFrLp6PpD3r1I+64p+5cNSa5LzM+Y3uoZy d+QA1WldixSUj1wNRzvn2/S0kFUdY6RhbhUJmRjabfNB6z+ChbVcnvMmhr5BDPxPPCns pD8CRFITu+pqzZuPyHWrJm6KNNSr8ZATKx/+pTxsyX4pBzCGK4CZuBQ9fwDeJoz3Fkru nXXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="Mf/4XZfZ"; dkim=pass header.i=@linaro.org header.s=google header.b=VKD1bUqr; spf=pass (google.com: domain of libc-alpha-return-96445-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96445-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id k192-v6si11362615pgc.415.2018.10.15.13.51.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 13:51:48 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-96445-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="Mf/4XZfZ"; dkim=pass header.i=@linaro.org header.s=google header.b=VKD1bUqr; spf=pass (google.com: domain of libc-alpha-return-96445-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96445-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=n6mIREEFXtsA3b+LMoX0WnpJvz5OJY4 wyOC4w7MCGcVZKN6oOaOnj/qSZl9kTpzB8XboGfb91aoqAE1/mcZXZ7oPxU2o+bQ 9oUlflknBn21vWDjP0APtOuODYv5TWLAVDuQX0NkDQa6vthBoLcuO8oK2h46U5/T W/h5JgnfjQ9s= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=0bIKPQhkZsDN1t1DeFjZTFpN0zs=; b=Mf/4X ZfZDukR5VPrT5CxXN++iqFwXyBZ3KAkuQPuKIFKl1Y4yL4rJ5R4gPo6JPNYH1DxT uZCB3ydxGwbVTOWIF/0h7eDV1SdWSi8C+wYHLk+jZaAxYMnrbQTBxoFgK+pqfkpq Bg4Zc/UHo7sjMAZiU1yI4nY8yErNjjUEzFlBOw= Received: (qmail 16133 invoked by alias); 15 Oct 2018 20:50:22 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 15902 invoked by uid 89); 15 Oct 2018 20:50:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=pending X-HELO: mail-qt1-f193.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=630NDPOJZRnG5Izk/M2/Q3rabPFqOEVyXCf77TIQ2V8=; b=VKD1bUqrQu0SDZW27/eN23KZBKPknZBRAyYVFxIkRPw1bPozr+7ivSKwKTkc/2lyaS E7sBybQ6p9QlFc8mrqUW9rtVkYDDwIbf2zXTeLOFxUwmdswAHjoBT/9uUTLuf60aU+kC uyrXmOpuFaU0HU7UMa/EjBpXQwgkMjGCGotsI= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: hpa@zytor.com Subject: [PATCH 09/12] termios: Consolidate tcflow symbolic constants Date: Mon, 15 Oct 2018 17:49:53 -0300 Message-Id: <20181015204956.25558-9-adhemerval.zanella@linaro.org> In-Reply-To: <20181015204956.25558-1-adhemerval.zanella@linaro.org> References: <20181015204956.25558-1-adhemerval.zanella@linaro.org> This patch consolidates the termios symbolic constants for use with tcflow on a its own header. The Linux generic implementation values match the kernel UAPI and each architecture with deviate values have their own implementation (currently only mips). No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add termios-tcflow.h. * sysdeps/unix/sysv/linux/bits/termios-tcflow.h: New file. * sysdeps/unix/sysv/linux/mips/bits/termios-tcflow.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios.h (TCSANOW, TCSADRAIN, TCSAFLUSH): Move to termios-tcflow.h. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise. --- sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/alpha/bits/termios.h | 6 +---- sysdeps/unix/sysv/linux/bits/termios-tcflow.h | 26 +++++++++++++++++++ sysdeps/unix/sysv/linux/bits/termios.h | 6 +---- .../sysv/linux/mips/bits/termios-tcflow.h | 26 +++++++++++++++++++ sysdeps/unix/sysv/linux/mips/bits/termios.h | 5 +--- .../unix/sysv/linux/powerpc/bits/termios.h | 5 +--- sysdeps/unix/sysv/linux/sparc/bits/termios.h | 5 +--- 8 files changed, 58 insertions(+), 23 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/bits/termios-tcflow.h create mode 100644 sysdeps/unix/sysv/linux/mips/bits/termios-tcflow.h -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 52a2e1aaf8..e3035250c9 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -46,7 +46,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ bits/msq-pad.h bits/termios-struct.h bits/termios-c_cc.h \ bits/termios-c_iflag.h bits/termios-c_oflag.h \ bits/termios-baud.h bits/termios-c_cflag.h \ - bits/termios-c_lflag.h + bits/termios-c_lflag.h bits/termios-tcflow.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h index 0d92853b9a..66b84f26c7 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/termios.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios.h @@ -66,11 +66,7 @@ typedef unsigned int tcflag_t; #define TCOFLUSH 1 #define TCIOFLUSH 2 -/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - +#include #define _IOT_termios /* Hurd ioctl type field. */ \ _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) diff --git a/sysdeps/unix/sysv/linux/bits/termios-tcflow.h b/sysdeps/unix/sysv/linux/bits/termios-tcflow.h new file mode 100644 index 0000000000..8b7489b79b --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/termios-tcflow.h @@ -0,0 +1,26 @@ +/* termios tcflag symbolic contants definitions. Linux/generic version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* tcsetattr uses these. */ +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h index 5664069de9..b0263dfa71 100644 --- a/sysdeps/unix/sysv/linux/bits/termios.h +++ b/sysdeps/unix/sysv/linux/bits/termios.h @@ -71,11 +71,7 @@ typedef unsigned int tcflag_t; #define TCOFLUSH 1 #define TCIOFLUSH 2 -/* tcsetattr uses these */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - +#include #define _IOT_termios /* Hurd ioctl type field. */ \ _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios-tcflow.h b/sysdeps/unix/sysv/linux/mips/bits/termios-tcflow.h new file mode 100644 index 0000000000..c0a69b4ef7 --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/bits/termios-tcflow.h @@ -0,0 +1,26 @@ +/* termios local mode definitions. Linux/mips version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +/* tcsetattr uses these */ +#define TCSANOW 0x540e /* Same as TCSETS; change immediately. */ +#define TCSADRAIN 0x540f /* Same as TCSETSW; change when pending output is written. */ +#define TCSAFLUSH 0x5410 /* Same as TCSETSF; flush pending input before changing. */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h index 26535090b3..ca4f106855 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/termios.h +++ b/sysdeps/unix/sysv/linux/mips/bits/termios.h @@ -71,10 +71,7 @@ typedef unsigned int tcflag_t; #define TCOFLUSH 1 /* Discard data written but not yet sent. */ #define TCIOFLUSH 2 /* Discard all pending data. */ -/* tcsetattr uses these */ -#define TCSANOW 0x540e /* Same as TCSETS; change immediately. */ -#define TCSADRAIN 0x540f /* Same as TCSETSW; change when pending output is written. */ -#define TCSAFLUSH 0x5410 /* Same as TCSETSF; flush pending input before changing. */ +#include #define _IOT_termios /* Hurd ioctl type field. */ \ _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h index 74c6bf8352..885bf952bd 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h @@ -65,10 +65,7 @@ typedef unsigned int tcflag_t; #define TCOFLUSH 1 #define TCIOFLUSH 2 -/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 +#include #ifdef __USE_MISC diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h index 04408ae60c..fbf4df4335 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/termios.h @@ -71,7 +71,4 @@ typedef unsigned int tcflag_t; #define TCOFLUSH 1 #define TCIOFLUSH 2 -/* tcsetattr uses these */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 +#include From patchwork Mon Oct 15 20:49:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 148893 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4252217lji; Mon, 15 Oct 2018 13:51:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV604qlamnTgmtiz1/DO4nN5Z/QL85EcCsuXSmVz1G81huYFQ7+4UnX+/+io1ABtAurBYgG8b X-Received: by 2002:a17:902:7045:: with SMTP id h5-v6mr7369896plt.211.1539636689303; Mon, 15 Oct 2018 13:51:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539636689; cv=none; d=google.com; s=arc-20160816; b=zqu3VV3hvQxAt+4nAePKxEKPj/vochiEXsUUpRA13zimYmyABm+jxNYC9colkx9yRm cxg3lNSDncfoHPHzxLSMngqu6K9O8IPANwAQ3FvDiCE2KMsYjmIK4WaUXSc082VMJm7T CEUGARW8PXXSUKfgJQ0xqlg9EsM/U+VCaCmmrJz3iZOVucX6gk8ybED/4une6O9C2ooD WmPyPaAsqntVsU24PILCaSN1TbhZrTu883uNRW60QEYHWA3B7XKZ7Qm9VZTa94HwiqPe Aw0+OUNfxVqvMYiTJXaSJ3fMJymn0zwAJ9prjQHw48EI+lCqJrnAeHd9rbSNR4zcXgcc BUhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=474zF06ub3bDdUWJbtQ0L/+1Ke+/RGGt4QxsI2Fy7AY=; b=ILOJs888IqskSBRozdTX0RJSqd4YA7C0ptssA0ITY1YZ1Nrf8M/GM2lrncrXwLJs51 h995CTqDJP409VvAa15bYaplP6CtO0DIQaYLYdlOGTox13DTvlo2CyXGhZUCme7Y2cT1 RgG3gsKnryGIpitMDscDP/lF1cECIbeFsx56LMLAa/xfapvvHEZ8b4RPiFQb5PvdRGbI JfsjnrHYiDPO2HaE3uxxwgpfrVJEa18pILFjQWnG2R0OO1dZF6B26/GWFXGvLevpR5nL AEgLwM8v6f9x8AMeLUXPe4gESMH5jNhf+WBTYTAQld2YG9FxOImMH6tAEbaxKsI4/CFz mGKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=q4cIQbR9; dkim=pass header.i=@linaro.org header.s=google header.b=AfxfeBVE; spf=pass (google.com: domain of libc-alpha-return-96443-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96443-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id g10-v6si11239465pll.337.2018.10.15.13.51.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 13:51:29 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-96443-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=q4cIQbR9; dkim=pass header.i=@linaro.org header.s=google header.b=AfxfeBVE; spf=pass (google.com: domain of libc-alpha-return-96443-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96443-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=O8npWorxC9tElMrYrzMNyTalbIxWthw M7kS7Jx1CByE7riGAlLvMKi8w/58X5Mho2QPuJexBHoREieCoD3rDzBWcdyoPBH4 LAOmlqWyxmO7vowmgikn6s0GTZYLRVbHYRzedL3cBhNs3JQJ+Hr3MVLfkxLNhDBp Yp6ko7q6AYSI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=S0cJLH9xJ/7jNb7/Zaug9qjd7SU=; b=q4cIQ bR9M4nYFTTwLwEdcW2DHVDj5w9pDo9GYHuKCfW+6GJrlYNhN01oyKAJ8HucIY6cQ 5mvdRdEBtNn4UqssuGjpu9nj7o+B7AyPTPj5QGOZLT8tnVCHzbNM8jpSkp38zD3C 5lNV6nTJEKd6gxMXAF7AX8GbA42YkWtG/dfgL0= Received: (qmail 15964 invoked by alias); 15 Oct 2018 20:50:21 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 15805 invoked by uid 89); 15 Oct 2018 20:50:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=pending X-HELO: mail-qt1-f196.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=474zF06ub3bDdUWJbtQ0L/+1Ke+/RGGt4QxsI2Fy7AY=; b=AfxfeBVEkNn01Ff+Ijey+QmWVrgeS8NN0SBMjmzYwcu+q0jeu1Vb9Xv7iECq7bs5L0 xDZXfyxoEWYCRCGSQ7rla7M4Ng7ZkQuR3lHpjm84QREt9ZEGT4ZYbtNcfIi3IWyVa5ey +WfSOEWjGiNfn4obINyS4jZpAkxat7f3yfmUE= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: hpa@zytor.com Subject: [PATCH 10/12] termios: Remove Linux _IOT_termios Date: Mon, 15 Oct 2018 17:49:54 -0300 Message-Id: <20181015204956.25558-10-adhemerval.zanella@linaro.org> In-Reply-To: <20181015204956.25558-1-adhemerval.zanella@linaro.org> References: <20181015204956.25558-1-adhemerval.zanella@linaro.org> It is used only on hurd. No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/bits/termios.h (_IOT_termios): Remove. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. --- sysdeps/unix/sysv/linux/alpha/bits/termios.h | 3 --- sysdeps/unix/sysv/linux/bits/termios.h | 3 --- sysdeps/unix/sysv/linux/mips/bits/termios.h | 3 --- 3 files changed, 9 deletions(-) -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h index 66b84f26c7..1824b3d8e7 100644 --- a/sysdeps/unix/sysv/linux/alpha/bits/termios.h +++ b/sysdeps/unix/sysv/linux/alpha/bits/termios.h @@ -67,6 +67,3 @@ typedef unsigned int tcflag_t; #define TCIOFLUSH 2 #include - -#define _IOT_termios /* Hurd ioctl type field. */ \ - _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h index b0263dfa71..1d47729945 100644 --- a/sysdeps/unix/sysv/linux/bits/termios.h +++ b/sysdeps/unix/sysv/linux/bits/termios.h @@ -72,6 +72,3 @@ typedef unsigned int tcflag_t; #define TCIOFLUSH 2 #include - -#define _IOT_termios /* Hurd ioctl type field. */ \ - _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h index ca4f106855..3b015432c0 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/termios.h +++ b/sysdeps/unix/sysv/linux/mips/bits/termios.h @@ -72,6 +72,3 @@ typedef unsigned int tcflag_t; #define TCIOFLUSH 2 /* Discard all pending data. */ #include - -#define _IOT_termios /* Hurd ioctl type field. */ \ - _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2) From patchwork Mon Oct 15 20:49:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 148896 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4252560lji; Mon, 15 Oct 2018 13:51:57 -0700 (PDT) X-Google-Smtp-Source: ACcGV60LgnHIhS15PLY8RjKtOsDFZCy6mmLtd2fNMk5MYgMPUBPO58Le8LSeZNU7vlZFX0YnG96H X-Received: by 2002:a65:4145:: with SMTP id x5-v6mr17384605pgp.309.1539636717197; Mon, 15 Oct 2018 13:51:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539636717; cv=none; d=google.com; s=arc-20160816; b=k4pvQPASpRRSOsL1IbsSnID47sgBfiAg1Q/LD4d9V+1MwlQw2RvW5qaPodZx93mIX9 aooPkeOLyNT0LMZ03zJP7Xe0PGmFRBsfbByHDBz9/6wDJCDXmzvJycYXNtpTRtvlvaXV sClgw6S9qSzXtxu55NxPqawjxX2qGX9yPkXoNHnk1KYqBTTiVJ2iOTflV3s46KMTsxmb W6kius3LoIGCVexswo4uQpeDrq47L1hZSjxgWpOilvZYTfp77HZUG0K62bJmnSAS5gg4 GpjbEO3lgCWD4uOoZlvGguVRichIv8IprG5FeeVYEE8fZDHbyRJvTPwx8VNHmsgrqlgf kesg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=DACdLqZoqNeefqkLkB1HflqBbHm23apiGQa3wAqT74I=; b=U84ermO7zSo6TeOGAyNGsPLvwhKKeZZWv+C9sPdWe73EobC7BtVBEaJCG7SMfCK3/D yDsdOhLSz5gHC2O04is8eEst9P9HeWMYhcZxoWE0Kfb2WjLfe7EFnw6bCjDEuvLWjfgk L/i+oiLdUO1okqZ94V0XXICbTLn9dm5TheQMy31DIot3m/6qyj50gsBVkDSyuzyBQxbB jowLhSzi5XZURlc8lYcFsS1iTm1e4NiEAqit82IlGeZHPfxTgOfa1CrYfOvf6kbjEIha WCjm5+KPO77gKh3iQOlIb55LjgH4sct/OWBUo5FpozXDdLIX9x3gSnXIaq7vyKMC92Zp 4Lng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=BMQOWIWP; dkim=pass header.i=@linaro.org header.s=google header.b="gHn/EghH"; spf=pass (google.com: domain of libc-alpha-return-96446-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96446-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id o12-v6si12519618pfd.102.2018.10.15.13.51.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 13:51:57 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-96446-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=BMQOWIWP; dkim=pass header.i=@linaro.org header.s=google header.b="gHn/EghH"; spf=pass (google.com: domain of libc-alpha-return-96446-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96446-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=D2tbJIe2+Fk0WvGK3bX6+D2CK/Pg0QZ VzSDPUGQmFPhC1ILyIoSsxm64m/Dgx1gT1Zk2bK1V4YGngmo+ZhJwAaDe1d6dUXS prNKVzUOK3RBJD0pYx/4Gf+NxvmLvFjW7kfGHDdpUhEQkD8GvbpSLUOS42EEFalq CCmDIOwBbHwY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=opgoxuAV7y6dAUR3RyzMANw4kGw=; b=BMQOW IWPy2Qx5loILqe/F+NHHgb3/rn9ZUjTaGJyB065U8vsa0WsermZzaABrqKrbI9Yd i4gdBbxl9ahYPIZhSg1BsIhD63KWUNLtfQjNApl8d5zqQI9eqzXmlA1pJKc/Ki5N ZXh0G0f30dmSmeZ6+kh02Bic8mlfKEfPIS0dn4= Received: (qmail 16556 invoked by alias); 15 Oct 2018 20:50:25 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 16156 invoked by uid 89); 15 Oct 2018 20:50:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=BSD, bsd X-HELO: mail-qt1-f193.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DACdLqZoqNeefqkLkB1HflqBbHm23apiGQa3wAqT74I=; b=gHn/EghHxoet++wTuXmxNXSqXo75dV2AqvvX6nv1o+VAjgiCElIKo8+SI71zBiJcID kSFogStBSU+ByZg5GjYFs8ov1L9DgeNjM8QQSGW+JxtrYxAa8N0kuwVen7NO9MLHn/Sk VUVuq62Aq4EW86yCN/KJW5XaMC4feKqrHf9HA= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: hpa@zytor.com Subject: [PATCH 11/12] termios: Add powerpc termios-misc Date: Mon, 15 Oct 2018 17:49:55 -0300 Message-Id: <20181015204956.25558-11-adhemerval.zanella@linaro.org> In-Reply-To: <20181015204956.25558-1-adhemerval.zanella@linaro.org> References: <20181015204956.25558-1-adhemerval.zanella@linaro.org> PowerPC termios.h header contains additional BSD terminal mode definitions (sgttyb, tchars, ltchars, and associated TIOCPKT_* symbolic constants). This patch moves all powerpc termios specific definition to its own header. No semantic change is expected, checked on a build against a powerpc64le-linux-gnu build. * sysdeps/unix/sysv/linux/powerpc/bits/termios-misc.h: New file. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h [__USE_MISC] (struct sgtty, struct tchars, struct ltchars, TIOCPKT_DATA, TIOCPKT_FLUSHREAD, TIOCPKT_FLUSHWRITE, TIOCPKT_STOP, TIOCPKT_START, TIOCPKT_NOSTOP, TIOCPKT_DOSTOP, _VINTR, _VQUIT, _VERASE, _VKILL, _VEOF, _VMIN, _VEOL, _VTIME, _VEOL2, _VSWTC): Move to termios-misc.h. * sysdeps/unix/sysv/linux/powerpc/Makefile [$subdir == misc] (sysdep_headers): Add termios-misc.h. --- sysdeps/unix/sysv/linux/powerpc/Makefile | 2 +- .../sysv/linux/powerpc/bits/termios-misc.h | 72 +++++++++++++++++++ .../unix/sysv/linux/powerpc/bits/termios.h | 50 +------------ 3 files changed, 74 insertions(+), 50 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/termios-misc.h -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/powerpc/Makefile b/sysdeps/unix/sysv/linux/powerpc/Makefile index 19ac59d862..7712428e10 100644 --- a/sysdeps/unix/sysv/linux/powerpc/Makefile +++ b/sysdeps/unix/sysv/linux/powerpc/Makefile @@ -23,7 +23,7 @@ LDFLAGS-tst-tlsmod2.so += -Wl,--no-tls-get-addr-optimize endif ifeq ($(subdir),misc) -sysdep_headers += bits/ppc.h +sysdep_headers += bits/ppc.h bits/termios-misc.h sysdep_routines += get_timebase_freq tests += test-gettimebasefreq tests += test-powerpc-linux-sysconf diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios-misc.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios-misc.h new file mode 100644 index 0000000000..2e7fc2f7ae --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios-misc.h @@ -0,0 +1,72 @@ +/* termios baud platform specific definitions. Linux/powerpc version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif + +#ifdef __USE_MISC + +struct sgttyb { + char sg_ispeed; + char sg_ospeed; + char sg_erase; + char sg_kill; + short sg_flags; +}; + +struct tchars { + char t_intrc; + char t_quitc; + char t_startc; + char t_stopc; + char t_eofc; + char t_brkc; +}; + +struct ltchars { + char t_suspc; + char t_dsuspc; + char t_rprntc; + char t_flushc; + char t_werasc; + char t_lnextc; +}; + +/* Used for packet mode */ +#define TIOCPKT_DATA 0 +#define TIOCPKT_FLUSHREAD 1 +#define TIOCPKT_FLUSHWRITE 2 +#define TIOCPKT_STOP 4 +#define TIOCPKT_START 8 +#define TIOCPKT_NOSTOP 16 +#define TIOCPKT_DOSTOP 32 + +/* c_cc characters */ +#define _VINTR 0 +#define _VQUIT 1 +#define _VERASE 2 +#define _VKILL 3 +#define _VEOF 4 +#define _VMIN 5 +#define _VEOL 6 +#define _VTIME 7 +#define _VEOL2 8 +#define _VSWTC 9 + +#endif /* __USE_MISC */ diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h index 885bf952bd..4f00b4fe0c 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h @@ -67,58 +67,10 @@ typedef unsigned int tcflag_t; #include -#ifdef __USE_MISC - -struct sgttyb { - char sg_ispeed; - char sg_ospeed; - char sg_erase; - char sg_kill; - short sg_flags; -}; - -struct tchars { - char t_intrc; - char t_quitc; - char t_startc; - char t_stopc; - char t_eofc; - char t_brkc; -}; - -struct ltchars { - char t_suspc; - char t_dsuspc; - char t_rprntc; - char t_flushc; - char t_werasc; - char t_lnextc; -}; - -/* Used for packet mode */ -#define TIOCPKT_DATA 0 -#define TIOCPKT_FLUSHREAD 1 -#define TIOCPKT_FLUSHWRITE 2 -#define TIOCPKT_STOP 4 -#define TIOCPKT_START 8 -#define TIOCPKT_NOSTOP 16 -#define TIOCPKT_DOSTOP 32 - -/* c_cc characters */ -#define _VINTR 0 -#define _VQUIT 1 -#define _VERASE 2 -#define _VKILL 3 -#define _VEOF 4 -#define _VMIN 5 -#define _VEOL 6 -#define _VTIME 7 -#define _VEOL2 8 -#define _VSWTC 9 +#include #ifdef __USE_MISC /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ # define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ #endif -#endif /* __USE_MISC */ From patchwork Mon Oct 15 20:49:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 148897 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4252683lji; Mon, 15 Oct 2018 13:52:06 -0700 (PDT) X-Google-Smtp-Source: ACcGV61WtiViAQe7H59Pjxa8uXAavshdw8vmY+KvNHfxpBvAB3hmOhE0XILII+hqYZXgJpx9m91Q X-Received: by 2002:a63:2dc5:: with SMTP id t188-v6mr16940763pgt.362.1539636726108; Mon, 15 Oct 2018 13:52:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539636726; cv=none; d=google.com; s=arc-20160816; b=TihjzeZmv71HyqKOgdFCp/n8zLhzqs6YSjj/AIwhZb0wwwb6ndlrh7muYTMwf4HTEm NmT+00UYjkQIUqVhPc8wZLostp9HlTaj/x/HcyFk83d/ZK7T+hVhBw658+QTxfrwztmJ LTovKH9aBCVDX7fb+sxNQAINREjkUv1o6ol2W82Gw6vYb3aGqL3isvM4oPqwSI+B66Xz qXBLgoPt7314EVSQCT2arc7ws78JPA9lZcMnsM2CgnrKXN1VqDPHV2i9C0f+B1QUZ2Tw mtl19l9yikOrDIyvBlEyN9OX/uJCRjVE4hEnDjTjpG6tW2XIQG+dNAPqpBSJ2jM/H4c1 CS+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=bGWqBOF8PDAHuEYjjfAzec6zUrPo5HK8yWuZCCLRJT4=; b=x2NbdWFEp2VhOlqhki6v2fEJqPcWMQc657TD10WyLBykF32sCy8Rg2NrWZvmcXYylm Y2O00AbcPfAqfyi/YATJf6+IblDQgacvDC/QWXgWP/W/8rkgnnQvgaDiiv9GTyxlU0UQ WeQo/0bFtnS0ofl2w2U7d2IjjSRz8DsIWpYDwXN792qAgWMb1gdmW9OYhEXD99qEC6Hw d18H12sr621ubaVT5CjR/AsfXg5zCJyBd86918xKNIGUeJJi6LGURE+PpJF/8BRYFAoy feN12gZ7Fl7/TzsOotSGf/s72JAHMOdl3tNGO7GGSklrKUGC/OQ9CDvGEk9TGiReeAgs P4Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="Bwhu4z6/"; dkim=pass header.i=@linaro.org header.s=google header.b="baiHwgP/"; spf=pass (google.com: domain of libc-alpha-return-96447-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96447-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id i25-v6si12226300pgi.426.2018.10.15.13.52.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 13:52:06 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-96447-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="Bwhu4z6/"; dkim=pass header.i=@linaro.org header.s=google header.b="baiHwgP/"; spf=pass (google.com: domain of libc-alpha-return-96447-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-96447-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=PyM25+tLLPzLZpFWZ8x20ixBEGft4nf +Uu1vmlCyIXl5n2ifUoWE+QrnKM4pxm8XpBaFX8WDMeuH5ykIsaqhlf29tHwNQ4p Og5tWusqIJmXI8Rt1bfWB3MpA8Ae9sgGOkb0Uk2KCqYV6lU583hMnkQNuQuyd8n+ bKMxYvcr4ddQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=i9taM3YU9CVKst8wKLqn+4oPznU=; b=Bwhu4 z6/6Si9JLTGM5JzWs+7K+xCz8RCqi7xS8p8lk0kGmZq3IJcRdFARkZmPICz3lpJ4 sir+UI7ROo/Jt3EWN5Jb8GY1lSaUJMPDeYgl5gyssJ4LRyOsHWxNmCIrV/iSTGFd EMf9hEn44FKR2Nb8HdDwhrSq92UZbw0cPAkKvU= Received: (qmail 16704 invoked by alias); 15 Oct 2018 20:50:26 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 16551 invoked by uid 89); 15 Oct 2018 20:50:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=295 X-HELO: mail-qt1-f195.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bGWqBOF8PDAHuEYjjfAzec6zUrPo5HK8yWuZCCLRJT4=; b=baiHwgP/d+eNKDuAct+hp0LM5Ek4BnNZlAI/Ec6PhZpn5/AfeF0C+rBPWMGi+90h0s koTmjrOpDSARYmuEp7smkbeTl41Qwbd/R+/+8PvCTDzNNdllrSgrMklSh6hLXE7Z5vac tx+7mUbCQvMAJDFq6IHoqkjkIO5ozvZhG8pLU= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: hpa@zytor.com Subject: [PATCH 12/12] termios: Consolidate termios.h Date: Mon, 15 Oct 2018 17:49:56 -0300 Message-Id: <20181015204956.25558-12-adhemerval.zanella@linaro.org> In-Reply-To: <20181015204956.25558-1-adhemerval.zanella@linaro.org> References: <20181015204956.25558-1-adhemerval.zanella@linaro.org> This patch consolidates the Linux termios.h by removing the arch-specific one. No semantic change is expected, checked on a build against x86_64-linux-gnu, alpha-linux-gnu, mips64-linux-gnu, and sparc64-linux-gnu. * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add bits/termios-misc.h. * sysdeps/unix/sysv/linux/alpha/bits/termios.h: Remove file. * sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/termios.h: Likewise. * sysdeps/unix/sysv/linux/bits/termios-misc.h: New file. * sysdeps/unix/sysv/linux/bits/termios.h: Include termios-misc.h. --- sysdeps/unix/sysv/linux/Makefile | 3 +- sysdeps/unix/sysv/linux/alpha/bits/termios.h | 69 ----------------- sysdeps/unix/sysv/linux/bits/termios-misc.h | 21 +++++ sysdeps/unix/sysv/linux/bits/termios.h | 2 + sysdeps/unix/sysv/linux/mips/bits/termios.h | 74 ------------------ sysdeps/unix/sysv/linux/powerpc/Makefile | 2 +- .../unix/sysv/linux/powerpc/bits/termios.h | 76 ------------------- sysdeps/unix/sysv/linux/sparc/bits/termios.h | 74 ------------------ 8 files changed, 26 insertions(+), 295 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/alpha/bits/termios.h create mode 100644 sysdeps/unix/sysv/linux/bits/termios-misc.h delete mode 100644 sysdeps/unix/sysv/linux/mips/bits/termios.h delete mode 100644 sysdeps/unix/sysv/linux/powerpc/bits/termios.h delete mode 100644 sysdeps/unix/sysv/linux/sparc/bits/termios.h -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index e3035250c9..08fd74479b 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -46,7 +46,8 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \ bits/msq-pad.h bits/termios-struct.h bits/termios-c_cc.h \ bits/termios-c_iflag.h bits/termios-c_oflag.h \ bits/termios-baud.h bits/termios-c_cflag.h \ - bits/termios-c_lflag.h bits/termios-tcflow.h + bits/termios-c_lflag.h bits/termios-tcflow.h \ + bits/termios-misc.h tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \ tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \ diff --git a/sysdeps/unix/sysv/linux/alpha/bits/termios.h b/sysdeps/unix/sysv/linux/alpha/bits/termios.h deleted file mode 100644 index 1824b3d8e7..0000000000 --- a/sysdeps/unix/sysv/linux/alpha/bits/termios.h +++ /dev/null @@ -1,69 +0,0 @@ -/* termios type and macro definitions. Linux version. - Copyright (C) 1993-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _TERMIOS_H -# error "Never include directly; use instead." -#endif - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -#include -#include -#include -#include - -/* c_cflag bit meaning */ -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#ifdef __USE_MISC -# define EXTA B19200 -# define EXTB B38400 -#endif -#include - -#include -#include - -/* 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 - -#include diff --git a/sysdeps/unix/sysv/linux/bits/termios-misc.h b/sysdeps/unix/sysv/linux/bits/termios-misc.h new file mode 100644 index 0000000000..83bdec342e --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/termios-misc.h @@ -0,0 +1,21 @@ +/* termios baud platform specific definitions. Linux/generic version. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _TERMIOS_H +# error "Never include directly; use instead." +#endif diff --git a/sysdeps/unix/sysv/linux/bits/termios.h b/sysdeps/unix/sysv/linux/bits/termios.h index 1d47729945..41a7c53322 100644 --- a/sysdeps/unix/sysv/linux/bits/termios.h +++ b/sysdeps/unix/sysv/linux/bits/termios.h @@ -72,3 +72,5 @@ typedef unsigned int tcflag_t; #define TCIOFLUSH 2 #include + +#include diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h deleted file mode 100644 index 3b015432c0..0000000000 --- a/sysdeps/unix/sysv/linux/mips/bits/termios.h +++ /dev/null @@ -1,74 +0,0 @@ -/* termios type and macro definitions. Linux/MIPS version. - Copyright (C) 1993-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _TERMIOS_H -# error "Never include directly; use instead." -#endif - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -#include -#include -#include -#include - -/* c_cflag bit meaning */ -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#ifdef __USE_MISC -# define EXTA B19200 -# define EXTB B38400 -#endif -#include - -#include -#include - -#ifdef __USE_MISC -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ -#endif - -/* tcflow() and TCXONC use these */ -#define TCOOFF 0 /* Suspend output. */ -#define TCOON 1 /* Restart suspended output. */ -#define TCIOFF 2 /* Send a STOP character. */ -#define TCION 3 /* Send a START character. */ - -/* tcflush() and TCFLSH use these */ -#define TCIFLUSH 0 /* Discard data received but not yet read. */ -#define TCOFLUSH 1 /* Discard data written but not yet sent. */ -#define TCIOFLUSH 2 /* Discard all pending data. */ - -#include diff --git a/sysdeps/unix/sysv/linux/powerpc/Makefile b/sysdeps/unix/sysv/linux/powerpc/Makefile index 7712428e10..19ac59d862 100644 --- a/sysdeps/unix/sysv/linux/powerpc/Makefile +++ b/sysdeps/unix/sysv/linux/powerpc/Makefile @@ -23,7 +23,7 @@ LDFLAGS-tst-tlsmod2.so += -Wl,--no-tls-get-addr-optimize endif ifeq ($(subdir),misc) -sysdep_headers += bits/ppc.h bits/termios-misc.h +sysdep_headers += bits/ppc.h sysdep_routines += get_timebase_freq tests += test-gettimebasefreq tests += test-powerpc-linux-sysconf diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h b/sysdeps/unix/sysv/linux/powerpc/bits/termios.h deleted file mode 100644 index 4f00b4fe0c..0000000000 --- a/sysdeps/unix/sysv/linux/powerpc/bits/termios.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 1997-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _TERMIOS_H -# error "Never include directly; use instead." -#endif - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -#include -#include -#include -#include - -/* c_cflag bit meaning */ -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#ifdef __USE_MISC -# define EXTA B19200 -# define EXTB B38400 -#endif -#include - -#include -#include - -/* 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 - -#include - -#include - -#ifdef __USE_MISC -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ -#endif - diff --git a/sysdeps/unix/sysv/linux/sparc/bits/termios.h b/sysdeps/unix/sysv/linux/sparc/bits/termios.h deleted file mode 100644 index fbf4df4335..0000000000 --- a/sysdeps/unix/sysv/linux/sparc/bits/termios.h +++ /dev/null @@ -1,74 +0,0 @@ -/* termios type and macro definitions. Linux/SPARC version. - Copyright (C) 1993-2018 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _TERMIOS_H -# error "Never include directly; use instead." -#endif - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -#include -#include -#include -#include - -/* c_cflag bit meaning */ -#define B0 0x00000000 /* hang up */ -#define B50 0x00000001 -#define B75 0x00000002 -#define B110 0x00000003 -#define B134 0x00000004 -#define B150 0x00000005 -#define B200 0x00000006 -#define B300 0x00000007 -#define B600 0x00000008 -#define B1200 0x00000009 -#define B1800 0x0000000a -#define B2400 0x0000000b -#define B4800 0x0000000c -#define B9600 0x0000000d -#define B19200 0x0000000e -#define B38400 0x0000000f -#ifdef __USE_MISC -# define EXTA B19200 -# define EXTB B38400 -#endif -#include - -#include -#include - -#ifdef __USE_MISC -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ -#endif - -/* tcflow() and TCXONC use these */ -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -/* tcflush() and TCFLSH use these */ -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -#include