HomeFreeBSD

Add sys/_align.h replacing machine/_align.h

Description

Add sys/_align.h replacing machine/_align.h

Define _ALIGNBYTES using sizeof(void *) (no functional change on any
existing architecture) which will allow it to work with CHERI were we
must align things up to capability alignment.

In _ALIGN, replace integer manipulation which does not preserve pointer
provenance with a type and provenance preserving builtin. This requires
modest changes in code which assumes _ALIGN returns an integer, but
those are relatively rare.

Reviewed by: kib, markj
Effort: CHERI upstreaming
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D53947

Details

Provenance
brooksAuthored on Dec 10 2025, 10:55 AM
Reviewer
kib
Differential Revision
D53947: Add sys/_align.h replacing machine/_align.h
Parents
rGcfae62eac076: libcasper: fix warnings when _ALIGN preserves types
Branches
Unknown
Tags
Unknown