kernel: make _dump_ready_q() static and visible only with CONFIG_KERNEL_DEBUG
Fixes sparse warning: <snip>/zephyr/kernel/sched.c:368:6: warning: symbol '_dump_ready_q' was not declared. Should it be static? Change-Id: I156e89f1d74178bbd99cc25e532da544c7ebee60 Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
This commit is contained in:
parent
059544d1ae
commit
81bdee3592
1 changed files with 19 additions and 16 deletions
|
@ -221,6 +221,23 @@ void _pend_current_thread(_wait_q_t *wait_q, s32_t timeout)
|
|||
_pend_thread(_current, wait_q, timeout);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_PREEMPT_ENABLED) && defined(CONFIG_KERNEL_DEBUG)
|
||||
/* debug aid */
|
||||
static void _dump_ready_q(void)
|
||||
{
|
||||
K_DEBUG("bitmaps: ");
|
||||
for (int bitmap = 0; bitmap < K_NUM_PRIO_BITMAPS; bitmap++) {
|
||||
K_DEBUG("%x", _ready_q.prio_bmap[bitmap]);
|
||||
}
|
||||
K_DEBUG("\n");
|
||||
for (int prio = 0; prio < K_NUM_PRIORITIES; prio++) {
|
||||
K_DEBUG("prio: %d, head: %p\n",
|
||||
prio - _NUM_COOP_PRIO,
|
||||
sys_dlist_peek_head(&_ready_q.q[prio]));
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_PREEMPT_ENABLED && CONFIG_KERNEL_DEBUG */
|
||||
|
||||
/*
|
||||
* Check if there is a thread of higher prio than the current one. Should only
|
||||
* be called if we already know that the current thread is preemptible.
|
||||
|
@ -231,8 +248,9 @@ int __must_switch_threads(void)
|
|||
K_DEBUG("current prio: %d, highest prio: %d\n",
|
||||
_current->base.prio, _get_highest_ready_prio());
|
||||
|
||||
extern void _dump_ready_q(void);
|
||||
#ifdef CONFIG_KERNEL_DEBUG
|
||||
_dump_ready_q();
|
||||
#endif /* CONFIG_KERNEL_DEBUG */
|
||||
|
||||
return _is_prio_higher(_get_highest_ready_prio(), _current->base.prio);
|
||||
#else
|
||||
|
@ -364,21 +382,6 @@ k_tid_t k_current_get(void)
|
|||
return _current;
|
||||
}
|
||||
|
||||
/* debug aid */
|
||||
void _dump_ready_q(void)
|
||||
{
|
||||
K_DEBUG("bitmaps: ");
|
||||
for (int bitmap = 0; bitmap < K_NUM_PRIO_BITMAPS; bitmap++) {
|
||||
K_DEBUG("%x", _ready_q.prio_bmap[bitmap]);
|
||||
}
|
||||
K_DEBUG("\n");
|
||||
for (int prio = 0; prio < K_NUM_PRIORITIES; prio++) {
|
||||
K_DEBUG("prio: %d, head: %p\n",
|
||||
prio - _NUM_COOP_PRIO,
|
||||
sys_dlist_peek_head(&_ready_q.q[prio]));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TIMESLICING
|
||||
extern s32_t _time_slice_duration; /* Measured in ms */
|
||||
extern s32_t _time_slice_elapsed; /* Measured in ms */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue