aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2025-11-27 14:54:56 +0000
committerBrooks Davis <brooks@FreeBSD.org>2025-11-27 14:54:56 +0000
commit96e05e2d1dfc69f67d3099440561530501cc09b5 (patch)
tree52c24cba16b00d1cb5fcf77280d3ebce5005fb6b
parent6aaba753830ec1d82959f21151dfb6563d38efba (diff)
sys/_types.h: define __(u)int(f)ptr_t for CHERI
On pure-capability ABIs, uintptr_t and variants are capabilities and defined to the new primative type __uintcap_t and variants. This is required to allow pointers (capabilities) to round trip through uintptr_t as required by the C standard. Reviewed by: kib, markj Effort: CHERI upstreaming Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D53819
-rw-r--r--sys/sys/_types.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/sys/_types.h b/sys/sys/_types.h
index 3589fcb87a9e..4f5b8e5db273 100644
--- a/sys/sys/_types.h
+++ b/sys/sys/_types.h
@@ -67,7 +67,12 @@ typedef __uint32_t __uint_least32_t;
typedef __uint64_t __uint_least64_t;
typedef __uint64_t __uintmax_t;
-#if __SIZEOF_POINTER__ == 8
+#ifdef __CHERI__
+typedef __intcap_t __intptr_t;
+typedef __intcap_t __intfptr_t;
+typedef __uintcap_t __uintptr_t;
+typedef __uintcap_t __uintfptr_t;
+#elif __SIZEOF_POINTER__ == 8
typedef __int64_t __intptr_t;
typedef __int64_t __intfptr_t;
typedef __uint64_t __uintptr_t;