From nobody Thu Nov 27 14:56:11 2025 X-Original-To: dev-commits-src-all@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 4dHKHw4116z6HMhs for ; Thu, 27 Nov 2025 14:56:12 +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 4dHKHw1DJQz3nX6 for ; Thu, 27 Nov 2025 14:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764255372; 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=Sp/5ry8UVEl8DZqyC0WoGOu55Zktc+e77AqURPt6Yec=; b=APd78rrAeZgdasgruwmkN+STE/67RF75+BY4nxeIJ9LfQMGqThThKoCF7+b2zo1EDBXa1T MatlW7y9gvXhWl8rzdv0eHkiLczxhwD8QVoUyu4mYYBQOYt+oEIOOAYvy+TFcNCiVYh3Se KmxZdDkrFnqPK8FJvjUYaYD6RiPcRcL9oINOESDYsl7TK+cM+9GLLWV9f3oEYTRIpqK+wN XQpwscUOfXdU/qiyB9kIQOArKEzeAHwlvVrTs5FC4CaVqCldFhaNz3QuJyBbSURcwWpXgy pEiDWG85rWKgDqYAx+cgm6Th+bvzqLTpHp+slnat/3Tk3ZOuhl9xGwS4CieA+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764255372; 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=Sp/5ry8UVEl8DZqyC0WoGOu55Zktc+e77AqURPt6Yec=; b=aYlnTKl0WSLNzOiO+Cs+C9HeSx/II4TYzWko5UJ+6RAFUt7rZGaYjFs3oX+3W+X0UKcRMt dwzNb4ifacBLcwnpeN2pTGx3mbe5Ly58XLKccFGnRTisDRcjFd+/jHx57RHeWpj+llf/Kz ZdaWun/IAJdnJqqqGyFcs7GH3o59gjYEN/e2JxCLjqzlDVo2taZKc9PFpt2KgbDDUHbMBq 6MiIPSP4/iFQiPZZcZT3DTGlgMisDIGS19eTEs5JVMWAerB3/XlKnsTnsuD85EPrTLy4EA srpAAShaXJV032JTgAVKKd/Yqo6734ONDDZb5iO8Q0TblX5v27Ll45frUAC8+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764255372; a=rsa-sha256; cv=none; b=AiEAOuQqxKWakv/9DE71sPYwBQGxYOUgw4m1q4W7w8zCPWLfTUawQHWAr2sYj/3WBmR9e0 +1UPp5XmrhEfPV6r+KdTmq4OX2Ixn4qJYYHX/OGKqzAEqyAYdbFq8LmGXvLtQUa0VZ8vDk no1Lx0SiubCKdre3W03LEdBUYH37VlC6oMq7aNRQiN9jHfhZor8SYFvJwPGeBXxvr89R2S +0qxvjSrdVZt96kyIcodB4UyPlq5eHO2qs5Po1XcOMTv5MBvvF+1dGsmDcekowCGNpB6Yo 13zF1udWfMQNJPLPZe5WPoOPgHPp6dpYC0Y0B/j/kQJoHvCBuNMWP+6vIY6/Yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dHKHv75SQz5s6 for ; Thu, 27 Nov 2025 14:56:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3074a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 27 Nov 2025 14:56:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 4e22cd3bf0b4 - main - add types: (u)int64ptr_t List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e22cd3bf0b4112e541bc585a6be57662cb0b52b Auto-Submitted: auto-generated Date: Thu, 27 Nov 2025 14:56:11 +0000 Message-Id: <6928668b.3074a.3eea8291@gitrepo.freebsd.org> The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=4e22cd3bf0b4112e541bc585a6be57662cb0b52b commit 4e22cd3bf0b4112e541bc585a6be57662cb0b52b Author: Brooks Davis AuthorDate: 2025-11-27 14:54:56 +0000 Commit: Brooks Davis CommitDate: 2025-11-27 14:54:56 +0000 add types: (u)int64ptr_t This type represents an integer value of at least 64 bits which is capable of being cast to and from pointer types. It is intended to replace various spellings of (u)int64_t there the value is expected to hold a pointer. This is common in Linux code to allow 32-bit and 64-bit structures to be the same and used other places including OpenZFS. With the introduction of CHERI this no longer works, but we need to preserve the ABI for integer pointer targets. Rather than adding ifdefs in every case, we introduce a new type. Reviewed by: kib, markj Effort: CHERI upstreaming Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D53823 --- sys/sys/_stdint.h | 16 ++++++++++++++++ sys/sys/_types.h | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/sys/sys/_stdint.h b/sys/sys/_stdint.h index 5bb089adfba3..a2caec7e9eb9 100644 --- a/sys/sys/_stdint.h +++ b/sys/sys/_stdint.h @@ -78,6 +78,22 @@ typedef __intptr_t intptr_t; typedef __uintptr_t uintptr_t; #define _UINTPTR_T_DECLARED #endif +#if defined(__BSD_VISIBLE) && __BSD_VISIBLE +/* + * Integer types which are 64-bits unless it needs to be larger to hold + * a pointer. These are to be used when the ABI for integer targets + * uses a fixed 64-bit integer to hold values including pointers in + * order to simplify 32- and 64-bit compatibility. + */ +#ifndef _INT64PTR_T_DECLARED +typedef __int64ptr_t int64ptr_t; +#define _INT64PTR_T_DECLARED +#endif +#ifndef _UINT64PTR_T_DECLARED +typedef __uint64ptr_t uint64ptr_t; +#define _UINT64PTR_T_DECLARED +#endif +#endif #ifndef _INTMAX_T_DECLARED typedef __intmax_t intmax_t; #define _INTMAX_T_DECLARED diff --git a/sys/sys/_types.h b/sys/sys/_types.h index 6be3d2c66012..e368f44f950e 100644 --- a/sys/sys/_types.h +++ b/sys/sys/_types.h @@ -70,18 +70,24 @@ typedef __uint64_t __uintmax_t; #ifdef __CHERI__ typedef __intcap_t __intptr_t; typedef __intcap_t __intfptr_t; +typedef __intptr_t __int64ptr_t; typedef __uintcap_t __uintptr_t; typedef __uintcap_t __uintfptr_t; +typedef __uintptr_t __uint64ptr_t; #elif __SIZEOF_POINTER__ == 8 typedef __int64_t __intptr_t; typedef __int64_t __intfptr_t; +typedef __int64_t __int64ptr_t; typedef __uint64_t __uintptr_t; typedef __uint64_t __uintfptr_t; +typedef __uint64_t __uint64ptr_t; #elif __SIZEOF_POINTER__ == 4 typedef __int32_t __intptr_t; typedef __int32_t __intfptr_t; +typedef __int64_t __int64ptr_t; typedef __uint32_t __uintptr_t; typedef __uint32_t __uintfptr_t; +typedef __uint64_t __uint64ptr_t; #else #error unsupported pointer size #endif