Message ID | c1e18d8cf073268918f93bff10b44519333625c0.1597243100.git.alistair.francis@wdc.com |
---|---|
State | Committed |
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> 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 7C5F8384B13D; Wed, 12 Aug 2020 14:50:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C5F8384B13D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1597243853; bh=MMKSCeA6AEDnH2Cti/rA+f3er7k8tqQlG/DUDWdOwgw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ZKVWiqjeOIuxQbktEKFsvTpQK9i7Vfj2lS+rnSsrN2hQnT8WdF6WphN8wp5qcKsyb w6CeJlZcP4jJ68D+fCOoViU+fIRjsNUSI8XEyI/IE/mqFqbZnZ0UUiupM/Aflbo+p5 oQm/CilhMH0F5AvmaWQ8LvlB6bf0WL05YmuR4QwA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by sourceware.org (Postfix) with ESMTPS id EB64D3857C40 for <libc-alpha@sourceware.org>; Wed, 12 Aug 2020 14:50:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EB64D3857C40 IronPort-SDR: 5dAqzbU6NPWsAJyJsQVIJUmY2RJJ0AfGRGUZA1jl2g5iGs8N6G5mnL3uK0C1pOSFY2McyNbwgb XGrAupyUH2djVsOOH6BwEWWCPNPirT02TtWfHvUExBiDXKN2oh65BrgNP6hds76qYD0MVa/hEq mCuwaI+GRSSfieE7kX4dfqtkcCsCbg5vs4S9c4yJhLPVeEvUE5beOGyOQ44qbJzbk6V0B9ZCbX bUGHqjmw2pW2pHOWiHjTAZEPHfhVK/oNEWydplDHCQtGBjShDcEn1rsoj5hLkMLU1czevnXpQk Q/c= X-IronPort-AV: E=Sophos;i="5.76,304,1592841600"; d="scan'208";a="145996634" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 12 Aug 2020 22:50:52 +0800 IronPort-SDR: vKQxcNukyDrpL67kiIXLfDaxGIHZ1zEMKVTlUpiXOnvmvkx0yJ4oit9qAgFnQ7LWF3QOiQAeMi bVj3xJOlCK5w== Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2020 07:38:42 -0700 IronPort-SDR: StRXEalrT9zMFjPgjqCqCNk4LWiaZ094HQzHKaut8qu/3jFIHw7w86VuTfl37TnfqegRSltN53 66Di9JXdJs5Q== WDCIronportException: Internal Received: from jbfyk72.ad.shared (HELO risc6-mainframe.hgst.com) ([10.86.59.14]) by uls-op-cesaip01.wdc.com with ESMTP; 12 Aug 2020 07:50:49 -0700 To: libc-alpha@sourceware.org Subject: [PATCH v4 02/18] RISC-V: Cleanup some of the sysdep.h code Date: Wed, 12 Aug 2020 07:40:50 -0700 Message-Id: <c1e18d8cf073268918f93bff10b44519333625c0.1597243100.git.alistair.francis@wdc.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <cover.1597243100.git.alistair.francis@wdc.com> References: <cover.1597243100.git.alistair.francis@wdc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP 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 <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Alistair Francis via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Alistair Francis <alistair.francis@wdc.com> Cc: macro@wdc.com, alistair.francis@wdc.com Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
glibc port for 32-bit RISC-V (RV32)
|
|
Commit Message
Alistair Francis
Aug. 12, 2020, 2:40 p.m. UTC
Remove a duplicate inclusion of <sysdeps/unix/sysdep.h> which is already pulled via <sysdeps/unix/sysv/linux/generic/sysdep.h>, and the inclusion of <errno.h> whose definition of `__set_errno' is not needed here. --- sysdeps/unix/sysv/linux/riscv/sysdep.h | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-)
Comments
On Wed, 12 Aug 2020, Alistair Francis wrote: > diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h > index 83e4adf6a2..fbc2436691 100644 > --- a/sysdeps/unix/sysv/linux/riscv/sysdep.h > +++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h [...] > @@ -107,19 +110,7 @@ > # undef ret_ERRVAL > # define ret_ERRVAL ret > > -#endif /* __ASSEMBLER__ */ > - > -/* In order to get __set_errno() definition in INLINE_SYSCALL. */ > -#ifndef __ASSEMBLER__ > -# include <errno.h> > -#endif > - > -#include <sysdeps/unix/sysdep.h> > - > -#undef SYS_ify > -#define SYS_ify(syscall_name) __NR_##syscall_name > - > -#ifndef __ASSEMBLER__ > +#else Please comment #else: #else /* !__ASSEMBLER__ */ especially as the conditional part above is very long. Otherwise OK. This is not actually mentioned in our coding style document, unlike #endif, giving an impression we don't want #else statements commented: <https://sourceware.org/glibc/wiki/Style_and_Conventions#Commenting_.23endif>. This is however covered by the generic GNU Coding Standards document: <https://www.gnu.org/prep/standards/standards.html#Comments>. Carlos: Do we want our wiki updated here? ISTM we should. WDYT? Maciej
On 8/17/20 9:53 AM, Maciej W. Rozycki wrote: > On Wed, 12 Aug 2020, Alistair Francis wrote: > >> diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h >> index 83e4adf6a2..fbc2436691 100644 >> --- a/sysdeps/unix/sysv/linux/riscv/sysdep.h >> +++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h > [...] >> @@ -107,19 +110,7 @@ >> # undef ret_ERRVAL >> # define ret_ERRVAL ret >> >> -#endif /* __ASSEMBLER__ */ >> - >> -/* In order to get __set_errno() definition in INLINE_SYSCALL. */ >> -#ifndef __ASSEMBLER__ >> -# include <errno.h> >> -#endif >> - >> -#include <sysdeps/unix/sysdep.h> >> - >> -#undef SYS_ify >> -#define SYS_ify(syscall_name) __NR_##syscall_name >> - >> -#ifndef __ASSEMBLER__ >> +#else > > Please comment #else: > > #else /* !__ASSEMBLER__ */ > > especially as the conditional part above is very long. Otherwise OK. > > This is not actually mentioned in our coding style document, unlike > #endif, giving an impression we don't want #else statements commented: > <https://sourceware.org/glibc/wiki/Style_and_Conventions#Commenting_.23endif>. > This is however covered by the generic GNU Coding Standards document: > <https://www.gnu.org/prep/standards/standards.html#Comments>. > > Carlos: Do we want our wiki updated here? ISTM we should. WDYT? Yes! The GNU Coding Standard explains that we should comment #else, but doesn't say what kind of comment should be used, and that content is up to the project. The section should cover how glibc is unique and what we expect from the #else comment. Your suggestion looks good to me.
On Tue, 18 Aug 2020, Carlos O'Donell wrote: > > Please comment #else: > > > > #else /* !__ASSEMBLER__ */ > > > > especially as the conditional part above is very long. Otherwise OK. > > > > This is not actually mentioned in our coding style document, unlike > > #endif, giving an impression we don't want #else statements commented: > > <https://sourceware.org/glibc/wiki/Style_and_Conventions#Commenting_.23endif>. > > This is however covered by the generic GNU Coding Standards document: > > <https://www.gnu.org/prep/standards/standards.html#Comments>. > > > > Carlos: Do we want our wiki updated here? ISTM we should. WDYT? > > Yes! > > The GNU Coding Standard explains that we should comment #else, but doesn't > say what kind of comment should be used, and that content is up to the > project. > > The section should cover how glibc is unique and what we expect from the > #else comment. > > Your suggestion looks good to me. I have updated the wiki then, thank you for your opinion. Also we don't explicitly mention #elif, but I think it can be implied that the convention followed for conditional parts beyond that directive is the same as with plain #if. Maciej
diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h index 83e4adf6a2..fbc2436691 100644 --- a/sysdeps/unix/sysv/linux/riscv/sysdep.h +++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h @@ -22,6 +22,9 @@ #include <sysdeps/unix/sysv/linux/generic/sysdep.h> #include <tls.h> +#undef SYS_ify +#define SYS_ify(syscall_name) __NR_##syscall_name + #ifdef __ASSEMBLER__ # include <sys/asm.h> @@ -107,19 +110,7 @@ # undef ret_ERRVAL # define ret_ERRVAL ret -#endif /* __ASSEMBLER__ */ - -/* In order to get __set_errno() definition in INLINE_SYSCALL. */ -#ifndef __ASSEMBLER__ -# include <errno.h> -#endif - -#include <sysdeps/unix/sysdep.h> - -#undef SYS_ify -#define SYS_ify(syscall_name) __NR_##syscall_name - -#ifndef __ASSEMBLER__ +#else # define VDSO_NAME "LINUX_4.15" # define VDSO_HASH 182943605