From patchwork Fri Nov 13 16:58:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 41058 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E230E3945C2B; Fri, 13 Nov 2020 16:59:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E230E3945C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605286745; bh=tS1xXVGvADoLlo6G1On+zOY4+Ju8VEbk/yBnFtvplps=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=bIhy5fOkPEda3VqJVy/Nlpv4a7kq2OccTLXm0OO2JG8NC1uoTrbNqPpjhgKSq0LvP +JIkRey3vtYEpBKhbBQwGIfyJCogznrwkVh9U7D00+jZ4w+iyRc5ywxWIRsJh/f4jP gHJy1LkJ8zBx1TSGuBNxVAivWkWhHuqD+rTwLKCg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by sourceware.org (Postfix) with ESMTPS id C7AE53945C07 for ; Fri, 13 Nov 2020 16:59:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C7AE53945C07 Received: by mail-qk1-x744.google.com with SMTP id d28so9370126qka.11 for ; Fri, 13 Nov 2020 08:59:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tS1xXVGvADoLlo6G1On+zOY4+Ju8VEbk/yBnFtvplps=; b=Hb+aO00pIf68KLLfw1lxvCaemUlmz/q5LKnuTHypgELVF+UR9n3XvzIRXvC8Frtcug bNqVZ0UI2qRMnIqBJlusG6vH0Qqt2OcvQJ9ny50WSf41/r3NvGQOqR77+9ZjVUKGtSbC H4ZJQJgVpFFJZs/9xFOh//LWDCKqglh0Q4ypWRCGv9ejV4ZJSfl390R1oVxbzFIuGV1D oEH21bwllbUvL6NXSjhIg9Pcv2dtB3HVYxZg0+msMmvGFl9OWhALrRAYgZnXrAV301Da krxXLgMYjOXNtSKRgCFIDx8TIc3P3ff7GIWzymVfP0ukipcSZ0xVmIpkYTGPEJ8/t8dM qEJw== X-Gm-Message-State: AOAM532at4NKB4Q0X31qeYQtD/GUSEpjUmGsx7GfabhJSfPEVukc5tnC xWehhTZxwDVGaTOdgfnKubdfbiayrLpTrQ== X-Google-Smtp-Source: ABdhPJzbJW+pqlvN7oQi7Ecweu13qr3kj+fvT1Lm3Sc7I9lYFd8ZEUP9mLelfwGR8uc0w+18nbkvFA== X-Received: by 2002:a37:a546:: with SMTP id o67mr3073723qke.167.1605286736966; Fri, 13 Nov 2020 08:58:56 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id s16sm7363931qkg.5.2020.11.13.08.58.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 08:58:56 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 10/23] linux: Use generic __syscall_error for hppa Date: Fri, 13 Nov 2020 13:58:24 -0300 Message-Id: <20201113165837.121629-11-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201113165837.121629-1-adhemerval.zanella@linaro.org> References: <20201113165837.121629-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" HPPA issues inline error handling for auto-generated syscall, the __syscall_error is used solely on clone implementation and it differs from generic implementation by passing positive errno numbers. Also, inline error handling does not really produce the most compat code. --- sizes-hppa-linux-gnu.outline +++ sizes-hppa-linux-gnu.inline text data bss dec hex filename -1576515 22028 9424 1607967 18891f libc.so - 174755 15524 448 190727 2e907 elf/ld.so - 132799 1296 8364 142459 22c7b nptl/libpthread.so - 30993 788 236 32017 7d11 rt/librt.so +1579367 22028 9424 1610819 189443 libc.so + 174835 15524 448 190807 2e957 elf/ld.so + 133055 1296 8364 142715 22d7b nptl/libpthread.so + 31297 788 236 32321 7e41 rt/librt.so Checked on hppa-linux-gnu. --- sysdeps/unix/sysv/linux/hppa/clone.S | 6 ++++-- .../linux/hppa/{sysdep.c => syscall_error.h} | 20 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) rename sysdeps/unix/sysv/linux/hppa/{sysdep.c => syscall_error.h} (68%) diff --git a/sysdeps/unix/sysv/linux/hppa/clone.S b/sysdeps/unix/sysv/linux/hppa/clone.S index 4eda812dd0..fcfafe1d2b 100644 --- a/sysdeps/unix/sysv/linux/hppa/clone.S +++ b/sysdeps/unix/sysv/linux/hppa/clone.S @@ -124,7 +124,8 @@ ENTRY(__clone) .LerrorRest: /* Something bad happened -- no child created */ bl __syscall_error, %rp - sub %r0, %ret0, %arg0 + copy %ret0, %arg0 + ldw -84(%sp), %rp /* Return after setting errno, ret0 is set to -1 by __syscall_error. */ bv %r0(%rp) @@ -133,7 +134,8 @@ ENTRY(__clone) .LerrorSanity: /* Sanity checks failed, return -1, and set errno to EINVAL. */ bl __syscall_error, %rp - ldi EINVAL, %arg0 + ldi -EINVAL, %arg0 + ldw -84(%sp), %rp bv %r0(%rp) ldwm -64(%sp), %r4 diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.c b/sysdeps/unix/sysv/linux/hppa/syscall_error.h similarity index 68% rename from sysdeps/unix/sysv/linux/hppa/sysdep.c rename to sysdeps/unix/sysv/linux/hppa/syscall_error.h index 8c06b6fc80..f5947ccd7c 100644 --- a/sysdeps/unix/sysv/linux/hppa/sysdep.c +++ b/sysdeps/unix/sysv/linux/hppa/syscall_error.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1997-2020 Free Software Foundation, Inc. +/* Linux wrappers for setting errno. HPPA version. + Copyright (C) 2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -12,16 +13,13 @@ Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see + License along with the GNU C Library; if not, see . */ -#include +#ifndef _SYSCALL_ERROR_H +#define _SYSCALL_ERROR_H -/* This routine is jumped to by all the syscall handlers, to stash - an error number into errno. */ -int -__syscall_error (int err_no) -{ - __set_errno (err_no); - return -1; -} +#define SYSCALL_ERROR_FUNC 1 +#define SYSCALL_ERROR_FUNC_ATTR + +#endif