Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Nov 2025 14:56:08 +0000
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 85ab981a8e4e - main - sys/_types.h: define fallback __(u)intcap_t
Message-ID:  <69286688.30746.14c84aea@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=85ab981a8e4e1a7a078dbf553cb20cb2e58aeff9

commit 85ab981a8e4e1a7a078dbf553cb20cb2e58aeff9
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2025-11-27 14:54:56 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2025-11-27 14:54:56 +0000

    sys/_types.h: define fallback __(u)intcap_t
    
    __intcap_t and __uintcap_t are new primative types in CHERI-aware ABIs
    that are used to define (u)intptr_t.  To allow coexistance of integer
    pointers and hybrid code, define them to __(u)intptr_t when they are
    not otherwise available.
    
    Reviewed by:    kib, markj
    Effort:         CHERI upstreaming
    Sponsored by:   Innovate UK
    Differential Revision:  https://reviews.freebsd.org/D53820
---
 sys/sys/_types.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sys/sys/_types.h b/sys/sys/_types.h
index 4f5b8e5db273..e4d14da3c11e 100644
--- a/sys/sys/_types.h
+++ b/sys/sys/_types.h
@@ -155,6 +155,17 @@ typedef	int		__cpulevel_t;	/* level parameter for cpuset. */
 typedef int		__cpusetid_t;	/* cpuset identifier. */
 typedef __int64_t	__daddr_t;	/* bwrite(3), FIOBMAP2, etc */
 
+#if !__has_feature(capabilities)
+/*
+ * On non-CHERI systems, define __(u)intcap_t to __(u)intptr_t so that
+ * hybrid-C code which needs to be explicitly aware of capabilities can
+ * use it.  These types may be present in some third-party code and
+ * should not generally be used in FreeBSD code.
+ */
+typedef	__intptr_t	__intcap_t;
+typedef	__uintptr_t	__uintcap_t;
+#endif
+
 /*
  * Unusual type definitions.
  */


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69286688.30746.14c84aea>