From patchwork Thu May 16 15:12:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 164332 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp967953ili; Thu, 16 May 2019 08:13:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWY7y1GjTV3MY0eSwV6yq/2rTgZqoIHQOGgOnv/6n3JaFojKZx04NgOyQ2wVtvbMn6Z7xX X-Received: by 2002:a62:7793:: with SMTP id s141mr54855057pfc.21.1558019597734; Thu, 16 May 2019 08:13:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558019597; cv=none; d=google.com; s=arc-20160816; b=LsnpLG+LG9pykj1haK9p5vIImMUqKznZ49XNcRcjO44W5CI5oM7eRx8hH4wKnyebA0 A7guMD7r3eM6/rzXZOX51ASflaXhILxjDBzy3vh19T+nLz/BHURXcq5TZXF7k+EpFvMp G0nTsXbSClvlumCQ9+6Q1yPIqfBuj4zaWBjJbc9iGBbdjZbYo7rTHxnVFFJDxa55uN4T f78LwjOCFdjtgqoTp8D8v9hBFGjPCg7oKFn10NO88sRinJqxlP0Yzbv4fUlHhiK3BEGV ZKV5fzJb6Xy1RHk+Ypom/V6iDVbyw0wxJiOYH05NN29WSXrFRc0B0+YoKAv1FyHEBpHt yPPg== 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=9m69zKOsap7IrJP/QEjtJNICZJK20PB0qqL5SmbpddU=; b=IwWKtXaRJdnqol6SK5qZuXS6RSEwRfbQ15MP8JT4FDqQPuQN6am+aE6mTxKGgF66ZK jw2YPh3dec30yg3ae/VrGTFdm0yJ+k4ZPRmVsr25Po/c3jdi637LO7fhZOTGzpPLLpGl X9BbnzI1+dRrbSTQUQ51korVNcyAZVRuYsFa8jAlAfNdyX9bwGo1NFuxeM0Iyv/AMz8H WVHVUXrkkHIR3V0akwf9LsH9RgkuBqxsyWfCYRA/KVUSIzNY8ZDFHtY7iughQ0xZLUQN e+/LOxyPebhPFCTz+Vp+GfFEkae9XT/YFi101D7ChUz++RIk7wMw8nAVEHy+xi5KAhN2 ZaBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=hn+QZ7G6; dkim=pass header.i=@linaro.org header.s=google header.b=Gt9EGicj; spf=pass (google.com: domain of libc-alpha-return-102028-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102028-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 p12si5048949pgc.310.2019.05.16.08.13.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 May 2019 08:13:17 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-102028-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=hn+QZ7G6; dkim=pass header.i=@linaro.org header.s=google header.b=Gt9EGicj; spf=pass (google.com: domain of libc-alpha-return-102028-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102028-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=aEAqrVO+QTub1kRpAdB55vA3g12hojf ulNLVc8bSNB/TYnNOimeRnEpmJxsbw7zSliBWnLH1utcKriw6UjJX2kerGJpzo20 YC/HvCPYLijOXgQoIAwLeVWKB5YhdeX92gCHlohRv4kq5nuTd+2MKWK8Iqmx+agA LOgf1CszEjTE= 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=y785AKnOU7X0rvnb3ITRf4OP2z8=; b=hn+QZ 7G6TTZ5E31/j5JaHnxlifbXftTrkh190ucPLr7EdWOy3cifaY8F0w8hH1pHRdGyI 0hMD6JAXVXgvzSs+f5QD5Lp12HbDDpy2znLcLCgZkevfaj/O6u06DjYyecwlE+Kg 4sEZ6QIcRRdxLp/itsMHIoJb1Up/Cg+NQTHT9I= Received: (qmail 111775 invoked by alias); 16 May 2019 15:13:04 -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 111714 invoked by uid 89); 16 May 2019 15:13:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=fifth, s390linuxgnu, s390-linux-gnu, 2003 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=9m69zKOsap7IrJP/QEjtJNICZJK20PB0qqL5SmbpddU=; b=Gt9EGicjSmAJVO6APx2qvfMgDFWs97k5S4Rk4UNHHq/j51EToNNHmg1dZpqK0LSQIg 4TP8ng5mUfWf9YhqaKb7uPWxIWLMr0PMRKiVE+FtqmhiqpaW0HZxxR2DhmcAK8U4Fm/W A6Qvdm75oEID80GfZ6Z/Ez5qnmXz51gZRzNZLDLiVzrpBuFaMB2XeB0Yl6o2X0ph6RcZ cG94TDSVh9UzPCWNoBwC7kDx1tUeI+z+iwsSfWt7nPS+N8aDkocFye/HvpcrCoVZRu5I VVpOL8kn6rLXhZ3tnK9skh7rSwpDdjZYCL9xHaH+P9W6P40toxebZYdskXOEZkVO4nUM 5uIA== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 3/5] sysvipc: Consolidate semtimedop s390 Date: Thu, 16 May 2019 12:12:47 -0300 Message-Id: <20190516151249.19029-3-adhemerval.zanella@linaro.org> In-Reply-To: <20190516151249.19029-1-adhemerval.zanella@linaro.org> References: <20190516151249.19029-1-adhemerval.zanella@linaro.org> This patch consolidates the s390-32 semtimedop implementation by defining a arch-specific SEMTIMEDOP_IPC_ARGS to rearrange the arguments expected by s390 Linux kABI. The idea is to avoid have multiples semtimedop implementation changes for Linux v5.1 change to enable wire-up sysvipc support. Checked with a s390-linux-gnu and checking that resulting semtimedop objects do not change. * sysdeps/unix/sysv/linux/ipc_priv.h (SEMTIMEDOP_IPC_ARGS): New define. * sysdpes/unix/sysv/linux/s390/s390-32/ipc_priv.h: New file. * sysdeps/unix/sysv/linux/s390/semtimedop.c: Remove file. * sysdeps/unix/sysv/linux/semtimedop.c (semtimedop): Use SEMTIMEDOP_IPC_ARGS for calls with __NR_ipc. --- sysdeps/unix/sysv/linux/ipc_priv.h | 3 ++ .../unix/sysv/linux/s390/s390-32/ipc_priv.h | 29 +++++++++++++++ sysdeps/unix/sysv/linux/s390/semtimedop.c | 36 ------------------- sysdeps/unix/sysv/linux/semtimedop.c | 4 +-- 4 files changed, 34 insertions(+), 38 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/ipc_priv.h delete mode 100644 sysdeps/unix/sysv/linux/s390/semtimedop.c -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/ipc_priv.h b/sysdeps/unix/sysv/linux/ipc_priv.h index 65adbb093e..49018c1b28 100644 --- a/sysdeps/unix/sysv/linux/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/ipc_priv.h @@ -34,4 +34,7 @@ struct __old_ipc_perm #define MSGRCV_ARGS(__msgp, __msgtyp) \ ((long int []){ (long int) __msgp, __msgtyp }) +#define SEMTIMEDOP_IPC_ARGS(__nsops, __sops, __timeout) \ + (__nsops), 0, (__sops), (__timeout) + #include diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/ipc_priv.h b/sysdeps/unix/sysv/linux/s390/s390-32/ipc_priv.h new file mode 100644 index 0000000000..9d74e92289 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/s390-32/ipc_priv.h @@ -0,0 +1,29 @@ +/* Arch-specific SysV IPC definitions for Linux. s390 version. + Copyright (C) 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 + +/* The s390 sys_ipc variant has only five parameters instead of six + (as for default variant) and the only difference is the handling of + SEMTIMEDOP where on s390 the third parameter is used as a pointer + to a struct timespec where the generic variant uses fifth parameter. */ +#undef SEMTIMEDOP_IPC_ARGS +#define SEMTIMEDOP_IPC_ARGS(__nsops, __sops, __timeout) \ + (__nsops), (__timeout), (__sops) + +#include diff --git a/sysdeps/unix/sysv/linux/s390/semtimedop.c b/sysdeps/unix/sysv/linux/s390/semtimedop.c deleted file mode 100644 index 772ee432a9..0000000000 --- a/sysdeps/unix/sysv/linux/s390/semtimedop.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 2003-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Martin Schwidefsky , 2003. - - 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 -#include -#include -#include - -/* Perform user-defined atomical operation of array of semaphores. */ - -int -semtimedop (int semid, struct sembuf *sops, size_t nsops, - const struct timespec *timeout) -{ - /* The s390 sys_ipc variant has only five parameters instead of six - (as for default variant) and the only difference is the handling of - SEMTIMEDOP where on s390 the third parameter is used as a pointer - to a struct timespec where the generic variant uses fifth parameter. */ - return INLINE_SYSCALL_CALL (ipc, IPCOP_semtimedop, semid, nsops, timeout, - sops); -} diff --git a/sysdeps/unix/sysv/linux/semtimedop.c b/sysdeps/unix/sysv/linux/semtimedop.c index 961c6d1f0b..1d746c4117 100644 --- a/sysdeps/unix/sysv/linux/semtimedop.c +++ b/sysdeps/unix/sysv/linux/semtimedop.c @@ -30,7 +30,7 @@ semtimedop (int semid, struct sembuf *sops, size_t nsops, #ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS return INLINE_SYSCALL_CALL (semtimedop, semid, sops, nsops, timeout); #else - return INLINE_SYSCALL_CALL (ipc, IPCOP_semtimedop, semid, nsops, 0, sops, - timeout); + return INLINE_SYSCALL_CALL (ipc, IPCOP_semtimedop, semid, + SEMTIMEDOP_IPC_ARGS (nsops, sops, timeout)); #endif }