diff --git a/cpu/native/irq_cpu.c b/cpu/native/irq_cpu.c index 3ec4fcafb9..b9359225b0 100644 --- a/cpu/native/irq_cpu.c +++ b/cpu/native/irq_cpu.c @@ -298,9 +298,9 @@ void native_isr_entry(int sig, siginfo_t *info, void *context) if (context == NULL) { errx(EXIT_FAILURE, "native_isr_entry: context is null - unhandled"); } - if (sched_active_thread == NULL) { + if (thread_get_active() == NULL) { _native_in_isr++; - warnx("native_isr_entry: sched_active_thread is null - unhandled"); + warnx("native_isr_entry: thread_get_active() is null - unhandled"); _native_in_isr--; return; } @@ -325,7 +325,7 @@ void native_isr_entry(int sig, siginfo_t *info, void *context) native_isr_context.uc_stack.ss_size = sizeof(__isr_stack); native_isr_context.uc_stack.ss_flags = 0; makecontext(&native_isr_context, native_irq_handler, 0); - _native_cur_ctx = (ucontext_t *)sched_active_thread->sp; + _native_cur_ctx = (ucontext_t *)thread_get_active()->sp; DEBUG("\n\n\t\tnative_isr_entry: return to _native_sig_leave_tramp\n\n"); /* disable interrupts in context */ diff --git a/cpu/native/native_cpu.c b/cpu/native/native_cpu.c index 655562565e..74d24a42e5 100644 --- a/cpu/native/native_cpu.c +++ b/cpu/native/native_cpu.c @@ -142,12 +142,12 @@ void isr_cpu_switch_context_exit(void) ucontext_t *ctx; DEBUG("isr_cpu_switch_context_exit\n"); - if ((sched_context_switch_request == 1) || (sched_active_thread == NULL)) { + if ((sched_context_switch_request == 1) || (thread_get_active() == NULL)) { sched_run(); } - DEBUG("isr_cpu_switch_context_exit: calling setcontext(%" PRIkernel_pid ")\n\n", sched_active_pid); - ctx = (ucontext_t *)(sched_active_thread->sp); + DEBUG("isr_cpu_switch_context_exit: calling setcontext(%" PRIkernel_pid ")\n\n", thread_getpid()); + ctx = (ucontext_t *)(thread_get_active()->sp); native_interrupts_enabled = 1; _native_mod_ctx_leave_sigh(ctx); @@ -195,8 +195,9 @@ void isr_thread_yield(void) } sched_run(); - ucontext_t *ctx = (ucontext_t *)(sched_active_thread->sp); - DEBUG("isr_thread_yield: switching to(%" PRIkernel_pid ")\n\n", sched_active_pid); + ucontext_t *ctx = (ucontext_t *)(thread_get_active()->sp); + DEBUG("isr_thread_yield: switching to(%" PRIkernel_pid ")\n\n", + thread_getpid()); native_interrupts_enabled = 1; _native_mod_ctx_leave_sigh(ctx); @@ -211,7 +212,7 @@ void thread_yield_higher(void) sched_context_switch_request = 1; if (_native_in_isr == 0) { - ucontext_t *ctx = (ucontext_t *)(sched_active_thread->sp); + ucontext_t *ctx = (ucontext_t *)(thread_get_active()->sp); _native_in_isr = 1; if (!native_interrupts_enabled) { warnx("thread_yield_higher: interrupts are disabled - this should not be"); diff --git a/cpu/native/syscalls.c b/cpu/native/syscalls.c index 9b6d2f7acf..b597d6ebac 100644 --- a/cpu/native/syscalls.c +++ b/cpu/native/syscalls.c @@ -125,11 +125,11 @@ void _native_syscall_leave(void) && (_native_in_isr == 0) && (_native_in_syscall == 0) && (native_interrupts_enabled == 1) - && (sched_active_thread != NULL) + && (thread_get_active() != NULL) ) { _native_in_isr = 1; - _native_cur_ctx = (ucontext_t *)sched_active_thread->sp; + _native_cur_ctx = (ucontext_t *)thread_get_active()->sp; native_isr_context.uc_stack.ss_sp = __isr_stack; native_isr_context.uc_stack.ss_size = SIGSTKSZ; native_isr_context.uc_stack.ss_flags = 0;