From patchwork Mon Feb 10 19:20:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 183255 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp4417479ile; Mon, 10 Feb 2020 11:22:03 -0800 (PST) X-Google-Smtp-Source: APXvYqw4p78fVqgfRhlaBaIehk7aqeE3i1Vq1v8eJ28Dk+8xJ64yZzrAOcuPHzOkEpAhTt5+vBr3 X-Received: by 2002:a9d:7ccc:: with SMTP id r12mr2328378otn.22.1581362523264; Mon, 10 Feb 2020 11:22:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581362523; cv=none; d=google.com; s=arc-20160816; b=gif4j3zzcS6oLQQo32LOZi9jzhTOqyE+rSJax2VP9eHR13Ks5i8/npSbVHDDNN0rfr 80TlA1uTfHcONQM5utAKiPSqkeb5joEKJNH9h6pZ2yuAz9dkTmBLii1ojcSsBQ+kDIvP U/b2w6H4eHjIaesbkqxROdUcamK0Qv9eYBzvnBk9wsofwH3tK+wddYvfE43oTrzgfeJI jthH3Pdq/9xeckJFBrqPhWk3tfjpvPdkQTlCrCpaOosq4efgm8ttJcxM0YynLWet/rBe cPMMOAlTayGiDZ1NobbhV8A+nOA4Jxp6h224xovia6P87QYQDv8PNpPjaMqcAonOyWyu S4WA== 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=gcRlSIUfDZNzDXLhQXEXcrQpCXiBWs/Mt0pzBbJG87Y=; b=rSKlwnb6zz9qLiNQrtpQUKCQbSte6J/oWPTmecSysu6dK2NzpWDqL5jqVkxIyUykMf kxF4wusIiYxo7tzWWD6QjaL0xsSo4DjaWfW8JCJn/vCREFC05nUUWlGBP8tOCPUUm4k+ iflWRI4lZJOgOwIXp1+SH+ptmK2ewy94hNUJcN58fSfmSYSivDWoTZCVKa+fXi/Hz4jB 1a4cB9TImweR0gnFmq2DwxeINHoeJh3FYsHHwUvxh3pyKhbglU0IVc3c/a98STrakZ6h 8x4n6cIIyTHH6lTqSLbSdyn1/eLNihdJ6BUU0taCUG5bmH3YbuD8dKXHtLeMbUgsC5cw Jzeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=wzxSHZZt; dkim=pass header.i=@linaro.org header.s=google header.b=qzJpZrbr; spf=pass (google.com: domain of libc-alpha-return-109392-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-109392-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 t1si623789otq.148.2020.02.10.11.22.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Feb 2020 11:22:03 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-109392-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=wzxSHZZt; dkim=pass header.i=@linaro.org header.s=google header.b=qzJpZrbr; spf=pass (google.com: domain of libc-alpha-return-109392-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-109392-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=bP+B6uWjeEJqlxxY5VgU55zHRUp/cLu D9h5Ng9XwcmaIujW6Ok15ndKAqR/U1ZR4pBIjVNwVJ9h6/yJQtJN0u8QEY6baiSk 3XjCGehap6/UKKWAtEl0yONM3MrywTTJoOgiskAxSDR1Y2FjpO+73u1IJ6CfCX3c t8BCC7n+GQzc= 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=HlVaR8TLfslcPKNR1vqU2J/MfWk=; b=wzxSH ZZto0nMpomTlemcAZryiBJP9u9uUmBNVC6xgvAny0w+9TiqKhZrGxX7Jp0Rpk0xf 6oJo3G3kRydYvCrv+SBJoTgDDE6kygqxjZsSrWPJaPYHFt8C+D01c10ZHneBc4wg 0JlEVsQx9dLFQA8Kx93n2DEIlIk1JELqhwm3Hw= Received: (qmail 100128 invoked by alias); 10 Feb 2020 19:20:56 -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 100000 invoked by uid 89); 10 Feb 2020 19:20:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.1 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=nios X-HELO: mail-qk1-f193.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=gcRlSIUfDZNzDXLhQXEXcrQpCXiBWs/Mt0pzBbJG87Y=; b=qzJpZrbrfPCcI97bq1Yw+GTMUtCbxBq/zx7g3ogF7AzS+4/+R7o4XE7Mf3RLpzD6ui n5q3//nnKjCg/JNkMNdCYkfFEs9Bomo2jtH01KtbKkgQtPF8X6fwKJe00rHv6b9BzpzN JlNy6iuhVFt61OR/35LvnxRbKt8OVSek8FQg1qS23R13L0lgwtp3kCljEsSeyg2auOF2 lv0mgjwDiq4FlD27Bgd5gG/QxninP7aLfsRYcyHm0zlLJK328hezSLWltLwgh81T3y/m P0OhfFk5AIrhyVibOHUV+UPv7UmhbhgjnJ/jDnN5+AYuhp59bu4WRhUHKUHKyz5iIrIz cbUw== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 08/15] nios2: Use Linux kABI for syscall return Date: Mon, 10 Feb 2020 16:20:31 -0300 Message-Id: <20200210192038.23588-8-adhemerval.zanella@linaro.org> In-Reply-To: <20200210192038.23588-1-adhemerval.zanella@linaro.org> References: <20200210192038.23588-1-adhemerval.zanella@linaro.org> 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(-) -- 2.17.1 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; \ } \ (int) _sys_result; })