From patchwork Thu Jul 10 02:19:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Huber X-Patchwork-Id: 116006 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 46F03385772F for ; Thu, 10 Jul 2025 02:20:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 46F03385772F X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id 5093D3858C56 for ; Thu, 10 Jul 2025 02:19:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5093D3858C56 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5093D3858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=85.10.215.148 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752113966; cv=none; b=GtcdzJrkWB886l8hpIRg/qvHqfs+h8nvytxGJ3etarl5Ug56ypkZBSfgEaezqEPITSlp2L8j7WVTW8uujlRI8DXGwL8uc3V5S0OjiDZLBr7nnVaQ+5hNkReBB8qOrWovCY/HGPdenKZFt0GCkJPBYPSkXUtkdXBdMr/crN0sQgM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752113966; c=relaxed/simple; bh=RaK1bYnLv8QkuZ+0M75osIbsH48ZaBMIQMnjPvT55o8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=NHxiKhL9r9Wn0VUvDEyiMlzTT7Rdik6pVZAVsp4yTEbwB/i/qsTEnA435vFOnGGAUB59UI0Nf4hHyDZh3FnlgW2Dhmy9/89T8YJUh+5R7+5s4pD25cTP/w74FJQRL9F+CWe0VF4EeeSAnZBxRBY84DyjrAW8d/xSSoMq5vxViqM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5093D3858C56 Received: from sslproxy06.your-server.de ([78.46.172.3]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1uZgsd-000KHS-2W for newlib@sourceware.org; Thu, 10 Jul 2025 04:19:23 +0200 Received: from localhost ([127.0.0.1]) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uZgsd-000Dde-2A for newlib@sourceware.org; Thu, 10 Jul 2025 04:19:23 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 37D5848018E for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10032) with ESMTP id HO2J2zXryR1j for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id BC207480192 for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) X-Virus-Scanned: amavis at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10026) with ESMTP id RvSe0OIGzkUP for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 8DA3B480157 for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) From: Sebastian Huber To: newlib@sourceware.org Subject: [PATCH 1/7] tcp: LRO timestamps have lost their previous precision Date: Thu, 10 Jul 2025 04:19:12 +0200 Message-ID: <20250710021918.112394-2-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250710021918.112394-1-sebastian.huber@embedded-brains.de> References: <20250710021918.112394-1-sebastian.huber@embedded-brains.de> MIME-Version: 1.0 X-Virus-Scanned: Clear (ClamAV 1.0.7/27694/Wed Jul 9 10:42:34 2025) X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Randall Stewart Recently we had a rewrite to tcp_lro.c that was tested but one subtle change was the move to a less precise timestamp. This causes all kinds of chaos in tcp's that do pacing and needs to be fixed to use the more precise time that was there before. Reviewed by: mtuexen, gallatin, hselasky Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30695 --- newlib/libc/include/sys/time.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h index 5a3dec7ab..4062df728 100644 --- a/newlib/libc/include/sys/time.h +++ b/newlib/libc/include/sys/time.h @@ -281,6 +281,17 @@ bintime2timespec(const struct bintime *_bt, struct timespec *_ts) (uint32_t)(_bt->frac >> 32)) >> 32; } +static __inline uint64_t +bintime2ns(const struct bintime *_bt) +{ + uint64_t ret; + + ret = (uint64_t)(_bt->sec) * (uint64_t)1000000000; + ret += (((uint64_t)1000000000 * + (uint32_t)(_bt->frac >> 32)) >> 32); + return (ret); +} + static __inline void timespec2bintime(const struct timespec *_ts, struct bintime *_bt) { From patchwork Thu Jul 10 02:19:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Huber X-Patchwork-Id: 116010 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 B2C313857820 for ; Thu, 10 Jul 2025 02:21:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B2C313857820 X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id 54FA93858C24 for ; Thu, 10 Jul 2025 02:19:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 54FA93858C24 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 54FA93858C24 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=85.10.215.148 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752113966; cv=none; b=Ms5BkC3Tu7odSozsz0yAHcr+7YIpWxbSNp7vUF7xYX3xUKV65qHXB/0EjK/c++qWDWDBZ71ZOVZ0uf14ldUlN5IMS5KxpFAGQ+hHm+SnjanSdk+fmMU7MDREhM+ajYaeILsvMot8ITFhyGBP6sxX8nyfwj4HaQ/WFu0pb9fiDX4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752113966; c=relaxed/simple; bh=uzUT0kE3kZD8JTt+qYmH/A+LHAAPxNQsXHUYVULLs9g=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=qK9GYkGBJN0h/2HRQhvQgyGGnwZje/EmwEBYzHLE8AZTuQ1gQdE60/2UtG2VJ1fcNoRmO1xK2s5v4790MTZu2FGFoojyF98izbP6QRSG7SB9ZdTZsb4DzD4y5KkSp12SqhXSpRNzQr2+kRFFFvSU5ZVQU2l4ViugIGK0CGZil94= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54FA93858C24 Received: from sslproxy06.your-server.de ([78.46.172.3]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1uZgsd-000KHR-2Y for newlib@sourceware.org; Thu, 10 Jul 2025 04:19:23 +0200 Received: from localhost ([127.0.0.1]) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uZgsd-000DdV-26 for newlib@sourceware.org; Thu, 10 Jul 2025 04:19:23 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 343B8480197 for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10032) with ESMTP id 5ayk38CrRgKV for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id CBCC648014F for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) X-Virus-Scanned: amavis at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10026) with ESMTP id HUtCzIkVc6iz for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 99B01480179 for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) From: Sebastian Huber To: newlib@sourceware.org Subject: [PATCH 2/7] Add timespecvalid_interval macro and use it. Date: Thu, 10 Jul 2025 04:19:13 +0200 Message-ID: <20250710021918.112394-3-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250710021918.112394-1-sebastian.huber@embedded-brains.de> References: <20250710021918.112394-1-sebastian.huber@embedded-brains.de> MIME-Version: 1.0 X-Virus-Scanned: Clear (ClamAV 1.0.7/27694/Wed Jul 9 10:42:34 2025) X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Dmitry Chagin Reviewed by: jhb, imp (early rev) Differential revision: https://reviews.freebsd.org/D34848 MFC after: 2 weeks --- newlib/libc/include/sys/time.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h index 4062df728..006d1f663 100644 --- a/newlib/libc/include/sys/time.h +++ b/newlib/libc/include/sys/time.h @@ -378,6 +378,8 @@ tvtosbt(struct timeval _tv) (vsp)->tv_nsec += 1000000000L; \ } \ } while (0) +#define timespecvalid_interval(tsp) ((tsp)->tv_sec >= 0 && \ + (tsp)->tv_nsec >= 0 && (tsp)->tv_nsec < 1000000000L) #ifndef _KERNEL /* NetBSD/OpenBSD compatible interfaces */ From patchwork Thu Jul 10 02:19:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Huber X-Patchwork-Id: 116008 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 8D2FE3858280 for ; Thu, 10 Jul 2025 02:21:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D2FE3858280 X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id C6747385840C for ; Thu, 10 Jul 2025 02:19:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C6747385840C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C6747385840C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=85.10.215.148 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752113969; cv=none; b=BgpW5lDmNUo1+eI78XvP8+bPykKMhR+DTgxS49OaUdsd2CTVZAD2r3I7HVMVen7/9A042mBl4fANdB4/Ko7v/G6s9FSbLqrj/+DfnUkC0nfTE1OfpzyNqafsphX7KiTduMympvRuhvGChgE0aNI4nAyupxvtVmADlpYYp+GNhRE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752113969; c=relaxed/simple; bh=otB836TuPvTx0qY7orauAbxf6Zle9rGf7sqTJ1W/4jU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=qJKek2fyPSip4WqDW3l5ehrWpKrx/HZe8LKI9MP1V7CA1rtAtT0aOTTcYJ8NbbXrau/HBvCLNmiQ+vdsZlAwdw8htVfQgCz0Y84fbtfm0hjWtFqbi7zNZZy44uetdtCecNqSWmKc1ewdyCYg9cimo/xUl+O2xCsg+1y32PVfPTs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6747385840C Received: from sslproxy06.your-server.de ([78.46.172.3]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1uZgsd-000KHV-2e for newlib@sourceware.org; Thu, 10 Jul 2025 04:19:23 +0200 Received: from localhost ([127.0.0.1]) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uZgsd-000Ddw-2K for newlib@sourceware.org; Thu, 10 Jul 2025 04:19:23 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 3A23648014F for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10032) with ESMTP id vzEuTL2F-pHN for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id D6065480157 for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) X-Virus-Scanned: amavis at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10026) with ESMTP id 3ihKDEMuP-li for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id A7C8E480184 for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) From: Sebastian Huber To: newlib@sourceware.org Subject: [PATCH 3/7] Fix overflow errors in sbttous and sbttoms Date: Thu, 10 Jul 2025 04:19:14 +0200 Message-ID: <20250710021918.112394-4-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250710021918.112394-1-sebastian.huber@embedded-brains.de> References: <20250710021918.112394-1-sebastian.huber@embedded-brains.de> MIME-Version: 1.0 X-Virus-Scanned: Clear (ClamAV 1.0.7/27694/Wed Jul 9 10:42:34 2025) X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Alan Somers Both of these functions would overflow for very large inputs. Add tests for them. Also, add tests for the inverse functions, *stosbt, whose overflow errors were fixed by 4c30b9ecd47. PR: 263073 MFC after: 1 week Sponsored by: Axcient Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D34809 --- newlib/libc/include/sys/time.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h index 006d1f663..35575d59d 100644 --- a/newlib/libc/include/sys/time.h +++ b/newlib/libc/include/sys/time.h @@ -220,7 +220,11 @@ static __inline int64_t sbttous(sbintime_t _sbt) { - return ((1000000 * _sbt) >> 32); +#ifdef KASSERT + KASSERT(_sbt >= 0, ("Negative values illegal for sbttous: %jx", _sbt)); +#endif + return ((_sbt >> 32) * 1000000 + + (1000000 * (_sbt & 0xffffffffu) >> 32)); } static __inline sbintime_t @@ -240,8 +244,10 @@ ustosbt(int64_t _us) static __inline int64_t sbttoms(sbintime_t _sbt) { - - return ((1000 * _sbt) >> 32); +#ifdef KASSERT + KASSERT(_sbt >= 0, ("Negative values illegal for sbttoms: %jx", _sbt)); +#endif + return ((_sbt >> 32) * 1000 + (1000 * (_sbt & 0xffffffffu) >> 32)); } static __inline sbintime_t From patchwork Thu Jul 10 02:19:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Huber X-Patchwork-Id: 116009 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 1BF6E3857C7B for ; Thu, 10 Jul 2025 02:21:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1BF6E3857C7B X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id 20959385842D for ; Thu, 10 Jul 2025 02:19:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 20959385842D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 20959385842D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=85.10.215.148 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752113970; cv=none; b=RRBIbXXhgi82625mawuMV7qJGOsglOBGBYO59On2pnRIAUk9bJopeBGJI1u9DiWgVjytzuotlUJlPMHvrneoFQUOd7k/eN1sQ0p03PG3JWB31QL6mzpJkpeF1je4sa++4AdC3fh0OHAa9nUfRNowJ76psFSbqfoQGZ7OtJIrQ+E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752113970; c=relaxed/simple; bh=KECch0aRlEokZEjMXeT6TuiWUhkL6CaP4cY4lodTkzA=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=EEkC/Qj0ZP2aWy/xZ30F8rwdRI48evnMRitbI+gjhKXmhhL9He0l84ZN8u38Nz6sKSotccAWLEZ+w9ukNz185Wnehk738Wlh13FomOUZSukmz8oyxLpdbN1d9hHCTLESyfPjkjY3GtMrUG7kp0h0zn8CWLrnVPNEbvlFiYAxFhM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 20959385842D Received: from sslproxy06.your-server.de ([78.46.172.3]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1uZgsj-000KHk-0Y for newlib@sourceware.org; Thu, 10 Jul 2025 04:19:29 +0200 Received: from localhost ([127.0.0.1]) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uZgse-000DfY-05 for newlib@sourceware.org; Thu, 10 Jul 2025 04:19:24 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 7DC14480192 for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10032) with ESMTP id gdtjzokKCCpk for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id D9651480198 for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) X-Virus-Scanned: amavis at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10026) with ESMTP id 4SrKYCfRLC6i for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id B76D1480191 for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) From: Sebastian Huber To: newlib@sourceware.org Subject: [PATCH 4/7] time(3): Increase precision of time conversion functions by using gcd. Date: Thu, 10 Jul 2025 04:19:15 +0200 Message-ID: <20250710021918.112394-5-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250710021918.112394-1-sebastian.huber@embedded-brains.de> References: <20250710021918.112394-1-sebastian.huber@embedded-brains.de> MIME-Version: 1.0 X-Virus-Scanned: Clear (ClamAV 1.0.7/27694/Wed Jul 9 10:42:34 2025) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Hans Petter Selasky When converting times to and from units which have many leading zeros, it pays off to compute the greatest common divisor first, and then do the scaling product. This way all time unit conversion comes down to scaling a signed or unsigned 64-bit value by a fraction represented by two signed or unsigned 32-bit integers. SBT_1S is defined as 2^32 . When scaling using powers of 10 above 1, the gcd of SBT_1S and 10^N is always greater than or equal to 4, when N is greater or equal to 2. Scaling a sbt value to milliseconds is then done by multiplying by (1000 / 8) and dividing by (2^32 / 8). This trick allows for higher precision at very little additional CPU cost. It shall also be noted that the Xtosbt() functions prior to this patch, sometimes were off-by-one: For example when converting 1 / 8 of a second to sbt as 125ms the old sbt conversion function would compute 0x20000001 while the new function computes 0x20000000 which multiplied by 8 becomes SBT_1S, which is the correct value. Reviewed by: kib@ Differential Revision: https://reviews.freebsd.org/D36857 MFC after: 1 week Sponsored by: NVIDIA Networking --- newlib/libc/include/sys/time.h | 179 +++++++++++++++++++-------------- 1 file changed, 101 insertions(+), 78 deletions(-) diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h index 35575d59d..aa702980c 100644 --- a/newlib/libc/include/sys/time.h +++ b/newlib/libc/include/sys/time.h @@ -168,102 +168,124 @@ sbttobt(sbintime_t _sbt) } /* - * Decimal<->sbt conversions. Multiplying or dividing by SBT_1NS results in - * large roundoff errors which sbttons() and nstosbt() avoid. Millisecond and - * microsecond functions are also provided for completeness. - * - * These functions return the smallest sbt larger or equal to the - * number of seconds requested so that sbttoX(Xtosbt(y)) == y. Unlike - * top of second computations below, which require that we tick at the - * top of second, these need to be rounded up so we do whatever for at - * least as long as requested. - * - * The naive computation we'd do is this - * ((unit * 2^64 / SIFACTOR) + 2^32-1) >> 32 - * However, that overflows. Instead, we compute - * ((unit * 2^63 / SIFACTOR) + 2^31-1) >> 32 - * and use pre-computed constants that are the ceil of the 2^63 / SIFACTOR - * term to ensure we are using exactly the right constant. We use the lesser - * evil of ull rather than a uint64_t cast to ensure we have well defined - * right shift semantics. With these changes, we get all the ns, us and ms - * conversions back and forth right. + * Scaling functions for signed and unsigned 64-bit time using any + * 32-bit fraction: */ + static __inline int64_t -sbttons(sbintime_t _sbt) +__stime64_scale32_ceil(int64_t x, int32_t factor, int32_t divisor) { - uint64_t ns; + const int64_t rem = x % divisor; - ns = _sbt; - if (ns >= SBT_1S) - ns = (ns >> 32) * 1000000000; - else - ns = 0; + return (x / divisor * factor + (rem * factor + divisor - 1) / divisor); +} - return (ns + (1000000000 * (_sbt & 0xffffffffu) >> 32)); +static __inline int64_t +__stime64_scale32_floor(int64_t x, int32_t factor, int32_t divisor) +{ + const int64_t rem = x % divisor; + + return (x / divisor * factor + (rem * factor) / divisor); } -static __inline sbintime_t -nstosbt(int64_t _ns) +static __inline uint64_t +__utime64_scale32_ceil(uint64_t x, uint32_t factor, uint32_t divisor) { - sbintime_t sb = 0; + const uint64_t rem = x % divisor; - if (_ns >= SBT_1S) { - sb = (_ns / 1000000000) * SBT_1S; - _ns = _ns % 1000000000; - } - /* 9223372037 = ceil(2^63 / 1000000000) */ - sb += ((_ns * 9223372037ull) + 0x7fffffff) >> 31; - return (sb); + return (x / divisor * factor + (rem * factor + divisor - 1) / divisor); } -static __inline int64_t -sbttous(sbintime_t _sbt) +static __inline uint64_t +__utime64_scale32_floor(uint64_t x, uint32_t factor, uint32_t divisor) { + const uint64_t rem = x % divisor; -#ifdef KASSERT - KASSERT(_sbt >= 0, ("Negative values illegal for sbttous: %jx", _sbt)); -#endif - return ((_sbt >> 32) * 1000000 + - (1000000 * (_sbt & 0xffffffffu) >> 32)); + return (x / divisor * factor + (rem * factor) / divisor); } -static __inline sbintime_t -ustosbt(int64_t _us) +/* + * This function finds the common divisor between the two arguments, + * in powers of two. Use a macro, so the compiler will output a + * warning if the value overflows! + * + * Detailed description: + * + * Create a variable with 1's at the positions of the leading 0's + * starting at the least significant bit, producing 0 if none (e.g., + * 01011000 -> 0000 0111). Then these two variables are bitwise AND'ed + * together, to produce the greatest common power of two minus one. In + * the end add one to flip the value to the actual power of two (e.g., + * 0000 0111 + 1 -> 0000 1000). + */ +#define __common_powers_of_two(a, b) \ + ((~(a) & ((a) - 1) & ~(b) & ((b) - 1)) + 1) + +/* + * Scaling functions for signed and unsigned 64-bit time assuming + * reducable 64-bit fractions to 32-bit fractions: + */ + +static __inline int64_t +__stime64_scale64_ceil(int64_t x, int64_t factor, int64_t divisor) { - sbintime_t sb = 0; + const int64_t gcd = __common_powers_of_two(factor, divisor); - if (_us >= SBT_1S) { - sb = (_us / 1000000) * SBT_1S; - _us = _us % 1000000; - } - /* 9223372036855 = ceil(2^63 / 1000000) */ - sb += ((_us * 9223372036855ull) + 0x7fffffff) >> 31; - return (sb); + return (__stime64_scale32_ceil(x, factor / gcd, divisor / gcd)); } static __inline int64_t -sbttoms(sbintime_t _sbt) +__stime64_scale64_floor(int64_t x, int64_t factor, int64_t divisor) { -#ifdef KASSERT - KASSERT(_sbt >= 0, ("Negative values illegal for sbttoms: %jx", _sbt)); -#endif - return ((_sbt >> 32) * 1000 + (1000 * (_sbt & 0xffffffffu) >> 32)); + const int64_t gcd = __common_powers_of_two(factor, divisor); + + return (__stime64_scale32_floor(x, factor / gcd, divisor / gcd)); } -static __inline sbintime_t -mstosbt(int64_t _ms) +static __inline uint64_t +__utime64_scale64_ceil(uint64_t x, uint64_t factor, uint64_t divisor) { - sbintime_t sb = 0; + const uint64_t gcd = __common_powers_of_two(factor, divisor); - if (_ms >= SBT_1S) { - sb = (_ms / 1000) * SBT_1S; - _ms = _ms % 1000; - } - /* 9223372036854776 = ceil(2^63 / 1000) */ - sb += ((_ms * 9223372036854776ull) + 0x7fffffff) >> 31; - return (sb); + return (__utime64_scale32_ceil(x, factor / gcd, divisor / gcd)); +} + +static __inline uint64_t +__utime64_scale64_floor(uint64_t x, uint64_t factor, uint64_t divisor) +{ + const uint64_t gcd = __common_powers_of_two(factor, divisor); + + return (__utime64_scale32_floor(x, factor / gcd, divisor / gcd)); +} + +/* + * Decimal<->sbt conversions. Multiplying or dividing by SBT_1NS + * results in large roundoff errors which sbttons() and nstosbt() + * avoid. Millisecond and microsecond functions are also provided for + * completeness. + * + * When converting from sbt to another unit, the result is always + * rounded down. When converting back to sbt the result is always + * rounded up. This gives the property that sbttoX(Xtosbt(y)) == y . + * + * The conversion functions can also handle negative values. + */ +#define SBT_DECLARE_CONVERSION_PAIR(name, units_per_second) \ +static __inline int64_t \ +sbtto##name(sbintime_t sbt) \ +{ \ + return (__stime64_scale64_floor(sbt, units_per_second, SBT_1S)); \ +} \ +static __inline sbintime_t \ +name##tosbt(int64_t name) \ +{ \ + return (__stime64_scale64_ceil(name, SBT_1S, units_per_second)); \ } +SBT_DECLARE_CONVERSION_PAIR(ns, 1000000000) +SBT_DECLARE_CONVERSION_PAIR(us, 1000000) +SBT_DECLARE_CONVERSION_PAIR(ms, 1000) + /*- * Background information: * @@ -283,8 +305,8 @@ bintime2timespec(const struct bintime *_bt, struct timespec *_ts) { _ts->tv_sec = _bt->sec; - _ts->tv_nsec = ((uint64_t)1000000000 * - (uint32_t)(_bt->frac >> 32)) >> 32; + _ts->tv_nsec = __utime64_scale64_floor( + _bt->frac, 1000000000, 1ULL << 32) >> 32; } static __inline uint64_t @@ -293,8 +315,8 @@ bintime2ns(const struct bintime *_bt) uint64_t ret; ret = (uint64_t)(_bt->sec) * (uint64_t)1000000000; - ret += (((uint64_t)1000000000 * - (uint32_t)(_bt->frac >> 32)) >> 32); + ret += __utime64_scale64_floor( + _bt->frac, 1000000000, 1ULL << 32) >> 32; return (ret); } @@ -303,8 +325,8 @@ timespec2bintime(const struct timespec *_ts, struct bintime *_bt) { _bt->sec = _ts->tv_sec; - /* 18446744073 = int(2^64 / 1000000000) */ - _bt->frac = _ts->tv_nsec * (uint64_t)18446744073LL; + _bt->frac = __utime64_scale64_floor( + (uint64_t)_ts->tv_nsec << 32, 1ULL << 32, 1000000000); } static __inline void @@ -312,7 +334,8 @@ bintime2timeval(const struct bintime *_bt, struct timeval *_tv) { _tv->tv_sec = _bt->sec; - _tv->tv_usec = ((uint64_t)1000000 * (uint32_t)(_bt->frac >> 32)) >> 32; + _tv->tv_usec = __utime64_scale64_floor( + _bt->frac, 1000000, 1ULL << 32) >> 32; } static __inline void @@ -320,8 +343,8 @@ timeval2bintime(const struct timeval *_tv, struct bintime *_bt) { _bt->sec = _tv->tv_sec; - /* 18446744073709 = int(2^64 / 1000000) */ - _bt->frac = _tv->tv_usec * (uint64_t)18446744073709LL; + _bt->frac = __utime64_scale64_floor( + (uint64_t)_tv->tv_usec << 32, 1ULL << 32, 1000000); } static __inline struct timespec From patchwork Thu Jul 10 02:19:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Huber X-Patchwork-Id: 116011 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 5149A3858C24 for ; Thu, 10 Jul 2025 02:22:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5149A3858C24 X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id 161713858420 for ; Thu, 10 Jul 2025 02:19:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 161713858420 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 161713858420 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=85.10.215.148 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752113970; cv=none; b=LqtVf9BvtkJ+MYEvmsGeihC1ePfww84/GMQd1jIXb5ZfI+/J74i7+Ob0IgFNeEPtAX/OjJ+gTOJC7wfcflSrYQEAy3t5EPxH6wk5Io/tlndYVjW/gCSz90+fccnZiaq8o+jhMYCOORopMZaE6wIIkWhKnuMBHtyfKKxT1oTiglg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752113970; c=relaxed/simple; bh=RTNPvEHp5VWE3Cn55Fodv0xXo9RsTWhR792TKywM/IU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=vE0uuMNLzK4JvXAIUJaKCuVW9nASX6t+XlGdO2yFSk7oJOwlVbuZVvddY8IichVOjspKfsABHWiwyUMyswehUYMVBrunPMI1Vo7SDHuYWk2OvY7xgdK9mq0FqWYJGrnAtlkR17OLQM1+LtpXaqMSkX1W0FY8DfHS83JpORHs8bk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 161713858420 Received: from sslproxy06.your-server.de ([78.46.172.3]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1uZgsj-000KHi-0O for newlib@sourceware.org; Thu, 10 Jul 2025 04:19:29 +0200 Received: from localhost ([127.0.0.1]) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uZgsd-000DfB-3C for newlib@sourceware.org; Thu, 10 Jul 2025 04:19:24 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 71D0A480184 for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10032) with ESMTP id jPFWBfB6dvuK for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id EBF85480179 for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) X-Virus-Scanned: amavis at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10026) with ESMTP id DOCMyMTGUEJj for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id C097A480196 for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) From: Sebastian Huber To: newlib@sourceware.org Subject: [PATCH 5/7] sys: Remove $FreeBSD$: one-line .h pattern Date: Thu, 10 Jul 2025 04:19:16 +0200 Message-ID: <20250710021918.112394-6-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250710021918.112394-1-sebastian.huber@embedded-brains.de> References: <20250710021918.112394-1-sebastian.huber@embedded-brains.de> MIME-Version: 1.0 X-Virus-Scanned: Clear (ClamAV 1.0.7/27694/Wed Jul 9 10:42:34 2025) X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Warner Losh Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/ --- newlib/libc/include/sys/time.h | 1 - newlib/libc/include/sys/timespec.h | 1 - 2 files changed, 2 deletions(-) diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h index aa702980c..556282912 100644 --- a/newlib/libc/include/sys/time.h +++ b/newlib/libc/include/sys/time.h @@ -33,7 +33,6 @@ * SUCH DAMAGE. * * @(#)time.h 8.5 (Berkeley) 5/4/95 - * $FreeBSD: head/sys/sys/time.h 346176 2019-04-13 04:46:35Z imp $ */ #ifndef _SYS_TIME_H_ diff --git a/newlib/libc/include/sys/timespec.h b/newlib/libc/include/sys/timespec.h index 2505cef89..fd9d64b3e 100644 --- a/newlib/libc/include/sys/timespec.h +++ b/newlib/libc/include/sys/timespec.h @@ -28,7 +28,6 @@ * * @(#)time.h 8.5 (Berkeley) 5/4/95 * from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp - * $FreeBSD$ */ #ifndef _SYS_TIMESPEC_H_ From patchwork Thu Jul 10 02:19:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Huber X-Patchwork-Id: 116005 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 87FEE3857738 for ; Thu, 10 Jul 2025 02:20:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 87FEE3857738 X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id 4F5363858CD9 for ; Thu, 10 Jul 2025 02:19:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4F5363858CD9 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4F5363858CD9 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=85.10.215.148 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752113966; cv=none; b=gEa+2r1yAY5O4jW2PwVEfxVmTg+ZRNFIaZtstR1+4IZ97bPuXFMxRrouzdtZy4Ai/SZLX5Qyh+6us+bylTISJz5zrUK2AXUxdqyWZvn/bKPoqN9cgev2HY5yFgPsQ2YU/+1EdiBHRH3CI0yzb4lF1exjZUdS1iWxp2w2BFm3VsE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752113966; c=relaxed/simple; bh=/lusUI8BWwSmyRrIcQdDOi/xAxVaMYw7o1Earo5QoyQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=HZVRHMvOmQwsatcx9qmT4Db48QrDOn9KQzyNAywab6LeIiGKdPlllcUuqdIDHSkdbFFrUPdoxdqTxCckRt8cPvbQ+dSp06ChEeezxyfVM5tO7v0AK05SjCLokhON01xKn5iAq76Rsb9IzqhUicY2ANGlZR1hUSCQk+MRKQrhAEs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F5363858CD9 Received: from sslproxy06.your-server.de ([78.46.172.3]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1uZgsd-000KHX-2x for newlib@sourceware.org; Thu, 10 Jul 2025 04:19:23 +0200 Received: from localhost ([127.0.0.1]) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uZgsd-000DeB-2Y for newlib@sourceware.org; Thu, 10 Jul 2025 04:19:23 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 61C60480157 for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10032) with ESMTP id MXN5PtEX3B15 for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 0848A480184 for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) X-Virus-Scanned: amavis at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10026) with ESMTP id JQ8IqdpEc6Zs for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id CD9A7480197 for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) From: Sebastian Huber To: newlib@sourceware.org Subject: [PATCH 6/7] sys: Remove ancient SCCS tags. Date: Thu, 10 Jul 2025 04:19:17 +0200 Message-ID: <20250710021918.112394-7-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250710021918.112394-1-sebastian.huber@embedded-brains.de> References: <20250710021918.112394-1-sebastian.huber@embedded-brains.de> MIME-Version: 1.0 X-Virus-Scanned: Clear (ClamAV 1.0.7/27694/Wed Jul 9 10:42:34 2025) X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Warner Losh Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix --- newlib/libc/include/sys/time.h | 2 -- newlib/libc/include/sys/timespec.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h index 556282912..6a4f7fdad 100644 --- a/newlib/libc/include/sys/time.h +++ b/newlib/libc/include/sys/time.h @@ -31,8 +31,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)time.h 8.5 (Berkeley) 5/4/95 */ #ifndef _SYS_TIME_H_ diff --git a/newlib/libc/include/sys/timespec.h b/newlib/libc/include/sys/timespec.h index fd9d64b3e..709e13851 100644 --- a/newlib/libc/include/sys/timespec.h +++ b/newlib/libc/include/sys/timespec.h @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)time.h 8.5 (Berkeley) 5/4/95 * from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp */ From patchwork Thu Jul 10 02:19:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Huber X-Patchwork-Id: 116007 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 A0CBF3857432 for ; Thu, 10 Jul 2025 02:20:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A0CBF3857432 X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id 1AC263858429 for ; Thu, 10 Jul 2025 02:19:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1AC263858429 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1AC263858429 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=85.10.215.148 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752113970; cv=none; b=WeKIs1kqzVxuBd50h6iOcZneMJomdBJyqRNhU24H8jX/TR/q4UMGntdtyvwBlRm8ZFVTt53HcBNEN+h/5KHAuEQeR5y8jHtrTNTODWSqx0CiQqXWMs78fTwB4YIa3iFF58q4PNDv6mwiKnVODkTbPe9UsoEOpCi+SHilFHAZaUk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752113970; c=relaxed/simple; bh=SfSNMLbXpiBUcL6DEW0xLYQEO1+HBXRG/a7jEBFS7tc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=X8Y67JoFld/f6XwbQwNUN+bXHfapvzzOMAzvf5KEwTFNUNwXsjy5kpxu9dj3n7/P1/l17PbsVhFYstE8hB5Y4s5wEykSAnHrJhRCTtnDql+fwhp2nhKwyKC2UdEDsNK0S2fcEscQhdsWA7gyDG1zMVwKrX68v7mTim4uq69nZ8Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1AC263858429 Received: from sslproxy06.your-server.de ([78.46.172.3]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1uZgsj-000KHz-0P for newlib@sourceware.org; Thu, 10 Jul 2025 04:19:29 +0200 Received: from localhost ([127.0.0.1]) by sslproxy06.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uZgsj-000DfS-01 for newlib@sourceware.org; Thu, 10 Jul 2025 04:19:29 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 7A17A480179 for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10032) with ESMTP id zax-QwvKxun5 for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 317B1480196 for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) X-Virus-Scanned: amavis at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10026) with ESMTP id LSR0wgIgOdWi for ; Thu, 10 Jul 2025 04:19:23 +0200 (CEST) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id D9D72480199 for ; Thu, 10 Jul 2025 04:19:22 +0200 (CEST) From: Sebastian Huber To: newlib@sourceware.org Subject: [PATCH 7/7] sys/sys: Remove some more vestiges of the $FreeBSD$ Date: Thu, 10 Jul 2025 04:19:18 +0200 Message-ID: <20250710021918.112394-8-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250710021918.112394-1-sebastian.huber@embedded-brains.de> References: <20250710021918.112394-1-sebastian.huber@embedded-brains.de> MIME-Version: 1.0 X-Virus-Scanned: Clear (ClamAV 1.0.7/27694/Wed Jul 9 10:42:34 2025) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org From: Konstantin Belousov Reviewed by: imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D42824 --- newlib/libc/include/sys/timespec.h | 1 - 1 file changed, 1 deletion(-) diff --git a/newlib/libc/include/sys/timespec.h b/newlib/libc/include/sys/timespec.h index 709e13851..b3e2e07b2 100644 --- a/newlib/libc/include/sys/timespec.h +++ b/newlib/libc/include/sys/timespec.h @@ -25,7 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp */ #ifndef _SYS_TIMESPEC_H_