From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 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 dcvr.yhbt.net (Postfix) with ESMTPS id 899CC1F45E for ; Thu, 20 Feb 2020 13:14:58 +0000 (UTC) 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:cc:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=X2K51HafWZ/7BK5c Ho4LGROIIqwsxmT0Dv1iZhuff4nKzuNTIxp/N+b5aObYv37V+g+44llTHkqM63PE YbFWS2W7jUTk1CR8QjGsefY+ayuMtIrfbl2kdzXMiFsM08gfk1aAhifizKeSNo5d nRppnJ7sKfhwKuoc7azid4cQj2w= 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:cc:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=Y5CyZT6hcKe8vLVQlGYYRC 0rbO0=; b=IuQjzJfv0FNUkqClM8mYwnItmnNoM4QR7+APV7OCLCUFqsBruRt5vJ FEN7sPHNA4gDyAZimsz4MeEK79ox/HHAi3sQW06gikpG5zxVdpoxHzNKq2tkJDfg Em4oBSqa7XqlF6ZfyHrGE35ngw36l0lFP74eZzOrtYGS4fdhByCXQ= Received: (qmail 103074 invoked by alias); 20 Feb 2020 13:14:55 -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 Received: (qmail 103065 invoked by uid 89); 20 Feb 2020 13:14:55 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-qt1-f195.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=6ySlCMHI+gxHqC0V+xQd6MHOB9gUaaFB/WQadbzBIBo=; b=pklu0RcQjTenqn1qXhSD6tdwePOg+aYuyaTZu6P/nD64rO39MERNNh22sbCfoVJoIy TZYhJzAIk78q+gskEuyQ3wCuxKKEVBbhUHecUf2ejFL29jJbQlmXby0Tu+oklkAiFdqt NebGUJXYdWiJdL9hLw7/issxLnfo8CwhdtCMDgz2tluJzrEFG+kdWuf34qy7jfIadAC3 j7EPtacCBdJDdcsNN3sg8w8T/Z6BHOLdzT/H4BVQN2UQuoUxEEE5ImBDzhREzDWh28Bh Sof5R9wt+55eLaJ+G32bIRhTOFHVHeUAUwArOgRmlh9ZikcsFrOrAuyy5Iu6TLuCTlTq wpwA== Subject: Re: [PATCH 08/15] nios2: Use Linux kABI for syscall return To: Vineet Gupta , "libc-alpha@sourceware.org" Cc: arcml References: <20200210192038.23588-1-adhemerval.zanella@linaro.org> <20200210192038.23588-8-adhemerval.zanella@linaro.org> <10265c86-aba3-12f9-9208-4a4c6ad31d28@synopsys.com> From: Adhemerval Zanella Message-ID: <4d32b8a1-e294-d2b7-f150-2c55281614ed@linaro.org> Date: Thu, 20 Feb 2020 10:14:48 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <10265c86-aba3-12f9-9208-4a4c6ad31d28@synopsys.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 19/02/2020 18:40, Vineet Gupta wrote: > On 2/10/20 11:20 AM, Adhemerval Zanella wrote: >> It changes the nios INTERNAL_SYSCALL_RAW macro to return a negative >> value instead of 'r2' register value on 'err' macro argument. >> >> The macro INTERNAL_SYSCALL_DECL is no longer required, and the >> INTERNAL_SYSCALL_ERROR_P follows the other Linux kABIS. >> >> Checked with a build against nios2-linux-gnu. >> --- >> sysdeps/unix/sysv/linux/nios2/sysdep.h | 10 +++++----- >> 1 file changed, 5 insertions(+), 5 deletions(-) >> >> diff --git a/sysdeps/unix/sysv/linux/nios2/sysdep.h b/sysdeps/unix/sysv/linux/nios2/sysdep.h >> index b02730bd23..eab888df32 100644 >> --- a/sysdeps/unix/sysv/linux/nios2/sysdep.h >> +++ b/sysdeps/unix/sysv/linux/nios2/sysdep.h >> @@ -157,13 +157,14 @@ >> (int) result_var; }) >> >> #undef INTERNAL_SYSCALL_DECL >> -#define INTERNAL_SYSCALL_DECL(err) unsigned int err __attribute__((unused)) >> +#define INTERNAL_SYSCALL_DECL(err) do { } while (0) >> >> #undef INTERNAL_SYSCALL_ERROR_P >> -#define INTERNAL_SYSCALL_ERROR_P(val, err) ((void) (val), (unsigned int) (err)) >> +#define INTERNAL_SYSCALL_ERROR_P(val, err) \ >> + ((unsigned long) (val) >= (unsigned long) -4095) >> >> #undef INTERNAL_SYSCALL_ERRNO >> -#define INTERNAL_SYSCALL_ERRNO(val, err) ((void) (err), val) >> +#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) >> >> #undef INTERNAL_SYSCALL_RAW >> #define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \ >> @@ -180,8 +181,7 @@ >> : "+r" (_r2), "=r" (_err) \ >> : ASM_ARGS_##nr \ >> : __SYSCALL_CLOBBERS); \ >> - _sys_result = _r2; \ >> - err = _err; \ >> + _sys_result = _err != 0 ? -_r2 : -_r2; \ > > Is there a typo here ? both cases seem to be -ve It is, thanks for catching it. I have pushed b790c8c2ed to fix and double checked nios2 syscall handling (arch/nios2/kernel/entry.S:205) to certify that the modification does follow nios2 kABI.