From patchwork Tue Jun 21 11:42:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bamvor Jian Zhang X-Patchwork-Id: 638649 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rYm8R1NH0z9s2Q for ; Tue, 21 Jun 2016 21:43:51 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=OZOAVf8b; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:cc:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=E2g1cz5O4prveeaS vIt4wIi1tHCLDNCW32fxLKxw0omv2V0rsXgPC7gbSMMJX/I2VIQRc78Qr9nrT4oQ OXp1ekiIoAzXBhRVM7whmwUZNgrT9CgyO7a1EYRE0hMhvb70++CF89Yr3qPPJ0Bh H+l9vXPwi1Fk8JvwKCumgb0Wwww= 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:subject:to:references:cc:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=JwHqiEcuNPxG8gxUKoT4Wl APjUA=; b=OZOAVf8blJE5KM8RYwacOY2hOKlhF0NSrYa6sV45STU25MRul/YW/C Aj4DwZ4oW2iX0pBApZ4oG6YnXJdJPye5jEL53hkSgmoq7zlUoSIzHmc4BD4lK+IX UX9Qnb9QTNcZfwcQEpeu80tUy4Rn2qhPSvhF2KzKKYDku/2aw10qM= Received: (qmail 52228 invoked by alias); 21 Jun 2016 11:43: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 52117 invoked by uid 89); 21 Jun 2016 11:43:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=1ll, Gao, Jian, jian X-HELO: szxga04-in.huawei.com Subject: Re: [PATCH 11/27] [AARCH64] Syscalls for ILP32 are passed always via 64bit values. To: Andreas Schwab , Yury Norov References: <1466485631-3532-1-git-send-email-ynorov@caviumnetworks.com> <1466485631-3532-13-git-send-email-ynorov@caviumnetworks.com> CC: , , , , , , , , , , , Andrew Pinski , "Zhangjian (Bamvor)" , From: "Zhangjian (Bamvor)" Message-ID: <5769281D.6090109@huawei.com> Date: Tue, 21 Jun 2016 19:42:21 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.57692836.00FC, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 38c2ba8088581729c100e434dcda1d45 Hi, On 2016/6/21 15:56, Andreas Schwab wrote: > Yury Norov writes: > >> diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h >> index 1ffabc2..42f89c8 100644 >> --- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h >> +++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h >> @@ -161,11 +161,11 @@ >> call. */ >> # undef INLINE_SYSCALL >> # define INLINE_SYSCALL(name, nr, args...) \ >> - ({ unsigned long _sys_result = INTERNAL_SYSCALL (name, , nr, args); \ >> + ({ unsigned long long _sys_result = INTERNAL_SYSCALL (name, , nr, args); \ >> if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_sys_result, ), 0))\ >> { \ >> __set_errno (INTERNAL_SYSCALL_ERRNO (_sys_result, )); \ >> - _sys_result = (unsigned long) -1; \ >> + _sys_result = (unsigned long long) -1; \ >> } \ >> (long) _sys_result; }) > > The cast should be (long long). My understanding that we need more conversion, reference the follow patch: From a0780d286277bf70bacfc0b20fe909a46b990f6e Mon Sep 17 00:00:00 2001 From: gaoyongliang Date: Thu, 19 May 2016 18:19:05 +0800 Subject: [PATCH] ilp32 fix syscall return value to use long long Signed-off-by: Yongliang Gao Signed-off-by: Bamvor Jian Zhang --- sysdeps/unix/sysdep.h | 2 +- sysdeps/unix/sysv/linux/aarch64/sysdep.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sysdeps/unix/sysdep.h b/sysdeps/unix/sysdep.h index 71db7f8..09b6e75 100644 --- a/sysdeps/unix/sysdep.h +++ b/sysdeps/unix/sysdep.h @@ -31,7 +31,7 @@ #define SYSCALL_CANCEL(name, ...) \ ({ \ - long int sc_ret; \ + long long sc_ret; \ if (SINGLE_THREAD_P) \ sc_ret = INLINE_SYSCALL (name, __SYSCALL_NARGS(__VA_ARGS__), \ __VA_ARGS__); \ diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h index fbf76c1..a696cc2 100644 --- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h +++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h @@ -173,7 +173,7 @@ { \ iserr: \ __set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err)); \ - sc_ret = -1L; \ + sc_ret = -1LL; \ } \ out: \ sc_ret; \ @@ -216,7 +216,7 @@ : "=r" (_x0) \ : "r" (funcptr) ASM_ARGS_##nr \ : "x30", "memory"); \ - (long) _x0; \ + (long long) _x0; \ }) @@ -230,7 +230,7 @@ __set_errno (INTERNAL_SYSCALL_ERRNO (_sys_result, )); \ _sys_result = (unsigned long long) -1; \ } \ - (long) _sys_result; }) + (long long) _sys_result; }) # undef INTERNAL_SYSCALL_DECL # define INTERNAL_SYSCALL_DECL(err) do { } while (0) @@ -257,7 +257,7 @@ # undef INTERNAL_SYSCALL_ERROR_P # define INTERNAL_SYSCALL_ERROR_P(val, err) \ - ((unsigned long) (val) >= (unsigned long) -4095) + ((unsigned long long) (val) >= (unsigned long long) -4095) # undef INTERNAL_SYSCALL_ERRNO # define INTERNAL_SYSCALL_ERRNO(val, err) (-(val))