From nobody Fri Sep 5 23:29:10 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cJXc64PQnz66YjH; Fri, 05 Sep 2025 23:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cJXc636TVz411v; Fri, 05 Sep 2025 23:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757114950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZIYmwdNQiI2khW1wBOuDj6ePKOCuFIOwq7tvE7deNIk=; b=EGHqhEVtzyTXjBKhGdqMYuDZsyjOjgIExVuhFvSSAv47LVdTKL7/s9n8X+IYyCxF4Xux8o ZUw2Bmso/frh99InAAslmjlmEMSioMnK9N+R3q9A3xbpz+O50NXHMjjhqnIZJui8FhF2R6 VJFIwXnauBS1+iwzm4Ae2PGavEzHliV99vmKHJtSxTnzJbaRvSMWmdUmkZ7THM3AgD3IRb aXq13ZH6O0Yt+i7S60eWBpIU/P6f2PD7hECseh7kYNyUsYqVPUllZAyPBwTe/b70GLq9v6 B1hdTWGWZ1D5U8/npnTzqGV/Hu8PM9vmchn/U6KFU/tg3BVG6JUIGDAy3BSsbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757114950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZIYmwdNQiI2khW1wBOuDj6ePKOCuFIOwq7tvE7deNIk=; b=KfOa9CHD+Se4OQYHflvFfCUZgTe7DacYFzft6RjrIR15Nlis8+AWfaWg/OVljozXBzq2aH A/Kcr08+2Y0p1ZitI8QOatAQnDFHsF9AxWBaAO17AZ1Sw9hDtT86XHghR8n9ULszq5IcvX 5OwyBrdsSER8jSrif2/WFo2ZUPVzMUUwG8t2Ad2rIlkNgm8sehIWVxxmHFWUHYiZz5yedx X2eGX7Zpw+tO0cQrTFFXXns2Sy8MOu+E14B3o9re6DtQKnyMzVAIf0dwH4SyWFPw61A37c icAsGem2mz9Vl8hlPdk2wpQ3y81FIXcRookELa6XSKShXwsAqf/SplukImLzGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757114950; a=rsa-sha256; cv=none; b=m5E3dzBd7vKdF64b0spnE7tnrd5AxqRzTdPXXKFkwmYFpXtDku5pCEH/DblsxmKtqbBgTJ 5/PbfsCK4gvEj8TFdCFYHMUXC0tNviEj/xOdqHetUG6/Ox2xip3WVmtABrNUpEDOc7ThtL hB2EBf4eMHAOGk+mn2EJQSwZXUEOup9pjv7dBRP2yjahLZOScHgLSp5A62+uf2+UXW8I1M kGpY0J4saHCtoT8uhyHyWYGSnUs0yma8TsBs8fK2U2PazBJ6psjvfc68DC1DMnrPq34I6T d7V0l9QB4B78pVaXJgZmAoWp0UXMinvFmb5XShgPvnsFbVfhU1tskCFwRZL74A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cJXc62ckxz1809; Fri, 05 Sep 2025 23:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 585NTARO029547; Fri, 5 Sep 2025 23:29:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 585NTAT1029544; Fri, 5 Sep 2025 23:29:10 GMT (envelope-from git) Date: Fri, 5 Sep 2025 23:29:10 GMT Message-Id: <202509052329.585NTAT1029544@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2a44e10edb13 - main - LinuxKPI: maths64: implement roundup_u64() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a44e10edb13e6b2be7fa2814b418a6959cb1171 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2a44e10edb13e6b2be7fa2814b418a6959cb1171 commit 2a44e10edb13e6b2be7fa2814b418a6959cb1171 Author: Bjoern A. Zeeb AuthorDate: 2025-09-04 20:27:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-09-05 23:24:16 +0000 LinuxKPI: maths64: implement roundup_u64() Needed by a wifi driver update. Sponsored by: The FreeBSD Foundation (initially) MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D52080 --- sys/compat/linuxkpi/common/include/linux/math64.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/math64.h b/sys/compat/linuxkpi/common/include/linux/math64.h index a216d350570f..25ca9da1b622 100644 --- a/sys/compat/linuxkpi/common/include/linux/math64.h +++ b/sys/compat/linuxkpi/common/include/linux/math64.h @@ -98,6 +98,12 @@ div64_u64_round_up(uint64_t dividend, uint64_t divisor) return ((dividend + divisor - 1) / divisor); } +static inline uint64_t +roundup_u64(uint64_t x1, uint32_t x2) +{ + return (div_u64(x1 + x2 - 1, x2) * x2); +} + #define DIV64_U64_ROUND_UP(...) \ div64_u64_round_up(__VA_ARGS__)