From 8b4b995effb7911cc13706dc309d5e03c83b9a94 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Tue, 12 May 2026 17:47:25 +0000 Subject: [PATCH] cpuset: Move userspace declarations out of _cpuset.h The _*.h headers are for structure definitions and should avoid dependencies on other headers. This convention is violated by using __BEGIN_DECLS/__END_DECLS. Move the declarations to cpuset.h, I see no reason they can't be there. Reviewed by: olce, brooks, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56856 --- sys/sys/_cpuset.h | 7 ------- sys/sys/cpuset.h | 7 ++++++- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/sys/_cpuset.h b/sys/sys/_cpuset.h index b87cfb5d3f8..157192ed65b 100644 --- a/sys/sys/_cpuset.h +++ b/sys/sys/_cpuset.h @@ -49,11 +49,4 @@ __BITSET_DEFINE(_cpuset, CPU_SETSIZE); typedef struct _cpuset cpuset_t; -#ifndef _KERNEL -__BEGIN_DECLS -cpuset_t *__cpuset_alloc(size_t set_size); -void __cpuset_free(cpuset_t *ptr); -__END_DECLS -#endif - #endif /* !_SYS__CPUSET_H_ */ diff --git a/sys/sys/cpuset.h b/sys/sys/cpuset.h index e861321586d..92c14b0de5e 100644 --- a/sys/sys/cpuset.h +++ b/sys/sys/cpuset.h @@ -181,8 +181,13 @@ int cpusetobj_strscan(cpuset_t *, const char *); void ddb_display_cpuset(const cpuset_t *); #endif -#else +#else /* !_KERNEL */ +#include + __BEGIN_DECLS +cpuset_t *__cpuset_alloc(size_t set_size); +void __cpuset_free(cpuset_t *ptr); + int cpuset(cpusetid_t *); int cpuset_setid(cpuwhich_t, id_t, cpusetid_t); int cpuset_getid(cpulevel_t, cpuwhich_t, id_t, cpusetid_t *);