From cb76cc17e9607e9d7c7aa90d01cac4db4ad5522b Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Tue, 9 Jan 2024 23:02:01 +0100 Subject: [PATCH] cpu/native: fix build with !core_thread --- cpu/native/native_cpu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cpu/native/native_cpu.c b/cpu/native/native_cpu.c index 5e9e96875a..13fff4e2c4 100644 --- a/cpu/native/native_cpu.c +++ b/cpu/native/native_cpu.c @@ -156,7 +156,8 @@ void isr_cpu_switch_context_exit(void) ucontext_t *ctx; DEBUG("isr_cpu_switch_context_exit\n"); - if ((sched_context_switch_request == 1) || (thread_get_active() == NULL)) { + if (((sched_context_switch_request == 1) || (thread_get_active() == NULL)) + && IS_USED(MODULE_CORE_THREAD)) { sched_run(); } @@ -210,7 +211,11 @@ void isr_thread_yield(void) native_irq_handler(); } + if (!IS_USED(MODULE_CORE_THREAD)) { + return; + } sched_run(); + /* Use intermediate cast to uintptr_t to silence -Wcast-align. * stacks are manually word aligned in thread_static_init() */ ucontext_t *ctx = (ucontext_t *)(uintptr_t)(thread_get_active()->sp);