| #
0a64d16c
|
| 09-Jan-2026 |
Brooks Davis <brooks@FreeBSD.org> |
sys/_types.h: avoid use of __has_feature()
Only fairly recent GCC versions support and sys/_types.h must work with quite old compilers and without sys/cdef.h being included. The prior workaround wo
sys/_types.h: avoid use of __has_feature()
Only fairly recent GCC versions support and sys/_types.h must work with quite old compilers and without sys/cdef.h being included. The prior workaround works fine, but we can have the same effect with compiler macro definitions. In this specific case, compilers that define the __intcap_t builtin type will define __SIZEOF_INTCAP__.
This reverts commit 029a09f18032353a9ae874590b879322efc6e53a This reverts commit 19728f31ae421f40e2b0b0c775f4eedd7f927be0
Reviewed by: imp, des, kib, emaste Effort: CHERI upstreaming Fixes: 85ab981a8e4e ("sys/_types.h: define fallback __(u)intcap_t") Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D54009
show more ...
|
| #
66129def
|
| 07-Dec-2025 |
Robert Clausecker <fuz@FreeBSD.org> |
sys/_types.h: recognise char8_t as a builtin type in C++20
Unlike in C23 where it's a typedef, char8_t is a built in type in C++20. Recognise it as such.
PR: 291449 Reported by: Tomoaki AOKI <jun
sys/_types.h: recognise char8_t as a builtin type in C++20
Unlike in C23 where it's a typedef, char8_t is a built in type in C++20. Recognise it as such.
PR: 291449 Reported by: Tomoaki AOKI <junchoon@dec.sakura.ne.jp> Approved by: markj (mentor) Reviewed by: imp Fixes: f0e541118c374869a8226eaa1320bb6eda248a20 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54124
show more ...
|
| #
029a09f1
|
| 30-Nov-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
sys/_types.h: Actually unbreak gcc build
Fixes: 19728f31ae42 ("sys/_types.h: Unbreak gcc build") Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D53986
|
| #
19728f31
|
| 28-Nov-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
sys/_types.h: Unbreak gcc build
We can't assume that <sys/cdefs.h> is in scope.
Fixes: 85ab981a8e4e ("sys/_types.h: define fallback __(u)intcap_t") Reviewed by: olce, imp, emaste Differential Revi
sys/_types.h: Unbreak gcc build
We can't assume that <sys/cdefs.h> is in scope.
Fixes: 85ab981a8e4e ("sys/_types.h: define fallback __(u)intcap_t") Reviewed by: olce, imp, emaste Differential Revision: https://reviews.freebsd.org/D53980
show more ...
|
| #
4e22cd3b
|
| 27-Nov-2025 |
Brooks Davis <brooks@FreeBSD.org> |
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_
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
show more ...
|
| #
6ebbfe72
|
| 27-Nov-2025 |
Brooks Davis <brooks@FreeBSD.org> |
sys/_types.h: add __intptr_t to __mbstate_t
Extend __mbstate_t to include an intptr_t to ensure it can hold a pointer if required.
Reviewed by: kib, markj Effort: CHERI upstreaming Sponsored by: I
sys/_types.h: add __intptr_t to __mbstate_t
Extend __mbstate_t to include an intptr_t to ensure it can hold a pointer if required.
Reviewed by: kib, markj Effort: CHERI upstreaming Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D53822
show more ...
|
| #
528e70a1
|
| 27-Nov-2025 |
Brooks Davis <brooks@FreeBSD.org> |
sys/_types.h: add void * to __max_align_t
Add a pointer member to __max_align_t as pointers may have different alignment requirements than long long or long double.
Reviewed by: kib Effort: CHERI
sys/_types.h: add void * to __max_align_t
Add a pointer member to __max_align_t as pointers may have different alignment requirements than long long or long double.
Reviewed by: kib Effort: CHERI upstreaming Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D53821
show more ...
|
| #
85ab981a
|
| 27-Nov-2025 |
Brooks Davis <brooks@FreeBSD.org> |
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
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
show more ...
|
| #
96e05e2d
|
| 27-Nov-2025 |
Brooks Davis <brooks@FreeBSD.org> |
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
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
show more ...
|
| #
6aaba753
|
| 27-Nov-2025 |
Brooks Davis <brooks@FreeBSD.org> |
sys/_types.h: centralize __vm_offset_t and __vm_size_t definitions
Use __ptraddr_t to define __vm_offset_t and __size_t for __vm_size_t rather than per-pointer-size definitions.
Reviewed by: kib, m
sys/_types.h: centralize __vm_offset_t and __vm_size_t definitions
Use __ptraddr_t to define __vm_offset_t and __size_t for __vm_size_t rather than per-pointer-size definitions.
Reviewed by: kib, markj Effort: CHERI upstreaming Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D53818
show more ...
|
| #
dca634d1
|
| 27-Nov-2025 |
Brooks Davis <brooks@FreeBSD.org> |
new type: ptraddr_t
ptraddr_t is an unsigned integer type that can hold the address of any pointer. It differes from uintptr_t in that it does not carry provenance which is useful for CHERI in that
new type: ptraddr_t
ptraddr_t is an unsigned integer type that can hold the address of any pointer. It differes from uintptr_t in that it does not carry provenance which is useful for CHERI in that it can disambigurate the provenance of uintptr_t expressions. It differes from size_t in that some segmented architecture (not supported by FreeBSD) may have a size_t that does not hold an address.
ptraddr_t is not yet standardized, but is currently proposed for inclusion in C++2Y.
Prefer the compiler defined __PTRADDR_TYPE__ defintion where available as this a new type and we don't need to worry about historical values. Fall back to __size_t where unavailable.
Reviewed by: kib, markj Effort: CHERI upstreaming Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D53817
show more ...
|
| #
39cad840
|
| 19-Nov-2025 |
Konstantin Belousov <kib@FreeBSD.org> |
max_align_t: apply alignof to 'long double' for long double alignment
Reviewed by; markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53
max_align_t: apply alignof to 'long double' for long double alignment
Reviewed by; markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D53826
show more ...
|
| #
92ff108e
|
| 11-Jun-2025 |
Brooks Davis <brooks@FreeBSD.org> |
sys/_types.h: drop sys/cdefs.h include
We no longer use it and it pollutes downstream headers.
Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/
sys/_types.h: drop sys/cdefs.h include
We no longer use it and it pollutes downstream headers.
Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
show more ...
|
| #
ab3d713e
|
| 11-Jun-2025 |
Brooks Davis <brooks@FreeBSD.org> |
sys/_types.h: use builtins to for __max_align_t
Use __attribute__((__aligned__(x))) and __alignof__(x) in places of local macros that ultimately wrap these. We don't support compilers that don't de
sys/_types.h: use builtins to for __max_align_t
Use __attribute__((__aligned__(x))) and __alignof__(x) in places of local macros that ultimately wrap these. We don't support compilers that don't define these so there's little loss of generality.
This mirrors Clang's stddef.h.
Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
show more ...
|
| #
55513a1b
|
| 18-Mar-2024 |
Brooks Davis <brooks@FreeBSD.org> |
sys/acl.h: move main typedefs to sys/_types.h
Make __ prefixed versions available without the pollution of sys/acl.h (and by extension sys/param.h).
Reviewed by: kib Differential Revision: https://
sys/acl.h: move main typedefs to sys/_types.h
Make __ prefixed versions available without the pollution of sys/acl.h (and by extension sys/param.h).
Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D44382
show more ...
|
| #
95ee2897
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| #
4d846d26
|
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
| #
b8717a87
|
| 12-Apr-2022 |
John Baldwin <jhb@FreeBSD.org> |
Remove checks for __GNUCLIKE macros for varargs.
All supported compilers (modern versions of GCC and clang) support these.
PR: 263102 (exp-run) Reviewed by: brooks, imp Differential Revision: http
Remove checks for __GNUCLIKE macros for varargs.
All supported compilers (modern versions of GCC and clang) support these.
PR: 263102 (exp-run) Reviewed by: brooks, imp Differential Revision: https://reviews.freebsd.org/D34800
show more ...
|
| #
959af5a8
|
| 15-Dec-2021 |
Kristof Provost <kp@FreeBSD.org> |
sys: make callout.h self-contained
Avoid including sys/types.h from sys/_callout.h (as we try to avoid having headers starting with underscores depending on non-underscore headers) by introducing __
sys: make callout.h self-contained
Avoid including sys/types.h from sys/_callout.h (as we try to avoid having headers starting with underscores depending on non-underscore headers) by introducing __sbintime_t in sys/_types.h and including that header instead.
Reviewed by: imp Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33500
show more ...
|
| #
9bb8a409
|
| 14-Jun-2021 |
Alex Richardson <arichardson@FreeBSD.org> |
Reduce code duplication in machine/_types.h
Many of these typedefs are the same across all architectures or can be set based on an architecture-independent compiler-provided macro (e.g. __SIZEOF_SIZ
Reduce code duplication in machine/_types.h
Many of these typedefs are the same across all architectures or can be set based on an architecture-independent compiler-provided macro (e.g. __SIZEOF_SIZE_T__). These macros have been available since GCC 4.6 and Clang sometime before 3.0 (godbolt.org does not have any older clang versions installed).
I originally considered using the compiler-provided `__FOO_TYPE__` directly. However, in order to do so we have to check that those match the previous typedef exactly (not just that they have the same size) since any change would be an ABI break. For example, changing `long` to `long long` results in different C++ name mangling. Additionally, Clang and GCC disagree on the underlying type for some of (u)int*_fast_t types, so this change only moves the definitions that are identical across all architectures and does not touch those types.
This de-deduplication will allow us to have a smaller diff downstream in CheriBSD: we only have to only change the (u)intptr_t definition in sys/_types.h in CheriBSD instead of having to change machine/_types.h for all CHERI-enabled architectures (currently RISC-V, AArch64 and MIPS).
Reviewed By: imp, kib Differential Revision: https://reviews.freebsd.org/D29895
show more ...
|
| #
7f49ce7a
|
| 27-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @349476
Sponsored by: The FreeBSD Foundation
|
| #
1bb95729
|
| 21-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
Reduce namespace pollution from r349233
Define __daddr_t in _types.h and use it in filio.h
Reported by: ian, bde Reviewed by: ian, imp, cem MFC after: 2 weeks MFC-With: 349233 Sponsored by: The Fre
Reduce namespace pollution from r349233
Define __daddr_t in _types.h and use it in filio.h
Reported by: ian, bde Reviewed by: ian, imp, cem MFC after: 2 weeks MFC-With: 349233 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20715
show more ...
|
| #
0a64d16c
|
| 09-Jan-2026 |
Brooks Davis <brooks@FreeBSD.org> |
sys/_types.h: avoid use of __has_feature()
Only fairly recent GCC versions support and sys/_types.h must work with quite old compilers and without sys/cdef.h being included. The prior workaround wo
sys/_types.h: avoid use of __has_feature()
Only fairly recent GCC versions support and sys/_types.h must work with quite old compilers and without sys/cdef.h being included. The prior workaround works fine, but we can have the same effect with compiler macro definitions. In this specific case, compilers that define the __intcap_t builtin type will define __SIZEOF_INTCAP__.
This reverts commit 029a09f18032353a9ae874590b879322efc6e53a This reverts commit 19728f31ae421f40e2b0b0c775f4eedd7f927be0
Reviewed by: imp, des, kib, emaste Effort: CHERI upstreaming Fixes: 85ab981a8e4e ("sys/_types.h: define fallback __(u)intcap_t") Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D54009
show more ...
|
| #
66129def
|
| 07-Dec-2025 |
Robert Clausecker <fuz@FreeBSD.org> |
sys/_types.h: recognise char8_t as a builtin type in C++20
Unlike in C23 where it's a typedef, char8_t is a built in type in C++20. Recognise it as such.
PR: 291449 Reported by: Tomoaki AOKI <jun
sys/_types.h: recognise char8_t as a builtin type in C++20
Unlike in C23 where it's a typedef, char8_t is a built in type in C++20. Recognise it as such.
PR: 291449 Reported by: Tomoaki AOKI <junchoon@dec.sakura.ne.jp> Approved by: markj (mentor) Reviewed by: imp Fixes: f0e541118c374869a8226eaa1320bb6eda248a20 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54124
show more ...
|
| #
029a09f1
|
| 30-Nov-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
sys/_types.h: Actually unbreak gcc build
Fixes: 19728f31ae42 ("sys/_types.h: Unbreak gcc build") Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D53986
|