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