From patchwork Thu Sep 5 20:56:17 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: 173181 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp1238216ilq; Thu, 5 Sep 2019 13:57:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyu5MfZRn2yAHozyN1bht12gPZsdMRYK3JgpGf87TDeJ6HKGQHn1ElW0fWHtJDbA+ODTXt7 X-Received: by 2002:a62:2ec7:: with SMTP id u190mr6495703pfu.121.1567717033458; Thu, 05 Sep 2019 13:57:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567717033; cv=none; d=google.com; s=arc-20160816; b=wxx+EK8MFb9O4K4Lncv1L8QHaSLBpUfaMiUJP5O8g3pQUqgBZCq0WEdh6g4Hg/vfio 8Y4VCe0Ug2HKKxRDVZuv/Qh4IWWP7kU+MkPDWQJt6psC/sd7DHaXbCsK7fZ468xE8KtZ wyAcwcPXcs5hrV+XoIUg62jOzZRF9YBMqoKLtr6spGaqi9Yjo0l+hZ2vmOQqqolk2wS8 eKXiJbAgoo69M5tByieX+EQ/PaQlGnR5G9oay3vuHk+UVmvdlUzOWcIrvJOADs5PPgAf zcWNLGgPXKYIO7zu5m+Y2LUQ/KzrGtxUxgN8Uqlpj1e/hGiHodU7h0SOXmgx6v79cvnG 05xg== 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=gwUlLK9DTxZpgKw8a8M/qTuEBhoxxCH3anBUMULq41c=; b=SrP4yBV4cv5+nnwTr4u2uGJONCVAtjDLEGPIOWYcPhO7XDUMG7+V0e9yusHJCcQi4n gIHNktKWeyrvlAHNLA1tBzuyCeek3MCzu1ho9+Jxx6D+tJipXqxuVkUO5iEyvFyU4nqE ru1XYC45k5oSV4KPr37fX0LbRoKe6KqLN/NPGhl+ON5mAEj1mneFJFbshTlHWiPDTiIx EBypK/keYy/y+Rm6zP2iAgXEA2rH3zDaatjLQ8nigZvWMqy/nA9zxuOGXpuLJxSqwDJh x71KiIaD4D+KGPWnLtBbyJ9/k7yFgzaqIXrzqGhp8rh/ZckrFD8W2p3lhqoMB3QcdrAd TFMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=d+ATXUeE; dkim=pass header.i=@linaro.org header.s=google header.b=cr++hD3x; spf=pass (google.com: domain of libc-alpha-return-105066-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-105066-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 h8si2738917pgc.402.2019.09.05.13.57.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Sep 2019 13:57:13 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-105066-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+ATXUeE; dkim=pass header.i=@linaro.org header.s=google header.b=cr++hD3x; spf=pass (google.com: domain of libc-alpha-return-105066-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-105066-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=GxslJCkk5NWGQzDZaRJUbB01jga+mec 3nY8P6DNg+jhCrqLX3QuJ6BILngOsDLIQhECEIdRtv3abOLy4lt3Q4wxISN83jjW /2poQtfx0eBN9Z7u4yNzfRCf03CGh7Gjt8f6u3RtJJ0bEM417blttnHvJk+jzBg7 uhqlE1pZ2SUM= 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=pQspx06S0kWLVMl73gnYpOIwKe4=; b=d+ATX UeEytks25YqjglOc7HBlMrj7mDeggJS8Kx4spumxgVT3HW14JhN0Ho90Is7zRLEY KbPB+sHWa/AL4Ne+gQzN00HCEmHTRV7POCBQpqEpg6G2h96hMCG0RLO6KeHRAlER RlAE+WtmkH7VSvqjDQgiAliqAI8VbGb2jqVSc8= Received: (qmail 116801 invoked by alias); 5 Sep 2019 20:56: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 116690 invoked by uid 89); 5 Sep 2019 20:56:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.0 required=5.0 tests=AWL, 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.1 spammy=consolidate 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=gwUlLK9DTxZpgKw8a8M/qTuEBhoxxCH3anBUMULq41c=; b=cr++hD3xymsBhGS3WaFeyLJuBdM23u5Xd57OXHlkDYIO5LPBKLrjv03NUUWtmEeag7 K4Ij+KfHlczjVr4mgE9Yc6gdq0S+U4Q3/ZqaFys1wGEhUtDfA6k7gV92kSjQN+8c5asL 0qCLDtSRIR7HAgJMPm/fUpgZy6dov6ezI0RCqfaYdRLsC3dMKdDsI5YY3k6jGom/K9qH KxaEdcAam2mBvh9N4tDBOu4jcqZt4MLtxy0e0s/oiB6UTGzyc8rsDx9FWpyElWd3f0gE 1GFyjD8Rw9vbU9w1FeMg2LwswuEm3i0o+jf8gryzgKbmZN8pMvWaLqDBO2I+lFTcnmy/ tvOg== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 5/8] mips: Consolidate INTERNAL_VSYSCALL_CALL Date: Thu, 5 Sep 2019 17:56:17 -0300 Message-Id: <20190905205620.4646-5-adhemerval.zanella@linaro.org> In-Reply-To: <20190905205620.4646-1-adhemerval.zanella@linaro.org> References: <20190905205620.4646-1-adhemerval.zanella@linaro.org> This patch consolidates the mips, mips64, and mips64-n32 INTERNAL_VSYSCALL_CALL on a single implementation. No semantic changes. I checked against a build for mips-linux-gnu, mips64-linux-gnu, and mips64-n32-linux-gnu. * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (INTERNAL_VSYSCALL_CALL): Remove. * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (INTERNAL_VSYSCALL_CALL): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h (INTERNAL_VSYSCALL_CALL): Likewise. * sysdeps/unix/sysv/linux/mips/sysdep.h (INTERNAL_VSYSCALL_CALL): New macro. --- sysdeps/unix/sysv/linux/mips/mips32/sysdep.h | 12 ------------ sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h | 12 ------------ sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h | 12 ------------ sysdeps/unix/sysv/linux/mips/sysdep.h | 16 ++++++++++++++++ 4 files changed, 16 insertions(+), 36 deletions(-) -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h index ebe397b701..bfcb916f15 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h +++ b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h @@ -349,18 +349,6 @@ libc_hidden_proto (__mips_syscall7, nomips16) #define __SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", \ "$14", "$15", "$24", "$25", "hi", "lo", "memory" -/* Standard MIPS syscalls have an error flag, and return a positive errno - when the error flag is set. Emulate this behaviour for vsyscalls so that - the INTERNAL_SYSCALL_{ERROR_P,ERRNO} macros work correctly. */ -#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ - ({ \ - long _ret = funcptr (args); \ - err = ((unsigned long) (_ret) >= (unsigned long) -4095L); \ - if (err) \ - _ret = -_ret; \ - _ret; \ - }) - #endif /* __ASSEMBLER__ */ /* Pointer mangling is not yet supported for MIPS. */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h index bb49429c30..49e94a1706 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h @@ -297,18 +297,6 @@ #define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \ "$14", "$15", "$24", "$25", "hi", "lo", "memory" -/* Standard MIPS syscalls have an error flag, and return a positive errno - when the error flag is set. Emulate this behaviour for vsyscalls so that - the INTERNAL_SYSCALL_{ERROR_P,ERRNO} macros work correctly. */ -#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ - ({ \ - long _ret = funcptr (args); \ - err = ((unsigned long) (_ret) >= (unsigned long) -4095L); \ - if (err) \ - _ret = -_ret; \ - _ret; \ - }) - #endif /* __ASSEMBLER__ */ /* Pointer mangling is not yet supported for MIPS. */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h index 84a1ff186b..5911a62e5b 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h @@ -293,18 +293,6 @@ #define __SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", "$13", \ "$14", "$15", "$24", "$25", "hi", "lo", "memory" -/* Standard MIPS syscalls have an error flag, and return a positive errno - when the error flag is set. Emulate this behaviour for vsyscalls so that - the INTERNAL_SYSCALL_{ERROR_P,ERRNO} macros work correctly. */ -#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ - ({ \ - long _ret = funcptr (args); \ - err = ((unsigned long) (_ret) >= (unsigned long) -4095L); \ - if (err) \ - _ret = -_ret; \ - _ret; \ - }) - #endif /* __ASSEMBLER__ */ /* Pointer mangling is not yet supported for MIPS. */ diff --git a/sysdeps/unix/sysv/linux/mips/sysdep.h b/sysdeps/unix/sysv/linux/mips/sysdep.h index 58a7244581..77b1f9c2fb 100644 --- a/sysdeps/unix/sysv/linux/mips/sysdep.h +++ b/sysdeps/unix/sysv/linux/mips/sysdep.h @@ -22,3 +22,19 @@ /* List of system calls which are supported as vsyscalls. */ #define HAVE_CLOCK_GETTIME_VSYSCALL "__vdso_gettimeofday" #define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_clock_gettime" + +#ifndef __ASSEMBLER__ + +/* Standard MIPS syscalls have an error flag, and return a positive errno + when the error flag is set. Emulate this behaviour for vsyscalls so that + the INTERNAL_SYSCALL_{ERROR_P,ERRNO} macros work correctly. */ +#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ + ({ \ + long _ret = funcptr (args); \ + err = ((unsigned long) (_ret) >= (unsigned long) -4095L); \ + if (err) \ + _ret = -_ret; \ + _ret; \ + }) + +#endif /* __ASSEMBLER__ */