From patchwork Thu May 16 15:12:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 164334 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp968470ili; Thu, 16 May 2019 08:13:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7csVGgLoeUkouqH8W+MSkFKicS42zP0uPbxt5d+1EusSuWVKUxG/Tpmi4BD+Nh8ytSMLt X-Received: by 2002:a17:902:e9:: with SMTP id a96mr24462688pla.37.1558019619320; Thu, 16 May 2019 08:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558019619; cv=none; d=google.com; s=arc-20160816; b=r7IEuMQ0xuc4bIF8oQ2LOhnqCcoYci5fRt8Q2OecHPZ9LSON33YIgXqQDQPER4bDyt 7+LWwdAp4xmW6WYoEPP2gQKTPAYCl2DZ8wuASTb4XLSGFh2+oUpHQbBB5t4fkpjBnSU6 Al247Y0M9OQz3Wz6Y1oAZ4/1FQ4KNSiP/rS4UBg+kyB8nrf3z2FEbk8qhmAo/VRDOrDl l72CCNVxT2zZFHrYVF5Uyx6syk3+cMgYZ0ZdXXFAFpRC0yd2ZvhHe23R+0oDWTcydISb L8o1gzYZ6G/9MQDbPNIlRuwqu9ysbZSzQO3J4WFVUbytYkxzLyCODusvGvTuiE22husJ bxrg== 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=ra53v1IX9G6cb5PfZPPz+Kta6kk4lUC9yrm2VtC+PSI=; b=Wreiud1gMwvjKc+luikKEgDK6OaN30AjFVo/W+oJAWRMEO6xayBwO925Bo+yQv9r9j LWIW9zkEh7sDh9T3ywFST+Yzyn+o8/vhsEK+StSFt9QbIkFbb2Bo9TEBVISveejXexAB ut9LXMiEpyI06mVv4Gtu7r4FvqK7XiBUCYA30MOPAuf6MFxcn6XmmX81XScjVb8iiNfj v97oT9Z3cx+IspVosL1kKsnBQsrIHqte5hwx5mqkvGoutUfxaq4NEN8U/DgZVEam56QG FOOOT49vShUJILdm5AIzErpXFSM7w2dhGNz5C7rebPKp1L7ckgjMO8ujK19XAzuJ1EQz JbTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=MGyQyKB6; dkim=pass header.i=@linaro.org header.s=google header.b=Lh0Wpi4n; spf=pass (google.com: domain of libc-alpha-return-102030-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102030-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 x28si5667668pff.104.2019.05.16.08.13.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 May 2019 08:13:39 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-102030-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=MGyQyKB6; dkim=pass header.i=@linaro.org header.s=google header.b=Lh0Wpi4n; spf=pass (google.com: domain of libc-alpha-return-102030-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102030-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=q5/G/XaDFcvC8UR2j7wfiSDRypVzRnC p60lRsFSbyccACf6h6T2tHyV0L5l0buCmLcZFCrxYVBv9P2biRQkYdK7NoRZPH+g 8dXlnOBpf2BQo4m0sBaMz2Dv6sif394bSQ2FrfeqbSiCgQGsPNrQ5XuvHXhfVoNb pFyZJFHVrW+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=HSMFo3IW5LNzvJkVY2YAcc/YTB8=; b=MGyQy KB6h5nHKkkwfnp62qe7QagzIvqGVosPzAiaoL7NnuRYWAHKxcBOXvFVIubEKgnCG BsxQVSwi+l1zQtIxqGsm3ABzKlleyq5M1ABGsJAGn9lQ9O0B9G4x53vWVQudlH2w i2DKczaiF7GsCubHvkCbUI5jzW6CJy37wATvvs= Received: (qmail 112221 invoked by alias); 16 May 2019 15:13:06 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 112163 invoked by uid 89); 16 May 2019 15:13:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=gid X-HELO: mail-vs1-f67.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=ra53v1IX9G6cb5PfZPPz+Kta6kk4lUC9yrm2VtC+PSI=; b=Lh0Wpi4nfgZ899POyH0nip3YElcfrW3UEssaLT3arz1CKSYlQwlvJYEYkAz8xsrvbW NCY1pTB6h8/b6BwTleapInoaY7Z7eWAwm8SQG8ed2G2yq5pyMwev6lWBjw3Sr/4cE2Pf Ok0oW+xW8yCEWa8YjpEidmQ2L4Djg7cW71ATfNflgwEphGSHh3BAH4ksmnQaa/aCF1NE XTxkYQUBV0wMSs6+AfdLcAgzmM9gaZ/IPr0yTEqU5Y8rH9c4TvK7tSIxspw3vCXOnMqL DPpZoUKq7/qGCg7QyoQui5kdhDej3LzGaFnxgLAGND7AgGh6AN8pKp1KxrAcmysaeWW4 gEhQ== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 4/5] ipc: Refactor sysvipc compat type Date: Thu, 16 May 2019 12:12:48 -0300 Message-Id: <20190516151249.19029-4-adhemerval.zanella@linaro.org> In-Reply-To: <20190516151249.19029-1-adhemerval.zanella@linaro.org> References: <20190516151249.19029-1-adhemerval.zanella@linaro.org> This patch removes some duplicated definition from sysvipc compat code. The idea is to make it simple to enable the new wireup sysvipc on Linux v5.1 for some 32 bits ABIs. There is no semantic change expected on any port. Checked with a build against all affected ABIs. * sysdeps/unix/sysv/linux/ipc_priv.h (__OLD_IPC_ID_TYPE, __OLD_IPC_MODE_TYPE, __OLD_IPC_SEQ_TYPE): Define. (__old_ipc_perm): Use the new defines. * sysdeps/unix/sysv/linux/alpha/ipc_priv.h (__OLD_IPC_ID_TYPE, __OLD_IPC_MODE_TYPE, __OLD_IPC_SEQ_TYPE): Define. (__old_ipc_perm): Remove definition. * sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h (__OLD_IPC_ID_TYPE, __OLD_IPC_MODE_TYPE, __OLD_IPC_SEQ_TYPE): Define. (__old_ipc_perm): Remove definition. * sysdeps/unix/sysv/linux/powerpc/ipc_priv.h (__OLD_IPC_ID_TYPE, __OLD_IPC_MODE_TYPE, __OLD_IPC_SEQ_TYPE): Define. (__old_ipc_perm, SEMCTL_ARG_ADDRESS, MSGRCV_ARGS): Remove definitions. * sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h (__OLD_IPC_ID_TYPE, __OLD_IPC_MODE_TYPE, __OLD_IPC_SEQ_TYPE): Define. (__old_ipc_perm): Remove definition. * sysdeps/unix/sysv/linux/x86_64/ipc_priv.h: Remove file. --- sysdeps/unix/sysv/linux/alpha/ipc_priv.h | 16 +++------- sysdeps/unix/sysv/linux/ipc_priv.h | 27 +++++++++++++---- .../unix/sysv/linux/mips/mips64/ipc_priv.h | 16 +++------- sysdeps/unix/sysv/linux/powerpc/ipc_priv.h | 23 +++----------- .../unix/sysv/linux/sparc/sparc64/ipc_priv.h | 18 ++++------- sysdeps/unix/sysv/linux/x86_64/ipc_priv.h | 30 ------------------- 6 files changed, 39 insertions(+), 91 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/x86_64/ipc_priv.h -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/alpha/ipc_priv.h b/sysdeps/unix/sysv/linux/alpha/ipc_priv.h index 8b91e2f9fa..fa79bddcf3 100644 --- a/sysdeps/unix/sysv/linux/alpha/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/alpha/ipc_priv.h @@ -16,15 +16,7 @@ License along with the GNU C Library; if not, see . */ -#include /* For __key_t */ - -struct __old_ipc_perm -{ - __key_t __key; /* Key. */ - unsigned int uid; /* Owner's user ID. */ - unsigned int gid; /* Owner's group ID. */ - unsigned int cuid; /* Creator's user ID. */ - unsigned int cgid; /* Creator's group ID. */ - unsigned int mode; /* Read/write permission. */ - unsigned short int __seq; /* Sequence number. */ -}; +#define __OLD_IPC_ID_TYPE unsigned int +#define __OLD_IPC_MODE_TYPE unsigned int +#define __OLD_IPC_SEQ_TYPE unsigned short int +#include diff --git a/sysdeps/unix/sysv/linux/ipc_priv.h b/sysdeps/unix/sysv/linux/ipc_priv.h index 49018c1b28..1f9583d42a 100644 --- a/sysdeps/unix/sysv/linux/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/ipc_priv.h @@ -16,17 +16,30 @@ License along with the GNU C Library; if not, see . */ +#ifndef _IPC_PRIV_H +#define _IPC_PRIV_H + #include /* For __key_t */ +#ifndef __OLD_IPC_ID_TYPE +# define __OLD_IPC_ID_TYPE unsigned short int +#endif +#ifndef __OLD_IPC_MODE_TYPE +# define __OLD_IPC_MODE_TYPE unsigned short int +#endif +#ifndef __OLD_IPC_SEQ_TYPE +# define __OLD_IPC_SEQ_TYPE unsigned short int +#endif + struct __old_ipc_perm { __key_t __key; /* Key. */ - unsigned short int uid; /* Owner's user ID. */ - unsigned short int gid; /* Owner's group ID. */ - unsigned short int cuid; /* Creator's user ID. */ - unsigned short int cgid; /* Creator's group ID. */ - unsigned short int mode; /* Read/write permission. */ - unsigned short int __seq; /* Sequence number. */ + __OLD_IPC_ID_TYPE uid; /* Owner's user ID. */ + __OLD_IPC_ID_TYPE gid; /* Owner's group ID. */ + __OLD_IPC_ID_TYPE cuid; /* Creator's user ID. */ + __OLD_IPC_ID_TYPE cgid; /* Creator's group ID. */ + __OLD_IPC_MODE_TYPE mode; /* Read/write permission. */ + __OLD_IPC_SEQ_TYPE __seq; /* Sequence number. */ }; #define SEMCTL_ARG_ADDRESS(__arg) &__arg.array @@ -38,3 +51,5 @@ struct __old_ipc_perm (__nsops), 0, (__sops), (__timeout) #include + +#endif /* _IPC_PRIV_H */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h b/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h index ab5db79e25..682ec35662 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h @@ -16,15 +16,7 @@ License along with the GNU C Library; if not, see . */ -#include - -struct __old_ipc_perm -{ - __key_t __key; /* Key. */ - int uid; /* Owner's user ID. */ - int gid; /* Owner's group ID. */ - int cuid; /* Creator's user ID. */ - int cgid; /* Creator's group ID. */ - int mode; /* Read/write permission. */ - unsigned short int __seq; /* Sequence number. */ -}; +#define __OLD_IPC_ID_TYPE int +#define __OLD_IPC_MODE_TYPE int +#define __OLD_IPC_SEQ_TYPE unsigned short int +#include diff --git a/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h b/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h index 1c480ac0dd..f641ed9a32 100644 --- a/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h @@ -16,22 +16,7 @@ License along with the GNU C Library; if not, see . */ -#include /* For __key_t */ - -struct __old_ipc_perm -{ - __key_t __key; /* Key. */ - unsigned int uid; /* Owner's user ID. */ - unsigned int gid; /* Owner's group ID. */ - unsigned int cuid; /* Creator's user ID. */ - unsigned int cgid; /* Creator's group ID. */ - unsigned int mode; /* Read/write permission. */ - unsigned short int __seq; /* Sequence number. */ -}; - -#define SEMCTL_ARG_ADDRESS(__arg) &__arg.array - -#define MSGRCV_ARGS(__msgp, __msgtyp) \ - ((long int []){ (long int) __msgp, __msgtyp }) - -#include +#define __OLD_IPC_ID_TYPE unsigned int +#define __OLD_IPC_MODE_TYPE unsigned int +#define __OLD_IPC_SEQ_TYPE unsigned short int +#include diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h b/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h index 685c25439b..3d813fe9e6 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h @@ -16,24 +16,18 @@ License along with the GNU C Library; if not, see . */ -#include /* For __key_t */ - -struct __old_ipc_perm -{ - __key_t __key; /* Key. */ - unsigned int uid; /* Owner's user ID. */ - unsigned int gid; /* Owner's group ID. */ - unsigned int cuid; /* Creator's user ID. */ - unsigned int cgid; /* Creator's group ID. */ - unsigned int mode; /* Read/write permission. */ - unsigned short int __seq; /* Sequence number. */ -}; +#define __OLD_IPC_ID_TYPE unsigned int +#define __OLD_IPC_MODE_TYPE unsigned int +#define __OLD_IPC_SEQ_TYPE unsigned short int +#include /* SPARC semctl multiplex syscall expects the union pointed address, not the union address itself. */ +#undef SEMCTL_ARG_ADDRESS #define SEMCTL_ARG_ADDRESS(__arg) __arg.array /* Also for msgrcv it does not use the kludge on final 2 arguments. */ +#undef MSGRCV_ARGS #define MSGRCV_ARGS(__msgp, __msgtyp) __msgp, __msgtyp #include diff --git a/sysdeps/unix/sysv/linux/x86_64/ipc_priv.h b/sysdeps/unix/sysv/linux/x86_64/ipc_priv.h deleted file mode 100644 index ab44949e6d..0000000000 --- a/sysdeps/unix/sysv/linux/x86_64/ipc_priv.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Old SysV permission definition for Linux. x86_64 version. - Copyright (C) 2016-2019 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 - . */ - -#include /* For __key_t */ - -struct __old_ipc_perm -{ - __key_t __key; /* Key. */ - unsigned short uid; /* Owner's user ID. */ - unsigned short gid; /* Owner's group ID. */ - unsigned short cuid; /* Creator's user ID. */ - unsigned short cgid; /* Creator's group ID. */ - unsigned short mode; /* Read/write permission. */ - unsigned short int __seq; /* Sequence number. */ -};