Page MenuHomeFreeBSD

sys/_types.h: define __(u)int(f)ptr_t for CHERI
ClosedPublic

Authored by brooks on Nov 19 2025, 11:18 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 1, 3:22 AM
Unknown Object (File)
Tue, Sep 29, 5:25 PM
Unknown Object (File)
Mon, Sep 28, 2:53 AM
Unknown Object (File)
Tue, Sep 8, 8:24 PM
Unknown Object (File)
Tue, Sep 8, 1:13 PM
Unknown Object (File)
Mon, Sep 7, 10:49 AM
Unknown Object (File)
Sep 1 2026, 6:41 PM
Unknown Object (File)
Aug 15 2026, 8:59 PM
Subscribers

Details

Summary

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.

Effort: CHERI upstreaming
Sponsored by: Innovate UK

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 68727
Build 65610: arc lint + arc unit

Event Timeline

brooks created this revision.
This revision is now accepted and ready to land.Nov 19 2025, 10:08 PM

And where is __intcap_t defined? Is it provided by some MD include, like machine/_types.h?

I do not remember seeing this MD define in the review series. If true, then should __intcap_t added before the use?

In D53819#1229955, @kib wrote:

And where is __intcap_t defined? Is it provided by some MD include, like machine/_types.h?

I do not remember seeing this MD define in the review series. If true, then should __intcap_t added before the use?

__intcap_t is a new primitive type provided by the compiler. It cannot be defined by a header except on systems that don't support it.

In D53819#1229955, @kib wrote:

And where is __intcap_t defined? Is it provided by some MD include, like machine/_types.h?

I do not remember seeing this MD define in the review series. If true, then should __intcap_t added before the use?

__intcap_t is a new primitive type provided by the compiler. It cannot be defined by a header except on systems that don't support it.

Eh, not quite. ((un)signed) __intcap is the primitive but there are also __(u)intcap_t pre-defined by the compiler. A bit weird to provide both but that's how int128 works; you get both ((un)signed) __int128 and __(u)int128_t out of the box.