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-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id C41051F5AE for ; Tue, 7 Jul 2020 22:07:12 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 00DBD3861802; Tue, 7 Jul 2020 22:07:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 00DBD3861802 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1594159622; bh=Zh+YvtGtrUY3p/U6YSGbf3JwtLdMoUOwh2i3JS9kfjw=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=G9iyOkVbCRO8jlWhT5IOMmasHktQQOlWI2AapyZoe870wOpScWMAkIz1FsLAmYhHD hmYFxeMI/QiTsTPsSShoS04CQlTUNAzDmtPWRGeWWEwygOrdBlql5+2zwPdWpL1OGf e38u74cQXgC4kPMkJ7gr4lDa3bGV7Df9+kNdfaKU= Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by sourceware.org (Postfix) with ESMTPS id 6BBCC385ED4B for ; Tue, 7 Jul 2020 22:06:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6BBCC385ED4B IronPort-SDR: O+aFUpSIOs+naUomHmgNhH5H4kVTjoqyi3XxfRkWauKEIjHREaDbJO8OsIqaVfk7UohzYUnaPb /3tuRA+LTIa2cq2tzKz42vhLGiSI4+IbR1cpIu41RknnqRqmK0K7u2+4gBr8gCJpxeu8o45sd9 lDEeK2vHaBIn+RubDczSEWpq8Z6kqrIThONlK4Dmh7KksICdtwEDObrSk7NK0k8lHypgZHpaLW yzzA+l7mgoxi8QC2q9kwDaOjhy9Q2rf+ahu1jCBLKqALRgTAvgcY5JOvOXMsTXUEhNXIhY1/+N ztU= X-IronPort-AV: E=Sophos;i="5.75,325,1589212800"; d="scan'208";a="244890980" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 08 Jul 2020 06:08:39 +0800 IronPort-SDR: Kn4u/yDCuki8MK20CEdA1i9dy9XUukFqyCpcO5LqG11ehs9Y3yCQr+Cdvk6nAOOPkmBqNFEIUP hmbIl98ZhokePdS9+WKhjkIqGBToaMCVs= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2020 14:55:02 -0700 IronPort-SDR: XTvR+PRIgMO4jCOip75tRDVM/FBrImkIv4Mn2sl/YR37uO4HFXvcyCAfCwIQ2HfdRnnJKwMOw9 lcse72NXweCw== WDCIronportException: Internal Received: from unknown (HELO redsun52) ([10.149.66.28]) by uls-op-cesaip02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2020 15:06:56 -0700 Date: Tue, 7 Jul 2020 23:06:52 +0100 (BST) To: Alistair Francis Subject: Re: [PATCH v2 01/18] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64 In-Reply-To: <04882fb114ae3d8b2621dd5438682f1bdb316d84.1591201405.git.alistair.francis@wdc.com> Message-ID: References: <04882fb114ae3d8b2621dd5438682f1bdb316d84.1591201405.git.alistair.francis@wdc.com> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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: , From: "Maciej W. Rozycki via Libc-alpha" Reply-To: "Maciej W. Rozycki" Cc: libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" On Wed, 3 Jun 2020, Alistair Francis via Libc-alpha wrote: > Using the original glibc headers under bits/ let's make small > modifications to use 64-bit time_t and off_t for both RV32 and RV64. > > For the typesizes.h, here are justifications for the changes from the > generic version (based on Arnd's very helpful feedback): > - All the !__USE_FILE_OFFSET64 types (__off_t, __ino_t, __rlim_t, ...) are ^^ ^^ Please remove extraneous spaces above. > changed to match the 64-bit replacements. > > - __time_t is defined to 64 bit, but no __time64_t is added. This makes sense > as we don't have the time64 support for other 32-bit architectures yet, and > it will be easy to change when that happens. > > - __suseconds_t is 64-bit. This matches what we use the kernel ABI for the > few drivers that are relying on 'struct timeval' input arguments in > ioctl, as well as the adjtimex system call. It means that timeval has to > be defined without the padding, unlike timespec, which needs padding. ^^^ Likewise. The commit description will be indented by 4 when presented by `git log', etc., so please reformat so as to stay within 74-75 columns to avoid line wrapping. Also use two spaces after the end of a sentence throughout. Please apply these guidelines across the whole series. > diff --git a/sysdeps/unix/sysv/linux/riscv/bits/environments.h b/sysdeps/unix/sysv/linux/riscv/bits/environments.h > new file mode 100644 > index 0000000000..c1768af17b > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/riscv/bits/environments.h > @@ -0,0 +1,85 @@ > +/* Copyright (C) 2019-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 > + . */ We've switched to HTTPS, so: . > +/* This header should define the following symbols under the described > + situations. A value `1' means that the model is always supported, > + `-1' means it is never supported. Undefined means it cannot be > + statically decided. > + > + _POSIX_V7_ILP32_OFF32 32bit int, long, pointers, and off_t type > + _POSIX_V7_ILP32_OFFBIG 32bit int, long, and pointers and larger off_t type > + > + _POSIX_V7_LP64_OFF32 64bit long and pointers and 32bit off_t type > + _POSIX_V7_LPBIG_OFFBIG 64bit long and pointers and large off_t type Stray tab after _POSIX_V7_LP64_OFF32? > +#else /* __WORDSIZE == 32 */ > + > +/* RISC-V requires 64-bit off_t > + # undef _POSIX_V7_ILP32_OFF32 > + # undef _POSIX_V6_ILP32_OFF32 > + # undef _XBS5_ILP32_OFF32 > + */ If 64-bit `off_t' is required, then shouldn't these be #define'd to -1 instead? Otherwise under what circumstances support for these models will have to be determined at run time? +# define _POSIX_V7_ILP32_OFFBIG 1 +# define _POSIX_V6_ILP32_OFFBIG 1 +# define _XBS5_ILP32_OFFBIG 1 Please use tabs here like with the rest of the macros. > +/* CFLAGS. */ > +#define __ILP32_OFFBIG_CFLAGS "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" Likewise if 64-bit `off_t' is required, then why do we have to define these macros in CFLAGS and what happens if they aren't defined? Please use a tab here as well (assuming this macro does have to exist). > diff --git a/sysdeps/unix/sysv/linux/riscv/bits/time64.h b/sysdeps/unix/sysv/linux/riscv/bits/time64.h > new file mode 100644 > index 0000000000..7ba0dd1cfd > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/riscv/bits/time64.h > @@ -0,0 +1,36 @@ > +/* bits/time64.h -- underlying types for __time64_t. Generic version. "RISC-V version." presumably? > + Copyright (C) 2019-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 > + . */ > diff --git a/sysdeps/unix/sysv/linux/riscv/bits/timesize.h b/sysdeps/unix/sysv/linux/riscv/bits/timesize.h > new file mode 100644 > index 0000000000..78394b7489 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/riscv/bits/timesize.h > @@ -0,0 +1,22 @@ > +/* Bit size of the time_t type at glibc build time, general case. "RISC-V case."? > + Copyright (C) 2019-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 > + . */ > diff --git a/sysdeps/unix/sysv/linux/riscv/kernel_stat.h b/sysdeps/unix/sysv/linux/riscv/kernel_stat.h > new file mode 100644 > index 0000000000..25e698b9bf > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/riscv/kernel_stat.h > @@ -0,0 +1,23 @@ > +/* Copyright (C) 2019-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 > + . */ Maciej