diff --git a/cmake/compiler/xcc/compiler_flags.cmake b/cmake/compiler/xcc/compiler_flags.cmake index b089f3c7b93..a6205bbf546 100644 --- a/cmake/compiler/xcc/compiler_flags.cmake +++ b/cmake/compiler/xcc/compiler_flags.cmake @@ -4,4 +4,10 @@ if(CC STREQUAL "clang") include(${ZEPHYR_BASE}/cmake/compiler/clang/compiler_flags.cmake) else() include(${ZEPHYR_BASE}/cmake/compiler/gcc/compiler_flags.cmake) + + # XCC is based on GCC 4.2 which has a somewhat pedantic take on the + # fact that linkage semantics differed between C99 and GNU at the + # time. Suppress the warning, it's the best we can do given that + # it's a legacy compiler. + set_compiler_property(APPEND PROPERTY warning_base "-fgnu89-inline") endif() diff --git a/kernel/sched.c b/kernel/sched.c index c49354c1022..e7393278529 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -170,6 +170,23 @@ static ALWAYS_INLINE struct k_thread *_priq_dumb_mask_best(sys_dlist_t *pq) } #endif +ALWAYS_INLINE void z_priq_dumb_add(sys_dlist_t *pq, struct k_thread *thread) +{ + struct k_thread *t; + + __ASSERT_NO_MSG(!z_is_idle_thread_object(thread)); + + SYS_DLIST_FOR_EACH_CONTAINER(pq, t, base.qnode_dlist) { + if (z_sched_prio_cmp(thread, t) > 0) { + sys_dlist_insert(&t->base.qnode_dlist, + &thread->base.qnode_dlist); + return; + } + } + + sys_dlist_append(pq, &thread->base.qnode_dlist); +} + /* _current is never in the run queue until context switch on * SMP configurations, see z_requeue_current() */ @@ -927,23 +944,6 @@ void *z_get_next_switch_handle(void *interrupted) } #endif -ALWAYS_INLINE void z_priq_dumb_add(sys_dlist_t *pq, struct k_thread *thread) -{ - struct k_thread *t; - - __ASSERT_NO_MSG(!z_is_idle_thread_object(thread)); - - SYS_DLIST_FOR_EACH_CONTAINER(pq, t, base.qnode_dlist) { - if (z_sched_prio_cmp(thread, t) > 0) { - sys_dlist_insert(&t->base.qnode_dlist, - &thread->base.qnode_dlist); - return; - } - } - - sys_dlist_append(pq, &thread->base.qnode_dlist); -} - void z_priq_dumb_remove(sys_dlist_t *pq, struct k_thread *thread) { __ASSERT_NO_MSG(!z_is_idle_thread_object(thread));