From patchwork Fri Dec 28 01:09: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: 154585 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7509360ljp; Thu, 27 Dec 2018 17:10:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN40kOJFYWwdnpdb2XGn+ZZ+rJYGunhsjh5NGxkNXTgtDC/hx70uWFMN8IEqcuWaYvmpLzrB X-Received: by 2002:a65:60c2:: with SMTP id r2mr24818730pgv.393.1545959432517; Thu, 27 Dec 2018 17:10:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545959432; cv=none; d=google.com; s=arc-20160816; b=GZ/DULONFsQntV30tC0XBYmfddh5uYyktYwUsm8K7HFJOmeIcKh1tJ97Eny7+z5tbQ HYd0fj2swgm7ChX01JxURxIZsgdqVRZkOUTLG4I5lkzK92PAKduNhMesYvcxoUPleKdD c6HziViHG3uuX0hzEdvyC5BdTIDC7HuDMTJhtA89GsFavGL+nRin0WRY17ABINsFst9h tuvPe1HIf7JSyHqBPorbkmDB5fsvXt7Q6Wpmq54V20pGUIwtNKf9ZTEBzIxW8hZTwxzQ qv8IouLmvXtpLTUQyBu6LGhjuEjCaCCjzYBcVsjS5KqIv3w/2azFidQhdOTvhYvQAb72 OxpA== 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=XmI5DpuNIJheobh6YBPom6nsLX0GsY6et+MfjjKCuK8=; b=itn7fzR9EsubBtejKGtvrxDK6XIdwJ5lu6WSI6bGyrwG2xpUsqlh8SkKaecNi9LeX7 GRAXbO+vW6zLNUlHfK7IBsPgcXuDslpel+7Vk6rEWE6nCWMMf6gvsYzKSYV8Www1KeQh qs5yb3PRMWG8qd5rVooQuuAwh6f/c+3WNX/fitkOr6OA8yW1XobmGxhuxS5zWnPgcNGj P07prupojVRnSY/QTHGjQBC+NDGj1hSU/rlqhHmKQkSxZ0k87hHo017wLIRpIQDkDeUz kEcF955WR61/CrkcGrY576sfZp+jMziwOms9r8FOKnGusw5cdUkIWE/D6aSZEXklXceL bDKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="GwZmcj/f"; dkim=pass header.i=@linaro.org header.s=google header.b=A3hCx9Vh; spf=pass (google.com: domain of libc-alpha-return-98821-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98821-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 h36si17542795pgm.200.2018.12.27.17.10.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 17:10:32 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-98821-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="GwZmcj/f"; dkim=pass header.i=@linaro.org header.s=google header.b=A3hCx9Vh; spf=pass (google.com: domain of libc-alpha-return-98821-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98821-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=TyKJTV0/I2aCl3NmlT0w5IwV3GniF+E ai+X8hHcnyUFZo8B7at6iZequF/Y5Yo+tH0Eg/tg4hcEn2qTN0yY8Ei9O0z9srDq DZQXcK9LdUBoxlyS6bpJcWtBOGUcTgFWVGcr00aRbAwU+5Pwq6H66Mju3DiufGH0 krHOsuqTp+ZA= 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=CUlPH6D5sfBPcPQm922POthO+U0=; b=GwZmc j/fKfDHQ500fYUPIV6y9bIUxPAbs6Atig5R/CTrtxDB/HFrNhMAREb+Cd0rdbP5E PTZRT+B7DkyL+cKYFKgp7tzMrtI5YvACw4KMNNpPM8N0/Zxl6g850sIg213wdQQe QtrKFbQL3bMAN5lw/aB9R7ifqw7wg+8eVO+IGo= Received: (qmail 48517 invoked by alias); 28 Dec 2018 01:10:11 -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 48447 invoked by uid 89); 28 Dec 2018 01:10:10 -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, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=1986, physically, Hx-spam-relays-external:209.85.160.195, H*RU:209.85.160.195 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:subject:date:message-id:in-reply-to:references; bh=XmI5DpuNIJheobh6YBPom6nsLX0GsY6et+MfjjKCuK8=; b=A3hCx9VhQobzf1nmpAdqrer9t8z1Oao21k2u8c8iN0TqhrPJ02W1VnTNbsDTgZcFdI vGe9D+HsFb5MkhjqVsrcrD2EvF3Qkq0O6IPKwcrIH09oVlfxcg7//VOw8xEEiqNzkpeu nUe2SVrgJQEF+C8m0RK44LJ1u3MnJcpUrwEkg= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 01/12] termios: Define TIOCSER_TEMT with __USE_MISC (BZ#17783) Date: Thu, 27 Dec 2018 23:09:50 -0200 Message-Id: <20181228011001.22260-2-adhemerval.zanella@linaro.org> In-Reply-To: <20181228011001.22260-1-adhemerval.zanella@linaro.org> References: <20181228011001.22260-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 Fri Dec 28 01:09: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: 154586 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7509476ljp; Thu, 27 Dec 2018 17:10:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/VZWe3HnzkZFUsr+HRidUk5SBbAM9ANLV1hT8/cQPmBjQicuEFbGGfv5JTEz1g4fHFvig9u X-Received: by 2002:aa7:81d0:: with SMTP id c16mr25930187pfn.153.1545959442144; Thu, 27 Dec 2018 17:10:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545959442; cv=none; d=google.com; s=arc-20160816; b=cENQdWWxdX/zVz5sUwY8W2o0TMX3CEnY80lfISZdWsK0Dm7ZI+/PG//HYOXOCg0YzH DfXdqZCA4dnidnTTxN75s7B++2XBm9wWnd/oPSZy+QvLLhe7uQtAESmJiCoQgF4m1VDA bhXFAiBlCotqpn4IVgrmmmQa0pw2n52P2fW3STZDYuBSasROOm6xxl6lX2DHiVzO4zp5 xdsSJ/x+J5qsO83eLu/iUIy6CkX5vwbG55rv0gCekd99bbWPGSz1eV4kJKd+n9LaLhNa mKZX2hZdf0veR+08DqFGghKFYRpKt6h/Xf7ZczmgGIob4VzZzNfxTq6IFMQQGqQB9GQi hOBQ== 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=Up7Fy1Uxi1A4j6SFTQJHuRj5WTAwOVgHz9Wt4EfADj4=; b=LcO0lHGnghMs+CTTqOzj8vcN9RDtBMuGPxtUeZp1JQ4hV+XttMY7RtrvbFhnvaUgFT hYt0CxSdP3e8/MdpV6s/7u9wk6jPoC/aQnP1EyVezbyyj9IGogA76YzKRi5PW0wilghp ALXDJpQKrDELYN8ysm+cGThuaaCygGvc4ERW9ZYR1RHGLtamv+8eGv9tQaVTaTdyAGJL 3OySRc8lGNz6qb09sL/KC1qqfyBISTDAh1W6/KIxQtJSE2Y8l3ELHqmMOj7lTUn1lHgX SGP55HUP/0AqtNNtnYHXhEaxvyOlShjWP5R2IUzKiAMvubqU96pQxuHo1u4VzgleNsPL 50lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=g2J17gF8; dkim=pass header.i=@linaro.org header.s=google header.b=VlIckU9A; spf=pass (google.com: domain of libc-alpha-return-98822-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98822-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 t20si36602708plj.94.2018.12.27.17.10.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 17:10:42 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-98822-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=g2J17gF8; dkim=pass header.i=@linaro.org header.s=google header.b=VlIckU9A; spf=pass (google.com: domain of libc-alpha-return-98822-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98822-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=PnHCCTbXbVDmEG5s58Is+9sVHNpa5lc cwQmfqsLL8dE+UtFu9V8f03AZ9UBCI8JJi1vb/T9ZZumOh5XRTNwbV5U9zZnGWvI VaykniW7IAyb3d02hG1wm9Hz14i/Fi2TGBnJaZtdBkJqXG3mOciV00xNtIwyIbpI S9MnJjgBl8kA= 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=kI56aBgT+Vi1fpvPLWzFnGf8dXk=; b=g2J17 gF8SRV0QjND4/KYBDEWMobS4OL9QH8Gbgr5BnOtkps6XeTVzEgtKaCsw1t4nGj6L 9fXQIzXvFncY4V2LePwIevqd2mdD81VqhGDfnzcJLzHOtXn6WnD8zlRZSHEL6Eyh 34m/GthNbFUJ0j/uOFcALJ2zWbeZzPoCoHTiAM= Received: (qmail 49566 invoked by alias); 28 Dec 2018 01:10:20 -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 49492 invoked by uid 89); 28 Dec 2018 01:10:19 -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=Never 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:subject:date:message-id:in-reply-to:references; bh=Up7Fy1Uxi1A4j6SFTQJHuRj5WTAwOVgHz9Wt4EfADj4=; b=VlIckU9ArtSDFv1YlDD5bvbqBEoLJrgVIsUkI8lPlhh8SONqhNKoz+0H4xeOpKkm3U xiCgtcBbPELn24lPCN5BW4hKr6YMSYIvN2AX2mJuIA42JDilDiEmTEeTJxCfdATcZXvh R9zY7vxtBSKRWHzn+HgbG+roUba9APNXuzEoc= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 02/12] termios: Consolidate struct termios Date: Thu, 27 Dec 2018 23:09:51 -0200 Message-Id: <20181228011001.22260-3-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 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 | 3 +- .../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, 165 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 f8274552a7..f9c886448a 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/sem-pad.h bits/shmlba.h bits/shm-pad.h + bits/msq-pad.h bits/sem-pad.h bits/shmlba.h bits/shm-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 Fri Dec 28 01:09: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: 154588 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7509716ljp; Thu, 27 Dec 2018 17:11:02 -0800 (PST) X-Google-Smtp-Source: ALg8bN4BFCe36iO0MZKOHFtEajoBln//8Mty4NUqSkpuUDCn20FWAc8o3ec2XI/8VMF1EoIc78/0 X-Received: by 2002:a17:902:42e4:: with SMTP id h91mr26161310pld.18.1545959461918; Thu, 27 Dec 2018 17:11:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545959461; cv=none; d=google.com; s=arc-20160816; b=RMDW/OVVGwWDuP3himS1MgcmCNIuMlZPPeW6+twBRwdieS5Sy3wacy+jyvqCyjEFLt BjzDN6uoln+yh7gZdJAaoJNYa3hTdgUEGBbKVp1fO+ZxZ7gK38zB2RvLC2RlM2f2Pu// +isgPvCNRWK39R7D2cof95hn19/FrAbVnki/uvjIcn6vyQtzmST/RzRPAIY9I/sXCekG ZWqKxdyE8oXidcihBDxwSNJnjzqHcpjqmjY1z7aAUfVI/MO/HVHJ3IyjLI9qR3duDZF7 7rjGwH3kGnEJ5owmLfJSEU8hqWh62px/8HFYBnxc3e5OM23FwT7g5yiXDmTEFFGfkVWR Y2VQ== 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=dQueNriqhCehanvC6WwP5t5vOuxsUguqoa2iTz/vG5Y=; b=RjjX/UEUSLYhwpYOaw4iHHmcoL2tgUwOhFCZ0slj7tGaYv7Cpcf4nvUHoOPezaJrUM Cu7n84ECDdutSUjQ6DZyVu9IrHvLczxoPP7WsODtaDM+1zXiEO5rfH67C9d+HjC7xF5P IRnYZaix02+WKee7C0UJFML09fq/56gMDuvp5eN5kGFaVlwZsEHixJ9oQYgbkYODCZ/a oc0cWPqVSSEc7EmEJL0s9s4RPN+vub/t6kfkEVh+J8U44jxj2pbbtM0h3EzQLfbv1y49 j8Fhyxha60MggdvHCoTkrAKfZY6oDqlsKeNiYlODCLgC104fINi9J4JLoVFEfr77/hfR 3MWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=YpHfZmJ7; dkim=pass header.i=@linaro.org header.s=google header.b=RKExuzCb; spf=pass (google.com: domain of libc-alpha-return-98824-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98824-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 r18si37126733pgb.491.2018.12.27.17.11.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 17:11:01 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-98824-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=YpHfZmJ7; dkim=pass header.i=@linaro.org header.s=google header.b=RKExuzCb; spf=pass (google.com: domain of libc-alpha-return-98824-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98824-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=cob94eYRaSXf13jRm6RyKLFdW8GKSdC PcfdcEvhbQHqzGJ584ETYQhAWOlnn5LgrurVqItYW5/wksT6+C5xI5jrgr7ASimS 9RBWXapt+me8NlnKWpC9H89vspqkK3hdJpgooY+N4EBtEBc58ekINTydkCJoTs/a lJaCY5JZ197c= 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=WCXvjLOKsjkrM6WEF2AYOwDod40=; b=YpHfZ mJ77RxIaZxEh/gy1r0PeaRKTOExngbRGSEt8nQorrpVtinEV3WkmFFyUUDtQYTgB Fm08svY4T60KjJsDM/tkRibZsK8YSI8o525WgLsHsEeCXtluVqr7PYzcKs+/og+q MlKWgrLEz0NW7VcZ5e4roY7xb9mbEULyfaogv8= Received: (qmail 49747 invoked by alias); 28 Dec 2018 01:10: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 49656 invoked by uid 89); 28 Dec 2018 01:10:20 -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=suspend, Stop, Never, apps 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:subject:date:message-id:in-reply-to:references; bh=dQueNriqhCehanvC6WwP5t5vOuxsUguqoa2iTz/vG5Y=; b=RKExuzCbEEtnvyd8szxH/0tEqcCqr9e+uPwLfj47tH6b2bvp85a4Ee/fCqZ5YZJJjs sNpm6K+9zFrr7aKcTFQmZIn40O2KPo/4E1kAKXlx2xBq1swKJapmpBfyNsw7cu1DQbG3 A3UvE9NbYaaZKdLx/lE5It7goHtt4LNrlXRiA= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 03/12] termios: Consolidate termios c_cc symbolic constants Date: Thu, 27 Dec 2018 23:09:52 -0200 Message-Id: <20181228011001.22260-4-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 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, sparc64, 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-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 f9c886448a..4ef1e03b14 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/sem-pad.h bits/shmlba.h bits/shm-pad.h \ - bits/termios-struct.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 Fri Dec 28 01:09: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: 154587 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7509584ljp; Thu, 27 Dec 2018 17:10:52 -0800 (PST) X-Google-Smtp-Source: ALg8bN6b1TqCmdurLj70+P8yUtrZLBHwh4uM2gFoovWe17PDdPP5ZmUE/zjGeHycji5eNS6C8Y9/ X-Received: by 2002:a63:2a4a:: with SMTP id q71mr24461295pgq.374.1545959452071; Thu, 27 Dec 2018 17:10:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545959452; cv=none; d=google.com; s=arc-20160816; b=VN0wOM3OHnkfVw8J3nSxTm2zR8ezUTDtLOmDZWuiDy4b+oHgeA/BWar/3Bqc0CVJI1 9yxYExUSFLi7umqILtX4CZB/6gGOgMxa+tzB5gIwRz8HqhAlIgB5KBse2rG3mUehk17S ohKFvVsvp4t9kp25PoKlPWkrxTMM/NrZp5f/a0/i04evRYsLCK+J8oggHwNlZhXOrxZ7 dPuCONPJ5HrwMKFLQb6w8XUoi9P0jKTk+QRP9pP6u1QOOJh9VQM+ILCwSv/2FkNqKcxp P8V6Otx2gMcJoKqdgwSHZAhbbj8tTjOp1wlMf1s2cQVVBpFyvtya9xTkjAmWfqgf1ZuL JJTw== 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=1utPE3KHBlzPEKHDj48WXFp37W4FRkW2rxWTSabUz3Q=; b=jBO6ihW4eOnNwCeedhmEyDXcz0ZdP3HAWKIxP/EGdrlkjlFRzHs9tiNNhz8zj5gB48 7Ao+fF7b1mL3mOVcTQdopo4Wh6dkyo8FWGukFY1VoPJHSw87fwfb0xv1ARoDCiF+4U63 m2H+m0AXMGcmcNxmgzrtLj+hJ5YT8zSdEDMTEutN4vjVVNpOt0tJbypeYUoyNUjn47dE FjsuNkCGGG/8FxTgfzdoxXN3jha489AlCdmHmlNyDZwbRQN6DpumEXWeomLqnbI08Dms +e7KX+YfmRrwg8CreOZLj6SWwZdwssOB5zACNsXGxKU9D4HZR6wzyYop0vNDFWh/h9lb mgSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=q0rkWCh8; dkim=pass header.i=@linaro.org header.s=google header.b=TvKXGwb3; spf=pass (google.com: domain of libc-alpha-return-98823-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98823-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 33si36269032plg.62.2018.12.27.17.10.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 17:10:52 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-98823-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=q0rkWCh8; dkim=pass header.i=@linaro.org header.s=google header.b=TvKXGwb3; spf=pass (google.com: domain of libc-alpha-return-98823-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98823-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=DRFZCN3mXsg6c9n1aodorbXkiaZ6eBr aHO2AYpNSStQZo6z+/m5fgx6ggUmgFJpQjNGK149bJsgP/soDkoOFgDPaeHanldf HgjIUmnUSzTxkx5Rp3LA094Kx8R8dlc1HiFOZmDw6z2JXAzKO6viyDB6E4+zhumV v9B7xRgt3XOo= 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=rfQxPUMQJ1Iz1Bk5WOMcEae+MEc=; b=q0rkW Ch8sc61LkLlwC6bjywziQgRdqJZlasp43voDpTLVhtmJ+h21cFGwHfJF81hPGbn4 dkMLHJJND2kfsJJ1y3jwoO5/suKeDVhgoC0UIik6kDdpkAR9DHoFeIGwMjbwokmK auAXv9SlbClmHOdt+MsKqSiEcijQLQ/JR3KO3s= Received: (qmail 49734 invoked by alias); 28 Dec 2018 01:10: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 49628 invoked by uid 89); 28 Dec 2018 01:10:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=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=queue, Signal, Ring, Never 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:subject:date:message-id:in-reply-to:references; bh=1utPE3KHBlzPEKHDj48WXFp37W4FRkW2rxWTSabUz3Q=; b=TvKXGwb3RnPEnAX0MosXuFLZYdyhvdiT28AnKoMC1QQxQULfUCYb75k6Z9YjGBz/Hj uvkRhzQVS2pg9y8d1TwXFifg2TeJWxU5dzGLF2EMj7xJrQ3IQ4ZpX+yzRgqs6Ek8dukQ BpIIuWR1Of70w8X5W6m1NIYDjCc07s0TfpiK4= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 04/12] termios: Consolidate Input Modes definitions. Date: Thu, 27 Dec 2018 23:09:53 -0200 Message-Id: <20181228011001.22260-5-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 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 4ef1e03b14..242eef13eb 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/sem-pad.h bits/shmlba.h bits/shm-pad.h \ - bits/termios-struct.h bits/termios-c_cc.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 Fri Dec 28 01:09: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: 154589 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7509850ljp; Thu, 27 Dec 2018 17:11:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN5N/cri2HbFuaaboL2VLJAxtn9N/W4RgY9EOWyj5o4OgS37Ou82NfvpooobX3MVWB4ec6cc X-Received: by 2002:a62:c711:: with SMTP id w17mr26413315pfg.50.1545959474801; Thu, 27 Dec 2018 17:11:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545959474; cv=none; d=google.com; s=arc-20160816; b=fArWm5nNzqGkBi+QvYWoB1AE7dDUqrgY6KrQJcQl4b3JPlBOI8PJhh8o2vqR52WRy/ iGvCRCnFYe1XQp1a35yiOR1AxRoDy2qVsRwoXK4MT3tdyMX4uMON0PQjLfJjCFkGXKcp MTGPyorCwzYMuLRom41rWr4cbYlO8RnP6tonjRVOK1TVHXOfnKvaRE8qyYvWpAoyMWgh DiZ2AjQ/SoUWS/+TMU8LDwtoK11hTBJh64t/Q7kLtw86hwJHl1T/mnpMdzN/amojJhxQ lVDmQYQSWnBtryEmjgpqYL9WVkmFDY5ZOwhrgIDfSLX6ia9ZMKruntHsJV6hNT4utDrg DHIQ== 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=Xwvh/mGJmyq4vS+kkDYTBfOzzSc2791lQKLhhce4Iio=; b=m55FVgJjXs+3D0zKPW/Zix6VDzvjhAWb9aqIlVApPPfLZlmclPBIqK/IyoYyxzk4ZQ j4XC3eXLBLt9Gg63gDFGaThUN/OX3/L1aTT1ZyCAww0nUE/+n0bG/+69lNNotYXrCGpe JX/bMMeKiSRnWtQoSxxF/7ZWakDv6x2sagTVdYUcZEjc5J+oKcG3T0dt/tC0Q7njRpTk RZ8GG39QDlrLUaB9XU8KxASAuHsgFL6jMmkKHQwn1C5s0CTDktPbNLEQYl4zQlvBcroR msh7D7wCJ/ndY0zUK7rXgT9cpAcWsLsdSeOUERtOANkElnutyKuEpTr6PA2OoP/ZYGMN W4UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=dH5941ON; dkim=pass header.i=@linaro.org header.s=google header.b=FVOtLjdN; spf=pass (google.com: domain of libc-alpha-return-98825-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98825-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 q66si36348226pfb.231.2018.12.27.17.11.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 17:11:14 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-98825-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=dH5941ON; dkim=pass header.i=@linaro.org header.s=google header.b=FVOtLjdN; spf=pass (google.com: domain of libc-alpha-return-98825-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98825-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=D6B+IUXyYZPQk0cLf/sMpy96z+h/J5J DV3HG/LqpmJnSJpo+U0lRy/1xwXlRKPGQ7SAkdcDypsgGL5Jf663UuCTQtreZ2wj VKrKxIfZQURbaG7hOs2QLiQTFZz6G705gwQBF7wH4sAhBt1yauXSHBCg3B+iSpdZ dM5QErinMUYI= 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=pK0QKu2Hs9+tatVZPdwOWdzWK8Q=; b=dH594 1ONREHRC3uVCUQGss/WJs+yYWz6EmLEFRDqBN14pxbYjDF7150fM7C2qxfY0n1Ku fFXvmgdA10CSRRlu/ARmmXXj5atXHqzjBUD4ZRnTY71fZpDv/t1d6Wr6+/DlPW2M dn9ms0Mhkt6nTVzKJDKDEot3UU01OWkzJbwqzM= Received: (qmail 50318 invoked by alias); 28 Dec 2018 01:10: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 50196 invoked by uid 89); 28 Dec 2018 01:10:25 -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, RCVD_IN_DNSWL_NONE, SPF_PASS, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=DEL, tabs, delays, cr0 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:subject:date:message-id:in-reply-to:references; bh=Xwvh/mGJmyq4vS+kkDYTBfOzzSc2791lQKLhhce4Iio=; b=FVOtLjdNY5SQOY7NkEjCQFHBW6Q2SHXk/KHMMHbPVgIc1fIC3iy4dD0JGeY8CnTS6Q TtJdj5n2ndqJZaeIqfgCiHW0DG7qQBhHV5IBQ3UfEQ3D+EBgNzl/nI0BqqezKOeqzNUu /0/N6QxaIlfDVN2fc2uWL6yi0Y4EiZ2zB9hz8= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 05/12] termios: Consolidate Output Modes definitions Date: Thu, 27 Dec 2018 23:09:54 -0200 Message-Id: <20181228011001.22260-6-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 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 242eef13eb..686b3e236b 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/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_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 Fri Dec 28 01:09: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: 154590 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7509980ljp; Thu, 27 Dec 2018 17:11:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN6vbzbjzqbRVNjBcRPDfTyTfLg4G4BOUFAHpcxVzdiOuOGf9nNYgL8O9Uye3N9PSaBrrEpU X-Received: by 2002:a17:902:2006:: with SMTP id n6mr26022716pla.66.1545959485624; Thu, 27 Dec 2018 17:11:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545959485; cv=none; d=google.com; s=arc-20160816; b=0LvXNAtLKJG8+o9XJHXPprtgY9j1w7mmu3/xg0odHy94wXAF1qSC4dUpWEH35vu8+V 71nVfihxpDtsH+P6EkvB0LbKGtvu5ElQk6Ey3P1hVmWmeqJtZJNQO4SuwBPhgxvbs1od h+upjTagtsvWghf5ZpgI0ECyEjoZ6HRw7OPUeJI8QG9zZZmVyS8yU2i4jQ4Ya8l+sOwQ uD+fM2mx+0Cy6+lzJXNcqayM7Ngi7XeVLAqTDfm5bA89M79jcnn6KEvKZ8l/vCK7Bu4G w4dWdi9J6e8RtCcmjeZbccUUSPeYkmc1EeBrOXyN50CBV9/f5aFpDZIbgA1BPWpXhrIU QKmg== 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=6UEYLzShk12n4d4ZGG4QmdS4djA+GgnuBJ8v+SiB8m4=; b=rUrqWJgrUhrdfmod4l6i3IxP+eN69MTOMa7mgPpu2eJtU6A4nm2ae6otD8BOr3gQGh YnBnaCUkq8+B3Jfg044SO4prR8B45kO+TYtZfsT8SNc3OwzhlFtr6zwvn6I3aDe3ti5k Va7WX3BNv7RIkkXsKSzdN2laZDxYKymvuPlygPy7poEIwdpiI8oEFetKHjL61s8uZOoZ d/rfZEAK1bhbj/yaJibjIXKIxWoh2G2bB25+pwMX9xhE6tUFko7F0ae7uFR/Q75jDee9 mpscndDBtF8BzT8Q1WzZcoqOpdLEoVO/qV9lD/TUKjs8QrSRgha9z8X1CIup2dUr69U6 8wuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=czRrpaLO; dkim=pass header.i=@linaro.org header.s=google header.b=gapiWyXH; spf=pass (google.com: domain of libc-alpha-return-98826-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98826-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 cb1si25795533plb.37.2018.12.27.17.11.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 17:11:25 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-98826-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=czRrpaLO; dkim=pass header.i=@linaro.org header.s=google header.b=gapiWyXH; spf=pass (google.com: domain of libc-alpha-return-98826-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98826-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=lwK+2Rnl1mgDasf0ZS3+yGaZNScF/GX CtI56VxsUvJe3htbtApIMlm2jVcUNuFShnL1ulIw377Z/OFvPHTGZBuCg5SC91Ow lkx3y8lk4DB27kJwqHm23Bh8FJ+xh2T3rnTB7MfA8P4e9GJyLOzDHAkNOL7AXx9t z65Pgm/eTYyw= 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=T9UWTpxUwFcQQ8j5xwJ/KhHnnE0=; b=czRrp aLOVC1ZGGwNFvnlsJTCP8CFa4OUuPF0bcttcx0xm0i9UOXRZPAauKvpSnjr7Vlfo JOb36k1tQjaTsyHSkd9ceWv8Qi8WtlTQMV1pwjcobu85Gtg0K8svDjazNwLpyCBs FiDh+aTr9Fnszev/CSyPlNKo4wD83Wy6LPVnFM= Received: (qmail 50436 invoked by alias); 28 Dec 2018 01:10: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 50310 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=Hang, stick, rates, Extra 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:subject:date:message-id:in-reply-to:references; bh=6UEYLzShk12n4d4ZGG4QmdS4djA+GgnuBJ8v+SiB8m4=; b=gapiWyXHRBQoAPUh6WJ9D5A36FBi/g+S45JSFBglbpYXhK2VKhIVPLEnWg7y8VcrUK fFkpsnXu2XbUETaPO9P+IudyoP30ADeD3D3caxraFEjuQoEa5syPbCfRI9+/xCFeMwSl i/9LqV4SSyPYk36GA9cjc/vGWXagAAczGkDbg= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 06/12] termios: Consolidate Baud Rate Selection definitions Date: Thu, 27 Dec 2018 23:09:55 -0200 Message-Id: <20181228011001.22260-7-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 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. [BZ #23783] * 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 686b3e236b..e1ddbf9787 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/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-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 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 From patchwork Fri Dec 28 01:09:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 154595 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7510443ljp; Thu, 27 Dec 2018 17:12:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN607h18q1+5+XNzIyaWmzyGFC95hhejj2nB4n9sK1Ntgsrg+bWDUrUdRDluXwZStHT2eVRT X-Received: by 2002:a17:902:f20b:: with SMTP id gn11mr24696273plb.274.1545959531556; Thu, 27 Dec 2018 17:12:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545959531; cv=none; d=google.com; s=arc-20160816; b=e3wfAeLPx3QhKKLvB7iMl5aYtyvboe/YKhgwAh0BCwplC5NDve+QVXTp1CvaPk7QED y4gZoBRVKUsBi4j9oNJGmU53guu4suk7BF7p3EJj/OJbrrEKMXoWeGOTZyD0kO3pK8Sy z5g6XihlJod0el9UeIrnFjiBSAFVptoN44Oppqs1H+268l++GT2sfMF9+TJfSpxve3uS bI28vUDQfUGOp9iOwO8L4/Jls4HrLlDQgc0Crrjb4z3/L49BQw52GZh2xIwseEWDv9+Y C2M0VVmvh9Qq9ej5QcaszNUbx/RyKtND38lqeIRy+2sDmCA+JUy2ZggFv1PcemM0yT15 NKig== 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=977SOJkSuNr2grM2NdW7anq4QZIHQUCt4tPUtHMGtG0=; b=VD+79fRbWyqglOSIOa1SLcPzd4yCVjBmL5jRTFUApfowGWTxfrCesqBdOwySXnxCSX q9Q1c61f/dZ2iZWMwG6UXb5qHvkvAB1tcvLRTY6RuU4fMinvwortBYEQDMnnUVZGTTuV z2bSJecLc/hpGhG469/IKQZORzid4ib7dwBWiPv/8eclhLKnrSSysksCU0I6M/5vmBLd fAbRVz5sIpTgAj/hrjNagG2bCPxpuzT3olcUsxSQOpJsFUeTuUYiWV6J3b7HUclw4XMl h7JnZMl301sfY8AxKxecm+Bvff4mbExkc7ZW3PSvLxGFE6VKi+1fZWKIEQgSkPG/RxmP 1RuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=JS79AOjw; dkim=pass header.i=@linaro.org header.s=google header.b=TfI6YuoB; spf=pass (google.com: domain of libc-alpha-return-98831-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98831-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 p64si33127332pfg.79.2018.12.27.17.12.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 17:12:11 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-98831-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=JS79AOjw; dkim=pass header.i=@linaro.org header.s=google header.b=TfI6YuoB; spf=pass (google.com: domain of libc-alpha-return-98831-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98831-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=bQQ+dzd8h7PPk8ta9AaUVejphwajXnf 5Kfl38WA+PFkFBfe6l1AEbd787DMop4r0Fo0MhtvV/iEMULCsq5GpeYpNzbvAqUs s9WN9V0boDLSSRRqhrx/Fh4V0WfWRi5nuUp9/FPnBL+SaXF5+w89Ef3j7e6YuTku AQQYrKCTzBbU= 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=FnuUJv0tHQ9NS54dWUjpwqEKALk=; b=JS79A OjweWPgcAMQunHPc3LO4BsH1NerFi6bCJz8Gph8nzYo+b1N28XdrZdcU2j1xwEx7 La5ax/ELuLDYtBAhzlFCVCY5V5Bj0lu4FGQGCuIZjhYCZQVt8Eukqg4cQytIFMiN SKyFaVC3/rE2wflhnlnor+DIGZnIijObvJyGlQ= Received: (qmail 51491 invoked by alias); 28 Dec 2018 01:10:35 -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 50943 invoked by uid 89); 28 Dec 2018 01:10:30 -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=terminal, visual, kill 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:subject:date:message-id:in-reply-to:references; bh=977SOJkSuNr2grM2NdW7anq4QZIHQUCt4tPUtHMGtG0=; b=TfI6YuoBv3akVF7QzcWd9Yx6Do8OUji9DRJrCK1ATMs6oSBnAodORLpKmWA1kHzRZG vpMA7nqt8Vo5ZbRLzte+uYWJXtASSrWK5hINAPmrt5lR7ycnkWZJPBp6luWrxNVUtSaM WY4w97BkTkVU0yS3xq5NKUROsdyfc1JFUIst0= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 08/12] termios: Consolidate local mode definitions Date: Thu, 27 Dec 2018 23:09:57 -0200 Message-Id: <20181228011001.22260-9-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 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 9186e3af96..bd17a574ba 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/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-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 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 From patchwork Fri Dec 28 01:09:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 154593 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7510250ljp; Thu, 27 Dec 2018 17:11:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN6oJ5q+VCN920NRGWphzzDYCfrlpWVYKAx4jWEid5b8MAy9WCJYCFv1nFoA9SK4JLbPqiqb X-Received: by 2002:a63:7c6:: with SMTP id 189mr25058458pgh.129.1545959514010; Thu, 27 Dec 2018 17:11:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545959514; cv=none; d=google.com; s=arc-20160816; b=eRzfHeTRKckjTquA2vXFzaqgbbBO4SWM9LScFywURbTgkyld5FpxBbTRqDCdKpTYq2 +LP+rU5sTr9+TRSMTAcAfvwF19D9Bzz7sCA88oCjjXbAseFXgGH32Uj+vm8e4vgW6T3h yZkf8XNN7hzBYBxRqDUR/+JQA/xUngk8SW6RJV3PeLhv99weiwEMozsAFKM0Wn2HfLyn r12V/LnV8QiXdHI6K4QLJGn7KRw3Zs+LCjF07fsDAGGWMekr1uaeUBD3E30x/crTPHD1 e0BVVG/GPAkb+Ha4QpRQ6bYRKzdiiCuySSS0NcfnOgZg41CpVuZZq+xB8ixsoRorDN9e yz4g== 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=474zF06ub3bDdUWJbtQ0L/+1Ke+/RGGt4QxsI2Fy7AY=; b=igoinbG6I0qO2+GZoUgSil9y1KHKJmHmi9CxMXdKx90/ATwWrNCb/qg0fXCzPg+5xY xQVFo/6+cQm7+P/tYqO8llUyo9mj60mjvTmv9qFVohTDPEU9lGKJELnwEEXExu7ytK0R xrIEaV2q676ozSnyLqb3KwEMSPLFewWFbB2gJK+/jY7TiB3nntQ3bOjMyR/5sqYCcoQ5 Qruo5bAyIMyEB85jma0IGnhKatzwhg3oFW8p6V6BdOIeZxjU93aW+rdhhMSfqdmP2BCL jSCtH//M2IWgEJD53Xql8zBTdNbJ24m46+QCFo5AC/VurZEl90+A/ooNgC1uXVxbqcK/ hH0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=Z+kzHwNO; dkim=pass header.i=@linaro.org header.s=google header.b=fN4C9nII; spf=pass (google.com: domain of libc-alpha-return-98829-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98829-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 bc7si5761676plb.120.2018.12.27.17.11.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 17:11:54 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-98829-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=Z+kzHwNO; dkim=pass header.i=@linaro.org header.s=google header.b=fN4C9nII; spf=pass (google.com: domain of libc-alpha-return-98829-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98829-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=Jh4wmTFIKspaHea9h/h43dOIS+6BOmO XYz20k/2M8u04lRx5v+RaaSrLAKF+ngwDvMWrXIJoPrxVmXETxC3JYb8MZmzkrXH tUDwrDD5hWVcVBtuDMQEZyqc9SOUpVxkvBYF6jgNdIJfu4XKgHPzA/rT9yR0Y+xE gmc+0Xf9ENXQ= 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=S0cJLH9xJ/7jNb7/Zaug9qjd7SU=; b=Z+kzH wNOL/fEGuaL0has1LbbNy9u+zv0+Qad1QU6fqT9/r1PI5w5v2slHzC9UD4Pjun+m GU5pVECW52J0nGSFG/MXKDwKrymVWy486Msl8T1tahlefuEgKb6cy4LUXCGddOd7 8teSZzjOT5Ks8hU5jkybDFNdN0VEBWDFov638w= Received: (qmail 51297 invoked by alias); 28 Dec 2018 01:10:33 -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 50694 invoked by uid 89); 28 Dec 2018 01:10:28 -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, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2009 X-HELO: mail-qk1-f172.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=474zF06ub3bDdUWJbtQ0L/+1Ke+/RGGt4QxsI2Fy7AY=; b=fN4C9nIIu8GfqOlsJB8I7l6HSfU6UAgL9GrHQt4OqrTsyg2621L1cAPGOb24XcLvbR goYFFHPVd17Wf58cSc5S31+oyK9XwH2GdXhu0/Urp+c1rIUNPYnqTs/WJszlCluKguqa 3xDKYfxlJO8flejOpk8sz8ekmM7bLx7+7MpbQ= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 10/12] termios: Remove Linux _IOT_termios Date: Thu, 27 Dec 2018 23:09:59 -0200 Message-Id: <20181228011001.22260-11-adhemerval.zanella@linaro.org> In-Reply-To: <20181228011001.22260-1-adhemerval.zanella@linaro.org> References: <20181228011001.22260-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 Fri Dec 28 01:10:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 154594 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7510322ljp; Thu, 27 Dec 2018 17:12:02 -0800 (PST) X-Google-Smtp-Source: ALg8bN4J/csdH1c4uE0dS3zF5iSaHjFFRwtjyIVbCsKS9myB3wsfIu/ho5qIAtIRBWpiZtkQGY+0 X-Received: by 2002:a17:902:24d:: with SMTP id 71mr24949337plc.225.1545959522476; Thu, 27 Dec 2018 17:12:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545959522; cv=none; d=google.com; s=arc-20160816; b=vu+EKLZ734/MWrAB0pjDd7oLVGz2zyqmrvoet4pRWYYXJ2icvr13IeronI4jxKUixJ Tho8/0EE+2JsxPiDGfUqkty+wgJz4vKT33d56uUKnHP8GQUL82yygpU8XbB18xQp1tYP stB4ajKpwrwAaPl5Wc1KIFDQDN6ZTGoeSQDgO5ldK7xiO7+AJfjmOs2nwDc1nhg7u7Mc WGXRvCC49b8L+3gZ1hE9r0jRlljXnOk5AHr5IjQFJN3LP/iGu2+gDSlI1jr+65hzOBQV 3V73E8QTXZ8cX7Bdo5OB0TPNRL9wlqwVYzjdemqAUwvBGRFuFWScNycl4+vW59YvDM4+ PMUg== 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=DACdLqZoqNeefqkLkB1HflqBbHm23apiGQa3wAqT74I=; b=c3xoaMWzi10nm0iLMVhrS09gcoBNSAwqX9ZOt2lCddOwNO4g7S3+Og0T8/690LeUU2 hFAW81m90HkTLd+Fz/ElF5qnZr2TPtdTxbp4lXWmQgn3xsf8qE5WxPmkOV2DolZ7U+kW f4UiStPbw1AjUsxGYQxiYS1BbIfOEtrAbcLNjLnjHAQNGA4xL2hBNMmfT7b0lTeh43wD hPmBlqcHNahlJiPsGxz1xboo8gJMSNIUNCWhJfrffzOpgMGdzMREBHaK8GTrbM7RkgDf NjuyVqVSzC1ykoE+yZECehZOrB3/+DxkdXiqSokHvIh+KxeGqtdYMf9mPtho2kFna5cR niSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=VKF2p6Yp; dkim=pass header.i=@linaro.org header.s=google header.b=QU6iZRz+; spf=pass (google.com: domain of libc-alpha-return-98830-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98830-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 z14si19375178pgj.73.2018.12.27.17.12.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 17:12:02 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-98830-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=VKF2p6Yp; dkim=pass header.i=@linaro.org header.s=google header.b=QU6iZRz+; spf=pass (google.com: domain of libc-alpha-return-98830-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98830-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=Potx75jk3LXmDjWYDGXTp2SNZwSZqpF 3V5aYZvsFCskgizjSqczkubl2ACK9PtKuSqqtL4OY2NVUWhqHn7oHprkcVI15TMC 1rz//XCnx73IJupKcqZTigaW8/cUHyNO4SIypMSCtw/iF7nnezVcP2dRTDSzeVn2 WN0aWneCj4x4= 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=opgoxuAV7y6dAUR3RyzMANw4kGw=; b=VKF2p 6YpsN0fYS9PYegYGp4WD83T9Wh0dtsPofEH8IyiSYXIJkODB9G8WXXiCQNGYuA+k qf183hiCA/5UdD5AWbtITkiwGCWekx5sX6EsqUYslYGht8wmzqlotHrarhEpgRQu ASpHuohg4i4VyV0/MyR3tu6mJ6+52/8bsfkp78= Received: (qmail 51382 invoked by alias); 28 Dec 2018 01:10:34 -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 50884 invoked by uid 89); 28 Dec 2018 01:10:30 -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=terminal 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:subject:date:message-id:in-reply-to:references; bh=DACdLqZoqNeefqkLkB1HflqBbHm23apiGQa3wAqT74I=; b=QU6iZRz+5GRgWnqM9Zdlr663vhxqEnEKdMg2vpgx3Rez8bSlhLi+XicZofwKviW5yi L3aPdsXqhTaBZZgSQ5uWJ/xZn2bbBuf2PKkTMxEKn0CgCFo05+d/UK/nSoF0PVmlJwBh 2uclciqYXmEn7mpWwKDm1P2triDkG3jvHhtQI= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 11/12] termios: Add powerpc termios-misc Date: Thu, 27 Dec 2018 23:10:00 -0200 Message-Id: <20181228011001.22260-12-adhemerval.zanella@linaro.org> In-Reply-To: <20181228011001.22260-1-adhemerval.zanella@linaro.org> References: <20181228011001.22260-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 Fri Dec 28 01:10:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 154596 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp7510566ljp; Thu, 27 Dec 2018 17:12:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/X9eI9LSJI6+h3qEJ6A4lQ/mv0NHNeopAG/wzFUrJJjZgQy/uM06jlmMIytDLgnEN6bU0AH X-Received: by 2002:a62:2a4b:: with SMTP id q72mr25873616pfq.61.1545959543909; Thu, 27 Dec 2018 17:12:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545959543; cv=none; d=google.com; s=arc-20160816; b=NeJF8VA4E0jEI6cRxypktTX0aOwldCGYHyxOfIaKwZB8HR2WvD10fXq48Ondo7KypA JN4mgUwy96EYhMGKNqGV1wYoB2CcWNoVk3eR/LrwV8F/yW/yWBYJ/SEVU3WOfOe2UnVJ v3LlU/mO++fAi84rqaxngM73YXnTEyMQr0fNilqUlMXMBsGpIEvJyTGtzsW4AmAAWaUC y+yqruk3o3uLNvWzRipxuHeT29bqOdeGmCjqlhsudirW2Is44W+1soLE2PUnOiMT35hJ yDXoiHQzI4W7rf5KHge5SBN8RmuMG2lSzFB0qNPXgwAmHEw9gORCOJHmiovhfdcUeC0a SfrQ== 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=Hb9pzEPaRaL2co10r5OMtXhqkT9IxiqZ11p9Lq3+9EQ=; b=Ias3yqGTKHxLMModlYJGf2LlD9xhmducbMoRhFHExoxjIiQ6Qkwqlhh9zKa8Ik1p8d lm5q3chvqF+R1fXfhwkmB4CMOoKLwCp0HDi66z8QXL95CinrbfAXqNZyjh9ValEXwAmU cyEFcro5hjcNk6UQe+C84jetRO/i+62u0mFIfWk6egseeUyTo0835SbmpuUSPGfSW5OC dhKGHszxgMwynly/xVtPOr6vQT2KnILo4RqWKmkFtF2gEvTqBVZMmTEO8j8EfbRnOI/g BAsVrYAdp8WXSpdILHtC7Oqz4Y3fWTEZiZNPFOoDHc/HwaFdrVXPSBoUiSa6hIzkDfYm 0ALw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b="aHdxE/wC"; dkim=pass header.i=@linaro.org header.s=google header.b=UVw0A01x; spf=pass (google.com: domain of libc-alpha-return-98832-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98832-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 m30si39429759pff.158.2018.12.27.17.12.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Dec 2018 17:12:23 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-98832-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="aHdxE/wC"; dkim=pass header.i=@linaro.org header.s=google header.b=UVw0A01x; spf=pass (google.com: domain of libc-alpha-return-98832-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-98832-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=MrujfcAsfSPcYZljURyMg97m4vlVgIw h+JXp3SewFOhJqueF7ESlPi5VMlJ+vmEA30spb9oRR/rxFmhvpKRWitCT6lflgKB 2Muz3ijbnG2txBFvHXcIb/Wt4Mf/o58lBN7x7LgJwZPAh+fyEIt4TGPh5MLiuwUC 17yQqFkTNJ/c= 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=xPMoKTxMVQSOLj94LmMD/IX3JkY=; b=aHdxE /wC/m/qomUhj+dqi3SETJmTMMB/LFiHTPmllJjshnZRFK6wGxgyfBsIj9piU2i6c Gy0xkq/8wAoSVZHIDN/TWjXFrxh3Ti+kFyMs7WMXwlfIftlKCrLyeT0LGh4wP6mg Jcm36j4waLV8ox2y+rvrQE7/3YAjxq18jyAvTM= Received: (qmail 52390 invoked by alias); 28 Dec 2018 01:10:42 -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 51411 invoked by uid 89); 28 Dec 2018 01:10:34 -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= 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=Hb9pzEPaRaL2co10r5OMtXhqkT9IxiqZ11p9Lq3+9EQ=; b=UVw0A01x6pRceYRHoYlROn3DMhHkD6diJo5fO8QZ3n1SonfNteyh8ayr66qWZngUP7 eXuueWTI1DQDL3MNo0f6g6DbbEtgOrICMRNIcIHErbilGqOKwPou21Ifn4epGSx9f1y1 78wrjTQuIyNQPXoOuw/eSqsLeXTzYa99xcvgc= Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 12/12] termios: Consolidate termios.h Date: Thu, 27 Dec 2018 23:10:01 -0200 Message-Id: <20181228011001.22260-13-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 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 feddcab688..5f8c2c7c7d 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -47,7 +47,8 @@ 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-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