From 46d845ccf003705b695957e9691c687c9b04bf2a Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Fri, 13 Feb 2026 21:53:46 +0100
Subject: [PATCH 1/2] kernel: Remove __boolean_t and define boolean_t directly.

A CPU dependent type for boolean_t isn't needed.

Change the remaining usage of __boolean_t to bool because
these headers are also used by userland.
---
 sys/cpu/x86_64/include/stdint.h |  5 -----
 sys/net/netmsg.h                | 10 ++++++----
 sys/sys/objcache.h              | 12 ++++++++----
 sys/sys/stdint.h                |  6 +++++-
 4 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/sys/cpu/x86_64/include/stdint.h b/sys/cpu/x86_64/include/stdint.h
index 2cc30608c0..648b6e6eaf 100644
--- a/sys/cpu/x86_64/include/stdint.h
+++ b/sys/cpu/x86_64/include/stdint.h
@@ -52,11 +52,6 @@ typedef	short		__int16_t;
 typedef	unsigned short	__uint16_t;
 typedef	int		__int32_t;
 typedef	unsigned int	__uint32_t;
-#if defined(__cplusplus) || __STDC_VERSION__ < 199901L && !__GNUC_PREREQ__(3, 0)
-typedef	int		__boolean_t;
-#else
-typedef	_Bool		__boolean_t;
-#endif
 
 #ifdef __LP64__
 typedef	long		__int64_t;
diff --git a/sys/net/netmsg.h b/sys/net/netmsg.h
index a0263af649..36e5999e11 100644
--- a/sys/net/netmsg.h
+++ b/sys/net/netmsg.h
@@ -26,8 +26,6 @@
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $DragonFly: src/sys/net/netmsg.h,v 1.10 2008/10/27 02:56:30 sephe Exp $
  */
 
 #ifndef _NET_NETMSG_H_
@@ -49,6 +47,10 @@ typedef void (*netisr_hashck_t)(struct mbuf *, const struct pktinfo *);
 
 #if defined(_KERNEL) || defined(_KERNEL_STRUCTURES)
 
+#ifndef _KERNEL
+#include <stdbool.h>
+#endif
+
 /*
  * The base netmsg prefixes all netmsgs and includes an embedded LWKT
  * message.
@@ -109,7 +111,7 @@ struct netmsg_genpkt {
 struct netmsg_forward {
 	struct netmsg_base	base;
 	struct mbuf		*nm_packet;
-	__boolean_t		using_srcrt;
+	bool			using_srcrt;
 };
 
 struct netmsg_pr_timeout {
@@ -117,7 +119,7 @@ struct netmsg_pr_timeout {
 };
 
 struct netmsg_so_notify;
-typedef __boolean_t (*msg_predicate_fn_t)(struct netmsg_so_notify *);
+typedef bool (*msg_predicate_fn_t)(struct netmsg_so_notify *);
 
 struct netmsg_so_notify {
 	struct netmsg_base	base;
diff --git a/sys/sys/objcache.h b/sys/sys/objcache.h
index 37749acdb1..2282abbb67 100644
--- a/sys/sys/objcache.h
+++ b/sys/sys/objcache.h
@@ -43,16 +43,20 @@
 #include <sys/_malloc.h>
 #endif
 
+#ifndef _KERNEL
+#include <stdbool.h>
+#endif
+
 #define OC_MFLAGS	0x0000ffff	/* same as malloc flags */
 
-typedef __boolean_t (objcache_ctor_fn)(void *obj, void *privdata, int ocflags);
-typedef void (objcache_dtor_fn)(void *obj, void *privdata);
+typedef bool  (objcache_ctor_fn)(void *obj, void *privdata, int ocflags);
+typedef void  (objcache_dtor_fn)(void *obj, void *privdata);
 
 /*
  * Underlying allocator.
  */
 typedef void *(objcache_alloc_fn)(void *allocator_args, int ocflags);
-typedef void (objcache_free_fn)(void *obj, void *allocator_args);
+typedef void  (objcache_free_fn)(void *obj, void *allocator_args);
 
 #ifdef	_KERNEL
 
@@ -77,7 +81,7 @@ void	 objcache_put(struct objcache *oc, void *obj);
 void	 objcache_dtor(struct objcache *oc, void *obj);
 void	 objcache_populate_linear(struct objcache *oc, void *elts, int nelts,
 				  int size);
-__boolean_t objcache_reclaimlist(struct objcache *oc[], int nlist);
+bool	 objcache_reclaimlist(struct objcache *oc[], int nlist);
 void	 objcache_destroy(struct objcache *oc);
 
 #endif	/* _KERNEL */
diff --git a/sys/sys/stdint.h b/sys/sys/stdint.h
index 51b53ca925..60662d626a 100644
--- a/sys/sys/stdint.h
+++ b/sys/sys/stdint.h
@@ -42,7 +42,11 @@
 #ifdef _KERNEL
 #include <machine/int_limits.h>
 
-typedef	__boolean_t	boolean_t;		/* kernel only */
+#if __STDC_VERSION__ < 199901L && !__GNUC_PREREQ__(3, 0)
+typedef	int		boolean_t;
+#else
+typedef	_Bool		boolean_t;
+#endif
 
 #if !defined(__bool_true_false_are_defined) && !defined(__cplusplus)
 #define	__bool_true_false_are_defined	1
-- 
2.45.2

