Skip to content

Commit

Permalink
cpu/native: fix build with !core_thread
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed Jan 9, 2024
1 parent 112e378 commit cb76cc1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cpu/native/native_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit cb76cc1

Please sign in to comment.