From patchwork Fri Dec 28 01:09: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: 154591 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7510093ljp; Thu, 27 Dec 2018 17:11:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vm1a12ZXz60NLezkTongm70VoAG3GuTnocRUxXhbr0rzqX1tt/LS/l3FiC4Ay9MYHraDzj X-Received: by 2002:a62:a1a:: with SMTP id s26mr26265309pfi.31.1545959496105; Thu, 27 Dec 2018 17:11:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545959496; cv=none; d=google.com; s=arc-20160816; b=KMozQxTfn8Dvtn3TMxQB2WL933HSyvJ4gzv8B0n8ZkeUAV85oYFIlCHM80iFLzvCM3 tLYwCe5PXTOh8R36O+kOmCP6ywt+Mr+cXMMwLFV57SPsovARH+zyMdjNZ1M/MjohbCCj kasMbHEdhNi+wrAecjPZyHW4dkU9UfvCStBHaNUn5QdUtSf7CSGlq4202Cdsnxz8gyKl 1fibp3PHWWcykoCEiaqXY3BmYqLJLiUs4qkMCowBZukTNiq1fvRVa1PvlfnHMVFsw2VE uFvK6nRzaxK21RpN57asCNWKCawLTUq/zAmTf+UGhuGv6iq8/74LQj59+BOaqeocDxSQ XBpg== 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: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=xABXU2uWjXFW8ZJuvYoV0nO1CsCk4dWzrTYEiw0mM3I=; b=CZn+6uXrYo5Q44HTMuV7JuvENpgnmsrrrqRKw/VBCNw+C6NCOi2RSbLKeWyoVOmz13 Canhd7wKT/NisnTQaNUHNojIOmM8XOAa4oToiZksSxOzOnfX4WjleacGsQUE2qPTuJqn fFqE3WgP1dmhmxwAgVoEjVJkj+F7UR/oDTU2/6MbGgZwQPs794eamSXZgst7J1QtCJmv T64Vm4Xohmxs55PSy09a/LiCf84Dma7dgKWbNWc0v94hCNi0Z8ytvp2rAci9W72Yhygh D1uNcO40KXh17rA/w4owMgYSZ6vV+j7i/J5gX1CUyROTpDPNQitGMTdgo+0/KsM3Eu3J 6kVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=YOtmwE8g; dkim=pass header.i=@linaro.org header.s=google header.b=BiXzXjSD; spf=pass (google.com: domain of libc-alpha-return-98827-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98827-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 v69si37128549pgb.3.2018.12.27.17.11.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 17:11:36 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-98827-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=YOtmwE8g; dkim=pass header.i=@linaro.org header.s=google header.b=BiXzXjSD; spf=pass (google.com: domain of libc-alpha-return-98827-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98827-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:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=ywP75EgOtYWBb6mx+6ngAwdbj70OwPo 2cy8nEKTDz7c4vnxzvOPrfijP3XO5l0izx/RbJk1Zb5VWogafGdamXGh6/7K3n/t FTQWu18xa+fhmEVczRYjwlAdrwU9WN5mOot3cpcIywY2iQ0ey8Fi2C1fQxIqTuBh Cgs/V9nmru0Y= 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:subject:date:message-id:in-reply-to :references; s=default; bh=+SFuT5XlOTBbLHfESmRAAbOnl/U=; b=YOtmw E8gDiRxAmwarkemHH+cLilyXgjD4QaWP2RMGtkTg3z6kEkbhCsdjRUEp25vcm4UB uwjbSkue9QFX2NQlDEp8GHD0CqRgZeLMiJVY+GsWmjxFJElO3foKrBF1QilUtFvr k8J4//YXlajQXp/as58+PlPerU/XuUW9rfIZtE= Received: (qmail 50470 invoked by alias); 28 Dec 2018 01:10:27 -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 50298 invoked by uid 89); 28 Dec 2018 01:10:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=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, Hang, modem 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:subject:date:message-id:in-reply-to:references; bh=xABXU2uWjXFW8ZJuvYoV0nO1CsCk4dWzrTYEiw0mM3I=; b=BiXzXjSDQuCohWTwzjs2+ykuWG9h694z7C4mW/bMS1v/t7PHDt3NkxFFQd9j1rE0an 7MDbUoJcV9P463YPoqtLiHbmtK3/74xu/xh3/ZvMJgUHlosnhU5txuNH5OZTIYA/kq+v ZVAxuz+tpkSmxLamfl+1f44R13o7Q7KljlmeU= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 07/12] termios: Consolidate control mode definitions Date: Thu, 27 Dec 2018 23:09:56 -0200 Message-Id: <20181228011001.22260-8-adhemerval.zanella@linaro.org> In-Reply-To: <20181228011001.22260-1-adhemerval.zanella@linaro.org> References: <20181228011001.22260-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 e1ddbf9787..9186e3af96 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/sem-pad.h bits/shmlba.h bits/shm-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