build: hide z_priq_mq_add/z_priq_mq_remove
Move z_priq_mq_add and z_priq_mq_remove into #ifdef CONFIG_SCHED_MULTIQ
block, because they are only used with that config.
Signed-off-by: Jeremy Bettis <jbettis@google.com>
diff --git a/kernel/sched.c b/kernel/sched.c
index c1e9023..08e8674 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -37,6 +37,10 @@
#define _priq_run_add z_priq_mq_add
#define _priq_run_remove z_priq_mq_remove
#define _priq_run_best z_priq_mq_best
+static ALWAYS_INLINE void z_priq_mq_add(struct _priq_mq *pq,
+ struct k_thread *thread);
+static ALWAYS_INLINE void z_priq_mq_remove(struct _priq_mq *pq,
+ struct k_thread *thread);
#endif
#if defined(CONFIG_WAITQ_SCALABLE)
@@ -54,10 +58,6 @@
static void update_cache(int preempt_ok);
static void end_thread(struct k_thread *thread);
-static ALWAYS_INLINE void z_priq_mq_add(struct _priq_mq *pq,
- struct k_thread *thread);
-static ALWAYS_INLINE void z_priq_mq_remove(struct _priq_mq *pq,
- struct k_thread *thread);
static inline int is_preempt(struct k_thread *thread)
{
@@ -1081,7 +1081,6 @@
# if (K_LOWEST_THREAD_PRIO - K_HIGHEST_THREAD_PRIO) > 31
# error Too many priorities for multiqueue scheduler (max 32)
# endif
-#endif
static ALWAYS_INLINE void z_priq_mq_add(struct _priq_mq *pq,
struct k_thread *thread)
@@ -1102,6 +1101,7 @@
pq->bitmask &= ~BIT(priority_bit);
}
}
+#endif
struct k_thread *z_priq_mq_best(struct _priq_mq *pq)
{