aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2026-05-12 17:47:25 +0000
committerMark Johnston <markj@FreeBSD.org>2026-05-12 20:05:19 +0000
commit8b4b995effb7911cc13706dc309d5e03c83b9a94 (patch)
tree9effb99d57406c8e70298622079b5acfd20efb59
parent271d25a066b59df1e2bb774990948c985382126a (diff)
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
-rw-r--r--sys/sys/_cpuset.h7
-rw-r--r--sys/sys/cpuset.h7
2 files changed, 6 insertions, 8 deletions
diff --git a/sys/sys/_cpuset.h b/sys/sys/_cpuset.h
index b87cfb5d3f80..157192ed65ba 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 e861321586db..92c14b0de5eb 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 <sys/cdefs.h>
+
__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 *);