From nobody Sun Apr 12 05:57:04 2026 X-Original-To: dev-commits-src-branches@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 4ftfv54cCTz6YZ2D for ; Sun, 12 Apr 2026 05:57:05 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ftfv516wTz3mGd for ; Sun, 12 Apr 2026 05:57:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775973425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ha3iU1nGnavFPpeHl3UxGhNgE7OBL1uc8jNAZBKt0n4=; b=onxTTobn3DvGqLextqT16+H1/V78krHx5PEljaC14zdXRGnJ9fPRF0MeTH0jSsq+yYpJWX izlez0AzwxyYH65dM1js95S47hdnYfuTWnstExjBxxdpnYfG4237/74wtZI8G3nv6m/1r1 QkB3GVrCdQyO7AG2NiQWMbkdQAWbVAZHLErlKaVnCyDi6pEEyCO8kEx2ZpU9DNwjOeOUvg tkkChjLr9kob1OFJLTKbWk2meecOUQtqb8GfOTTov7jGmq46KXJo6ve8+iFDSSwU5H2/Gn LWVWMqt7jjxyeN0atJOAgEbhcHgd2WgIio0vnu1N5TlgOvAXAVQeJ6iDF3XwKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1775973425; a=rsa-sha256; cv=none; b=URzHyfwcHS8w7PTqg1RN+HzV/Oi0KdvrpDhQZepFxPsTcdUUH0ie2pO5m+DlvPDx3QJl/4 Zc7Be++3HvhmeLXcYsVd3UgmOTdDJNZdXfODrwyo47sSm5hgl2cI7NzDFDNozOCa6zaJmI DxCcMenfqqZnm3KC3NaqrKAYooMMcPl36yMFkDoeN8dObWZPSr4fvUuDb0JIeA4FFXLhcn CxbaO7qa9KgOkDqua/BLeFidre5eXF2fkRtQ9xhb7u+qvhU2Nw278N7tWFopuK/PH+TjRb x+m6ko0ui6Y2KRvnRCRMvmpSt2+NBbVkAh8C3Ko6JyR9DqZimbBaZ0eLCX48rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775973425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ha3iU1nGnavFPpeHl3UxGhNgE7OBL1uc8jNAZBKt0n4=; b=tmPHntI3FNczlVikbTj3lkd7Ss/pi5Cr+gVoCFtcNohaWas0kpiVInb/QSLc+wvkfe9cjl FyF7C1cZRkQom4OXu2djLnaKs/9kF0awcY3RjcFa4xXfAWwK1/h8smxXp0Gl00XqfBXkPT UeCWFNdjBhCQwsRtgBOms/brVu1jF1lhJc/x4xsMZQWQzmrBiR4OBdeDlaZrP93M2AQDEc KbhgEVC95yPL5uWUCaFqQw5n39QNpes4KPfx9CIfoX6VDAe+gCtO3TN6vt0nvzGjdn08Yo +7j8IJOHMJ+Yo8sLxnecN6L78Ez3ILtBWLpYXevEWQmHuDR0m0JyXcxRzVDe2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ftfv463pmz147Z for ; Sun, 12 Apr 2026 05:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 27e2c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 12 Apr 2026 05:57:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Konstantin Belousov From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: a60b5778dd04 - stable/14 - compat32: provide a type and a macro for (u)int64_t handling on non-x86 arches List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a60b5778dd043214e9e094f1b7d41adc3b9ee972 Auto-Submitted: auto-generated Date: Sun, 12 Apr 2026 05:57:04 +0000 Message-Id: <69db3430.27e2c.43c2cc58@gitrepo.freebsd.org> The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a60b5778dd043214e9e094f1b7d41adc3b9ee972 commit a60b5778dd043214e9e094f1b7d41adc3b9ee972 Author: Konstantin Belousov AuthorDate: 2026-01-12 04:45:36 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-04-12 05:56:45 +0000 compat32: provide a type and a macro for (u)int64_t handling on non-x86 arches uint64_t is 4-byte aligned on i386, but is 8-bytes aligned on all other 32bit arches FreeBSD supports. Provide the freebsd32_uint64_t type and the FU64_CP() macro, which are intended to be used where 32bit ABI uses (u)int64_t type, and do proper layout and copying for the aggregate type. Reviewed by: des, emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54663 (cherry picked from commit 96acaa960023c20e852e04e7cc5c6a5faca36c67) --- sys/compat/freebsd32/freebsd32.h | 11 ++++++++++- sys/sys/abi_compat.h | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/compat/freebsd32/freebsd32.h b/sys/compat/freebsd32/freebsd32.h index 9d7a99535288..36deb6bd06f2 100644 --- a/sys/compat/freebsd32/freebsd32.h +++ b/sys/compat/freebsd32/freebsd32.h @@ -36,8 +36,17 @@ #include /* - * i386 is the only arch with a 32-bit time_t + * i386 is the only arch with a 32-bit time_t. + * Also it is the only arch with (u)int64_t having 4-bytes alignment. */ +typedef struct { +#ifdef __amd64__ + uint32_t val[2]; +#else + uint64_t val; +#endif +} freebsd32_uint64_t; + #ifdef __amd64__ typedef int32_t time32_t; #else diff --git a/sys/sys/abi_compat.h b/sys/sys/abi_compat.h index c2233f2eac2c..0a7110191430 100644 --- a/sys/sys/abi_compat.h +++ b/sys/sys/abi_compat.h @@ -67,6 +67,14 @@ TS_CP((src), (dst), it_value); \ } while (0) +#define FU64_CP(src, dst, fld) do { \ + _Static_assert(sizeof((src).fld) == sizeof(uint64_t), \ + "FU64_CP src: " #src "." #fld "is not 8 bytes"); \ + _Static_assert(sizeof((dst).fld) == sizeof(uint64_t), \ + "FU64_CP dst: " #dst "." #fld "is not 8 bytes"); \ + memcpy(&(dst).fld, &(src).fld, sizeof(uint64_t)); \ +} while (0) + #define BT_CP(src, dst, fld) do { \ CP((src).fld, (dst).fld, sec); \ *(uint64_t *)&(dst).fld.frac[0] = (src).fld.frac; \