From patchwork Fri Nov 13 16:58:29 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: 41063 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 11A243947417; Fri, 13 Nov 2020 16:59:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 11A243947417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1605286752; bh=clwzeDyLzYaY2syjbHOEHSmcK+oGvDhhhAPqABJQ7Ag=; 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=gIzT/aAGui8ShKe+21Sj9QJzBy1AtgQUddgQkZALZq/iA8ya55mCmWtK1JV3HYt83 Wc5b6UlHeoUUd/4LdW2zrVDUCEVLTZ8l9SPUREjx5wFal6CQZDoaZA8c89MTkvN547 mFu9h8eWjuCvLzX/LHvaDbOQSXsJ0S5gY+diSMzU= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by sourceware.org (Postfix) with ESMTPS id 9648F3947403 for ; Fri, 13 Nov 2020 16:59:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9648F3947403 Received: by mail-qt1-x843.google.com with SMTP id t5so7141644qtp.2 for ; Fri, 13 Nov 2020 08:59:09 -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=clwzeDyLzYaY2syjbHOEHSmcK+oGvDhhhAPqABJQ7Ag=; b=W4GffzlAAQS6mgCDsZawhNKTa1tf17XNCNydKLl8+6/6Gc+FYfdBUE3pOyjGw8s/JG V0K5YKVZNTl/0QA93OTT3SZPLg550QZGXk3FNMmp/pOmJD6i3Nak5wS7iT9NZsCPAAh2 MRhLYrB7Hr1Mg7sDmzsr3Tc7+CcP3rFRggjV8pQs3C0FicNDWhQ61NRVmkBpIxvSxDu7 GR6RaBOAchTfn6hjmw+1I7jLz4A9eUcUtmAPq+rfuzyqGGhdkYGA46eqTGNLNMwgcKdp icNC0PgJZ9WeoSnuuWMEn6oTP3m2o1FKk9BQdVseKWNEBWY6RQyyf6PBWF7kOvEJMWBx 7Dcw== X-Gm-Message-State: AOAM531OpdKkN7DsGHAJ39JI2oLsbn7veUCyVGsIp4V6zbqTrVknyWk1 r6RUQkxQv/V7V7Vri6pP9PfnVzyktS2Ewg== X-Google-Smtp-Source: ABdhPJz+eomIPOxmZj6qXIn45DdfFPBp2AGF063aF3D/UeGrHCfmsip5DLpuif5nLjQq/IkVMBbp9g== X-Received: by 2002:ac8:36bc:: with SMTP id a57mr2821500qtc.193.1605286744022; Fri, 13 Nov 2020 08:59:04 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id s16sm7363931qkg.5.2020.11.13.08.59.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 08:59:03 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 15/23] linux: Use generic __syscall_error for microblaze Date: Fri, 13 Nov 2020 13:58:29 -0300 Message-Id: <20201113165837.121629-16-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" Although the auto-generated syscall sets errno directly for dynamic case, using a function call generates more compact code: --- sizes-microblaze-linux-gnu.inline +++ sizes-microblaze-linux-gnu.outline text data bss dec hex filename -1835305 52738 9216 1897259 1cf32b libc.so - 188644 7236 176 196056 2fdd8 elf/ld.so - 121772 5872 8356 136000 21340 nptl/libpthread.so - 30836 1724 160 32720 7fd0 rt/librt.so +1831025 52714 9216 1892955 1ce25b libc.so + 188904 7240 176 196320 2fee0 elf/ld.so + 121540 5864 8356 135760 21250 nptl/libpthread.so + 30640 1720 160 32520 7f08 rt/librt.so Checked with a cross make check for microblaze-linux-gnu. --- sysdeps/unix/sysv/linux/microblaze/Makefile | 6 --- .../sysv/linux/microblaze/syscall_error.h | 25 ++++++++++++ sysdeps/unix/sysv/linux/microblaze/sysdep.S | 39 ------------------- 3 files changed, 25 insertions(+), 45 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/microblaze/syscall_error.h delete mode 100644 sysdeps/unix/sysv/linux/microblaze/sysdep.S diff --git a/sysdeps/unix/sysv/linux/microblaze/Makefile b/sysdeps/unix/sysv/linux/microblaze/Makefile index d178bc6f34..614553204f 100644 --- a/sysdeps/unix/sysv/linux/microblaze/Makefile +++ b/sysdeps/unix/sysv/linux/microblaze/Makefile @@ -1,9 +1,3 @@ ifeq ($(subdir),resource) sysdep_routines += backtrace_linux endif - -ifeq ($(subdir),nptl) -# pull in __syscall_error routine -libpthread-routines += sysdep -libpthread-shared-only-routines += sysdep -endif diff --git a/sysdeps/unix/sysv/linux/microblaze/syscall_error.h b/sysdeps/unix/sysv/linux/microblaze/syscall_error.h new file mode 100644 index 0000000000..3632dfddd7 --- /dev/null +++ b/sysdeps/unix/sysv/linux/microblaze/syscall_error.h @@ -0,0 +1,25 @@ +/* Linux wrappers for setting errno. Microblaze 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + 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 + . */ + +#ifndef _SYSCALL_ERROR_H +#define _SYSCALL_ERROR_H + +#define SYSCALL_ERROR_FUNC 1 +#define SYSCALL_ERROR_FUNC_ATTR + +#endif diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep.S b/sysdeps/unix/sysv/linux/microblaze/sysdep.S deleted file mode 100644 index c3157880d8..0000000000 --- a/sysdeps/unix/sysv/linux/microblaze/sysdep.S +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 2009-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 - modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - 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 - . */ - -#include - - -/* The following code is only used in the shared library when we - compile the reentrant version. Otherwise each system call defines - each own version. */ - -#ifndef PIC - -/* The syscall stubs jump here when they detect an error. */ - -# undef CALL_MCOUNT -# define CALL_MCOUNT /* Don't insert the profiling call, it clobbers %d0. */ - - .text -ENTRY (__syscall_error) - rsubk r3,r3,r0 - rtsd r15,8 - addik r3,r0,-1 /* delay slot. */ -END (__syscall_error) -#endif /* PIC. */