diff --git a/arch/arm64/include/irq.h b/arch/arm64/include/irq.h index 6c927a6725ebd..3c67bca579f07 100644 --- a/arch/arm64/include/irq.h +++ b/arch/arm64/include/irq.h @@ -447,8 +447,9 @@ static inline void up_irq_restore(irqstate_t flags) { \ if (!up_interrupt_context()) \ { \ - sys_call2(SYS_switch_context, (uintptr_t)rtcb, (uintptr_t)tcb); \ + sys_call0(SYS_switch_context); \ } \ + UNUSED(rtcb); \ } \ while (0) diff --git a/arch/arm64/src/common/arm64_exit.c b/arch/arm64/src/common/arm64_exit.c index 793533f76ebfb..2d291a1599e25 100644 --- a/arch/arm64/src/common/arm64_exit.c +++ b/arch/arm64/src/common/arm64_exit.c @@ -57,24 +57,17 @@ void up_exit(int status) { - struct tcb_s *tcb = this_task(); UNUSED(status); /* Destroy the task at the head of the ready to run list. */ nxtask_exit(); - /* Now, perform the context switch to the new ready-to-run task at the - * head of the list. - */ - - tcb = this_task(); - /* Scheduler parameters will update inside syscall */ g_running_tasks[this_cpu()] = NULL; /* Then switch contexts */ - arm64_fullcontextrestore(tcb); + arm64_fullcontextrestore(); } diff --git a/arch/arm64/src/common/arm64_internal.h b/arch/arm64/src/common/arm64_internal.h index 5badadb9af2c6..e9e1daa75549f 100644 --- a/arch/arm64/src/common/arm64_internal.h +++ b/arch/arm64/src/common/arm64_internal.h @@ -112,10 +112,10 @@ /* Context switching */ -#define arm64_fullcontextrestore(next) \ +#define arm64_fullcontextrestore() \ do \ { \ - sys_call1(SYS_restore_context, (uintptr_t)next); \ + sys_call0(SYS_restore_context); \ } \ while (1) diff --git a/arch/arm64/src/common/arm64_sigdeliver.c b/arch/arm64/src/common/arm64_sigdeliver.c index 3161f8859cb04..0994678428cd1 100644 --- a/arch/arm64/src/common/arm64_sigdeliver.c +++ b/arch/arm64/src/common/arm64_sigdeliver.c @@ -162,5 +162,5 @@ void arm64_sigdeliver(void) #endif g_running_tasks[this_cpu()] = NULL; - arm64_fullcontextrestore(rtcb); + arm64_fullcontextrestore(); }