diff --git a/kernel/include/kthread.h b/kernel/include/kthread.h index 57192cfd90..3ec6cf8883 100644 --- a/kernel/include/kthread.h +++ b/kernel/include/kthread.h @@ -56,7 +56,7 @@ static inline int is_preempt(struct k_thread *thread) } -static inline int is_metairq(struct k_thread *thread) +static inline int thread_is_metairq(struct k_thread *thread) { #if CONFIG_NUM_METAIRQ_PRIORITIES > 0 return (thread->base.prio - K_HIGHEST_THREAD_PRIO) @@ -209,7 +209,7 @@ static ALWAYS_INLINE bool should_preempt(struct k_thread *thread, /* Otherwise we have to be running a preemptible thread or * switching to a metairq */ - if (is_preempt(_current) || is_metairq(thread)) { + if (is_preempt(_current) || thread_is_metairq(thread)) { return true; } diff --git a/kernel/sched.c b/kernel/sched.c index 609ec4b124..6357b867b3 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -248,7 +248,7 @@ static ALWAYS_INLINE struct k_thread *next_up(void) */ struct k_thread *mirqp = _current_cpu->metairq_preempted; - if (mirqp != NULL && (thread == NULL || !is_metairq(thread))) { + if (mirqp != NULL && (thread == NULL || !thread_is_metairq(thread))) { if (!z_is_thread_prevented_from_running(mirqp)) { thread = mirqp; } else { @@ -333,11 +333,11 @@ static void update_metairq_preempt(struct k_thread *thread) { #if (CONFIG_NUM_METAIRQ_PRIORITIES > 0) && \ (CONFIG_NUM_COOP_PRIORITIES > CONFIG_NUM_METAIRQ_PRIORITIES) - if (is_metairq(thread) && !is_metairq(_current) && + if (thread_is_metairq(thread) && !thread_is_metairq(_current) && !is_preempt(_current)) { /* Record new preemption */ _current_cpu->metairq_preempted = _current; - } else if (!is_metairq(thread) && !z_is_idle_thread_object(thread)) { + } else if (!thread_is_metairq(thread) && !z_is_idle_thread_object(thread)) { /* Returning from existing preemption */ _current_cpu->metairq_preempted = NULL; }