From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118439 invoked by alias); 17 Sep 2019 14:24:41 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 118331 invoked by uid 89); 17 Sep 2019 14:24:31 -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= X-HELO: mail-qk1-f195.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:from:to:references:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/QQnV5SfZxUPzu7xIWaKy2ryY5VE55zCMHCATyF5GgU=; b=NTQ//9ylfDR4w9E2gp7omRTweGLaYUI5kgTY8p6PYaWRVEloyDDs0xHiIMpZsXqT1i gYq7eT3vPT70FrKt+fldWw/x+TZDcoxo2EoETLQDd7gBt/sFq/PeVetYMS5tf3w7tlzX IP9vfl5W/UoSCm0IspT58J43pIZf7Z9D5dQMYObpGskL+JAaAHWPSSU3Anwn8O5GpVM2 YEsOr6W7A8N3mNtqfhg8Eu3SVpTfEKnODsuP/faRUmlYCp1+1Hd5PhA7rG5YtLCA+NMB UkZ9FOvVaf3evoNxaEUFvAWNzmt/ZCg0BEf9h/u3CcmS6QkXsLrNPzbvkC85/SOppROT +mng== Return-Path: Subject: Re: [PATCH v2 5/8] mips: Consolidate INTERNAL_VSYSCALL_CALL From: Adhemerval Zanella To: libc-alpha@sourceware.org References: <20190905205620.4646-1-adhemerval.zanella@linaro.org> <20190905205620.4646-5-adhemerval.zanella@linaro.org> Openpgp: preference=signencrypt Message-ID: <4d58092c-c116-f914-503f-a0cdf7d69559@linaro.org> Date: Tue, 17 Sep 2019 14:24:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190905205620.4646-5-adhemerval.zanella@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-09/txt/msg00245.txt.bz2 I will commit this shortly if no one opposes, after I tested on the affected architectures. On 05/09/2019 17:56, Adhemerval Zanella wrote: > 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(-) > > 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__ */ >