The branch main has been updated by olce:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=28b54827f5c10212de752a8e2c4eaf07170d242c

commit 28b54827f5c10212de752a8e2c4eaf07170d242c
Author:     Olivier Certner <o...@freebsd.org>
AuthorDate: 2024-03-28 13:32:17 +0000
Commit:     Olivier Certner <o...@freebsd.org>
CommitDate: 2025-06-18 02:07:57 +0000

    runq: Hide function prototypes under _KERNEL
    
    And some structure definitions as well.
    
    This header really is not supposed to be included by userland, so should
    just error in this case.  However, there is one remaining use for it in
    a test: Getting the value of RQ_PPQ to ensure a big enough priority
    level difference in order to guarantee that a realtime thread preempts
    another.  This use will soon be obsoleted by guaranteeing that
    a realtime thread always preempts another one with lower priority, even
    if the priority level is very close.
    
    Reviewed by:    kib
    MFC after:      1 month
    Event:          Kitchener-Waterloo Hackathon 202506
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D45387
---
 sys/sys/runq.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/sys/sys/runq.h b/sys/sys/runq.h
index d40fee25846e..b9cfa847617b 100644
--- a/sys/sys/runq.h
+++ b/sys/sys/runq.h
@@ -30,7 +30,6 @@
 #define        _RUNQ_H_
 
 #include <sys/_param.h>
-#include <sys/queue.h>
 
 #ifdef _KERNEL
 #include <sys/libkern.h>
@@ -38,8 +37,6 @@
 #include <strings.h>
 #endif
 
-struct thread;
-
 /*
  * Run queue parameters.
  */
@@ -59,6 +56,12 @@ typedef      unsigned long   rqb_word_t;     /* runq's 
status words type. */
 #define        RQB_BIT(idx)    (1ul << ((idx) % RQB_BPW))
 #define        RQB_FFS(word)   (ffsl((long)(word)) - 1) /* Assumes 
two-complement. */
 
+
+#ifdef _KERNEL
+#include <sys/queue.h>
+
+struct thread;
+
 /*
  * Head of run queues.
  */
@@ -90,5 +93,6 @@ struct        thread *runq_choose_fuzz(struct runq *, int);
 void   runq_init(struct runq *);
 void   runq_remove(struct runq *, struct thread *);
 void   runq_remove_idx(struct runq *, struct thread *, u_char *);
+#endif /* _KERNEL */
 
 #endif

Reply via email to