git: 055b5b5f850d - main - runq: Restrict <sys/runq.h> to kernel only
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 18 Jun 2025 02:13:31 UTC
The branch main has been updated by olce:
URL: https://cgit.FreeBSD.org/src/commit/?id=055b5b5f850da9d8355740b7a0698fa790c4f97d
commit 055b5b5f850da9d8355740b7a0698fa790c4f97d
Author: Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2024-05-21 13:05:54 +0000
Commit: Olivier Certner <olce@FreeBSD.org>
CommitDate: 2025-06-18 02:09:36 +0000
runq: Restrict <sys/runq.h> to kernel only
MFC after: 1 month
Event: Kitchener-Waterloo Hackathon 202506
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45390
---
sys/sys/runq.h | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/sys/sys/runq.h b/sys/sys/runq.h
index 590463af192c..9e209538d9c2 100644
--- a/sys/sys/runq.h
+++ b/sys/sys/runq.h
@@ -29,13 +29,16 @@
#ifndef _RUNQ_H_
#define _RUNQ_H_
-#include <sys/_param.h>
+#ifndef _KERNEL
+#error "no user-serviceable parts inside"
+#endif
-#ifdef _KERNEL
+#include <sys/types.h> /* For bool. */
+#include <sys/_param.h>
#include <sys/libkern.h>
-#else
-#include <strings.h>
-#endif
+#include <sys/queue.h>
+
+struct thread;
/*
* Run queue parameters.
@@ -69,12 +72,6 @@ typedef unsigned long rqsw_t; /* runq's status words type. */
RQSW_TO_QUEUE_IDX(word_idx, RQSW_BSF(word))
-#ifdef _KERNEL
-#include <sys/types.h> /* For bool. */
-#include <sys/queue.h>
-
-struct thread;
-
/*
* The queue for a given index as a list of threads.
*/
@@ -117,6 +114,5 @@ struct thread *runq_first_thread_range(struct runq *const rq,
bool runq_not_empty(struct runq *);
struct thread *runq_choose(struct runq *);
struct thread *runq_choose_fuzz(struct runq *, int _fuzz);
-#endif /* _KERNEL */
#endif