From patchwork Fri Dec 28 01:09:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 154592 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7510187ljp; Thu, 27 Dec 2018 17:11:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN7PdrdnIkK9/CSzODTiQx1t9OSDEXzj6LvgE/5bEZXybQysftMepJ6eQ+EYjgOVJrI1xa78 X-Received: by 2002:a62:6cc9:: with SMTP id h192mr13068021pfc.223.1545959505311; Thu, 27 Dec 2018 17:11:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545959505; cv=none; d=google.com; s=arc-20160816; b=FPV8A+FGPxFkxYtVO3T5KnhUDxnn+ULvuh2vpqke1pgEXjWD9rSi4ERC1OWv2Hjp8w 6vcHhYyxw/IVNLFFBHcZDwrbjikDFX9ryHH0LbV823jqtHJ+GnM9xc+7dZWJOHIT3jhj ImPw4VIFYsZrvKT5v7wlBo26P3XR1xhiObfSUQsxJw2Gpd+lC3kAdDbG9XCaiYsDg3HE gJM9cYYnmmfWrKGoNc67fq1jLqv3ecirhRkp4zx/aMg1u3LJJQlw29WprMy30sPNMdsP u/qrJFkdPadQxlK51NwBuod7P1v0zsJ1t7njx4j1vAyGeT5kHll04nHohH5tGrPAB/w8 JlWw== 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=dUOmjtC8V8GGn2uWXLBuN49VptlHHzSa+cc8oE5acZc=; b=wpkcXnmiPAN7ZK/cTrUwVuPnnEf+O85SqgJKpseqiAxs74G+z0sxQt07lebCIDxwZH rTMc47LJl99xIJu8FpsTyTwvQz+QEQswUEpA/s5TkiPI5v4clAykJc9ZccfCUu0DTF5l sE6SIXcKuM2KgJvMlRexdj8nWz6uPut0hywkOG5ijgmxJnIsHnM+6XA5Ut/nfXH0ppiP dD2UOjn6kV57cEkwXhwHBn5v4AvBJEpG401EVbMg+CEq+irWR/7+sqve12kwvrpeVQ9r PrdBchPA09rDlnZxuKTjyX3SxZo9H/Z++2VqYpUKKeWt2SIZBaqMKStTbDToNYK4mMtF cxag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=d+x8tqnD; dkim=pass header.i=@linaro.org header.s=google header.b="F/fvcx73"; spf=pass (google.com: domain of libc-alpha-return-98828-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98828-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 d2si36890631pla.81.2018.12.27.17.11.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 17:11:45 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-98828-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=d+x8tqnD; dkim=pass header.i=@linaro.org header.s=google header.b="F/fvcx73"; spf=pass (google.com: domain of libc-alpha-return-98828-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98828-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=JSowGySMfCN+mjMjv+MHi4m6Cv1/87O Pp5AMuljTnDDWuQUiMrqjpUdZN9N52cjRV9RfXwDCCfGqAz8uX+uJpepf7qdHSX7 6+HJMW3wzn1tsaVN3N23upZNzXH+fF9Z50393EasD1Yr9+aqFRGGrgZlosunW1N+ kLXFV2Nw489g= 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=Sdlp4riv/il4YuhTDaQmGk8Fdps=; b=d+x8t qnD51jatMS5gQqIIjxNhTK9B/sdArlJDcVpxdHfiJwHp/G/Q4Uuv9hLCmO8g0TjA 51vHHKhC+E2pVBaFw0MtCFcjmqA4YibLJ8/tTIWMRZeGo7SonCJGSWXR45hm+5RB m7akgF7nsBtEEG2rUxe1RAJB4mQs0jKIvf6wEQ= Received: (qmail 50613 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 50365 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=Values 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:subject:date:message-id:in-reply-to:references; bh=dUOmjtC8V8GGn2uWXLBuN49VptlHHzSa+cc8oE5acZc=; b=F/fvcx73A3nip2ib7Oa+bs19Vqwa3Kk9JPFvyYZ/5qxDSeSe2coMHew15Y4uAlab9B R9rUxM6j38NxyyEMaa5WBM2yw2ut/ybKWDmVcnlRZqlc9s6Ec+32oz4GpNJPvS91ZBVj TIqJTK/KMqVQjigX7Thi+OmwoxQkW5UUYkntU= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 09/12] termios: Consolidate tcflow symbolic constants Date: Thu, 27 Dec 2018 23:09:58 -0200 Message-Id: <20181228011001.22260-10-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 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 bd17a574ba..feddcab688 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -47,7 +47,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.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