diff --git a/arch/arm/include/irq.h b/arch/arm/include/irq.h index d6fd08cdddb23..6f96b99511557 100644 --- a/arch/arm/include/irq.h +++ b/arch/arm/include/irq.h @@ -82,13 +82,13 @@ #ifndef __ASSEMBLY__ #ifndef up_switch_context -#define up_switch_context(tcb, rtcb) \ - do { \ - if (!up_interrupt_context()) \ - { \ - sys_call2(SYS_switch_context, (uintptr_t)&rtcb->xcp.regs, \ - (uintptr_t)tcb->xcp.regs); \ - } \ +#define up_switch_context(tcb, rtcb) \ + do { \ + if (!up_interrupt_context()) \ + { \ + sys_call0(SYS_switch_context); \ + } \ + UNUSED(rtcb); \ } while (0) #endif diff --git a/arch/arm/src/arm/arm_sigdeliver.c b/arch/arm/src/arm/arm_sigdeliver.c index b55e820604f65..a76152b535439 100644 --- a/arch/arm/src/arm/arm_sigdeliver.c +++ b/arch/arm/src/arm/arm_sigdeliver.c @@ -54,7 +54,6 @@ void arm_sigdeliver(void) { struct tcb_s *rtcb = this_task(); - uint32_t *regs = rtcb->xcp.saved_regs; board_autoled_on(LED_SIGNAL); @@ -99,5 +98,6 @@ void arm_sigdeliver(void) board_autoled_off(LED_SIGNAL); g_running_tasks[this_cpu()] = NULL; - arm_fullcontextrestore(regs); + rtcb->xcp.regs = rtcb->xcp.saved_regs; + arm_fullcontextrestore(); } diff --git a/arch/arm/src/arm/arm_syscall.c b/arch/arm/src/arm/arm_syscall.c index 338c2216e6857..7443e27c1dfc8 100644 --- a/arch/arm/src/arm/arm_syscall.c +++ b/arch/arm/src/arm/arm_syscall.c @@ -79,46 +79,7 @@ uint32_t *arm_syscall(uint32_t *regs) switch (cmd) { - /* R0=SYS_restore_context: Restore task context - * - * void arm_fullcontextrestore(uint32_t *restoreregs) - * noreturn_function; - * - * At this point, the following values are saved in context: - * - * R0 = SYS_restore_context - * R1 = restoreregs - */ - case SYS_restore_context: - { - /* Replace 'regs' with the pointer to the register set in - * regs[REG_R1]. On return from the system call, that register - * set will determine the restored context. - */ - - tcb->xcp.regs = (uint32_t *)regs[REG_R1]; - DEBUGASSERT(up_interrupt_context()); - } - break; - - /* R0=SYS_switch_context: This a switch context command: - * - * void arm_switchcontext(uint32_t **saveregs, - * uint32_t *restoreregs); - * - * At this point, the following values are saved in context: - * - * R0 = SYS_switch_context - * R1 = saveregs - * R2 = restoreregs - * - * In this case, we do both: We save the context registers to the save - * register area reference by the saved contents of R1 and then set - * regs to the save register area referenced by the saved - * contents of R2. - */ - case SYS_switch_context: break; diff --git a/arch/arm/src/armv6-m/arm_sigdeliver.c b/arch/arm/src/armv6-m/arm_sigdeliver.c index fa6797351d086..5fd3f44463ba3 100644 --- a/arch/arm/src/armv6-m/arm_sigdeliver.c +++ b/arch/arm/src/armv6-m/arm_sigdeliver.c @@ -162,5 +162,8 @@ void arm_sigdeliver(void) leave_critical_section((uint16_t)regs[REG_PRIMASK]); rtcb->irqcount--; #endif - arm_fullcontextrestore(regs); + g_running_tasks[this_cpu()] = NULL; + rtcb->xcp.regs = rtcb->xcp.saved_regs; + arm_fullcontextrestore(); + UNUSED(regs); } diff --git a/arch/arm/src/armv6-m/arm_svcall.c b/arch/arm/src/armv6-m/arm_svcall.c index 2ae54ac4ec2bd..c1ddd8d0e6ee9 100644 --- a/arch/arm/src/armv6-m/arm_svcall.c +++ b/arch/arm/src/armv6-m/arm_svcall.c @@ -117,9 +117,8 @@ static void dispatch_syscall(void) int arm_svcall(int irq, void *context, void *arg) { - struct tcb_s *tcb = this_task(); uint32_t *regs = (uint32_t *)context; - uint32_t *new_regs = regs; + struct tcb_s *tcb; uint32_t cmd; cmd = regs[REG_R0]; @@ -149,41 +148,15 @@ int arm_svcall(int irq, void *context, void *arg) switch (cmd) { - /* R0=SYS_restore_context: This a restore context command: - * - * void arm_fullcontextrestore(uint32_t *restoreregs) - * noreturn_function; - * - * At this point, the following values are saved in context: - * - * R0 = SYS_restore_context - * R1 = restoreregs - */ - case SYS_restore_context: - { - DEBUGASSERT(regs[REG_R1] != 0); - new_regs = (uint32_t *)regs[REG_R1]; - tcb->xcp.regs = (uint32_t *)regs[REG_R1]; - } - break; - - /* R0=SYS_switch_context: This a switch context command: - * - * void arm_switchcontext(uint32_t **saveregs, - * uint32_t *restoreregs); - * - * At this point, the following values are saved in context: - * - * R0 = SYS_switch_context - * R1 = saveregs - * R2 = restoreregs - */ - case SYS_switch_context: { - DEBUGASSERT(regs[REG_R1] != 0 && regs[REG_R2] != 0); - new_regs = (uint32_t *)regs[REG_R2]; + tcb = this_task(); + restore_critical_section(tcb, this_cpu()); + +#ifdef CONFIG_DEBUG_SYSCALL_INFO + regs = tcb->xcp.regs; +#endif } break; @@ -437,30 +410,23 @@ int arm_svcall(int irq, void *context, void *arg) * switch. */ - if (regs != new_regs) - { - restore_critical_section(tcb, this_cpu()); - -#ifdef CONFIG_DEBUG_SYSCALL_INFO - regs = new_regs; - - svcinfo("SVCall Return:\n"); - svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", - regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], - regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", - regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], - regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); - svcinfo(" PSR: %08x EXC_RETURN: %08x CONTROL: %08x\n", - regs[REG_XPSR], regs[REG_EXC_RETURN], regs[REG_CONTROL]); -#endif - } #ifdef CONFIG_DEBUG_SYSCALL_INFO - else +# ifndef CONFIG_DEBUG_SVCALL + if (cmd > SYS_switch_context) +# endif { - svcinfo("SVCall Return: %d\n", regs[REG_R0]); + svcinfo("SVCall Return:\n"); + svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], + regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); + svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], + regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); + svcinfo(" PSR: %08x EXC_RETURN: %08x CONTROL: %08x\n", + regs[REG_XPSR], regs[REG_EXC_RETURN], regs[REG_CONTROL]); } #endif + UNUSED(tcb); return OK; } diff --git a/arch/arm/src/armv7-a/arm_sigdeliver.c b/arch/arm/src/armv7-a/arm_sigdeliver.c index 1867aa8844605..5c0e058a4e6af 100644 --- a/arch/arm/src/armv7-a/arm_sigdeliver.c +++ b/arch/arm/src/armv7-a/arm_sigdeliver.c @@ -162,5 +162,7 @@ void arm_sigdeliver(void) #endif g_running_tasks[this_cpu()] = NULL; - arm_fullcontextrestore(regs); + rtcb->xcp.regs = rtcb->xcp.saved_regs; + arm_fullcontextrestore(); + UNUSED(regs); } diff --git a/arch/arm/src/armv7-a/arm_syscall.c b/arch/arm/src/armv7-a/arm_syscall.c index 3e43e961bfd83..f31e4031553ab 100644 --- a/arch/arm/src/armv7-a/arm_syscall.c +++ b/arch/arm/src/armv7-a/arm_syscall.c @@ -255,47 +255,7 @@ uint32_t *arm_syscall(uint32_t *regs) } break; #endif - - /* R0=SYS_restore_context: Restore task context - * - * void arm_fullcontextrestore(uint32_t *restoreregs) - * noreturn_function; - * - * At this point, the following values are saved in context: - * - * R0 = SYS_restore_context - * R1 = restoreregs - */ - case SYS_restore_context: - { - /* Replace 'regs' with the pointer to the register set in - * regs[REG_R1]. On return from the system call, that register - * set will determine the restored context. - */ - - tcb->xcp.regs = (uint32_t *)regs[REG_R1]; - DEBUGASSERT(up_interrupt_context()); - } - break; - - /* R0=SYS_switch_context: This a switch context command: - * - * void arm_switchcontext(uint32_t **saveregs, - * uint32_t *restoreregs); - * - * At this point, the following values are saved in context: - * - * R0 = SYS_switch_context - * R1 = saveregs - * R2 = restoreregs - * - * In this case, we do both: We save the context registers to the save - * register area reference by the saved contents of R1 and then set - * regs to the save register area referenced by the saved - * contents of R2. - */ - case SYS_switch_context: break; diff --git a/arch/arm/src/armv7-m/arm_sigdeliver.c b/arch/arm/src/armv7-m/arm_sigdeliver.c index 524f2c445b691..5642e82623e92 100644 --- a/arch/arm/src/armv7-m/arm_sigdeliver.c +++ b/arch/arm/src/armv7-m/arm_sigdeliver.c @@ -174,5 +174,9 @@ void arm_sigdeliver(void) #endif rtcb->irqcount--; #endif - arm_fullcontextrestore(regs); + + g_running_tasks[this_cpu()] = NULL; + rtcb->xcp.regs = rtcb->xcp.saved_regs; + arm_fullcontextrestore(); + UNUSED(regs); } diff --git a/arch/arm/src/armv7-m/arm_svcall.c b/arch/arm/src/armv7-m/arm_svcall.c index cd3a7e214a667..9da7ea387a3be 100644 --- a/arch/arm/src/armv7-m/arm_svcall.c +++ b/arch/arm/src/armv7-m/arm_svcall.c @@ -125,9 +125,8 @@ static void dispatch_syscall(void) int arm_svcall(int irq, void *context, void *arg) { - struct tcb_s *tcb = this_task(); uint32_t *regs = (uint32_t *)context; - uint32_t *new_regs = regs; + struct tcb_s *tcb; uint32_t cmd; cmd = regs[REG_R0]; @@ -157,41 +156,15 @@ int arm_svcall(int irq, void *context, void *arg) switch (cmd) { - /* R0=SYS_restore_context: This a restore context command: - * - * void arm_fullcontextrestore(uint32_t *restoreregs) - * noreturn_function; - * - * At this point, the following values are saved in context: - * - * R0 = SYS_restore_context - * R1 = restoreregs - */ - case SYS_restore_context: - { - DEBUGASSERT(regs[REG_R1] != 0); - new_regs = (uint32_t *)regs[REG_R1]; - tcb->xcp.regs = (uint32_t *)regs[REG_R1]; - } - break; - - /* R0=SYS_switch_context: This a switch context command: - * - * void arm_switchcontext(uint32_t **saveregs, - * uint32_t *restoreregs); - * - * At this point, the following values are saved in context: - * - * R0 = SYS_switch_context - * R1 = saveregs - * R2 = restoreregs - */ - case SYS_switch_context: { - DEBUGASSERT(regs[REG_R1] != 0 && regs[REG_R2] != 0); - new_regs = (uint32_t *)regs[REG_R2]; + tcb = this_task(); + restore_critical_section(tcb, this_cpu()); + +#ifdef CONFIG_DEBUG_SYSCALL_INFO + regs = tcb->xcp.regs; +#endif } break; @@ -446,30 +419,23 @@ int arm_svcall(int irq, void *context, void *arg) * switch. */ - if (regs != new_regs) - { - restore_critical_section(tcb, this_cpu()); - #ifdef CONFIG_DEBUG_SYSCALL_INFO - regs = new_regs; - - svcinfo("SVCall Return:\n"); - svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", - regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], - regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", - regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], - regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); - svcinfo(" PSR: %08x EXC_RETURN: %08x CONTROL: %08x\n", - regs[REG_XPSR], regs[REG_EXC_RETURN], regs[REG_CONTROL]); -#endif - } -#ifdef CONFIG_DEBUG_SYSCALL_INFO - else +# ifndef CONFIG_DEBUG_SVCALL + if (cmd > SYS_switch_context) +# endif { - svcinfo("SVCall Return: %d\n", regs[REG_R0]); + svcinfo("SVCall Return:\n"); + svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], + regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); + svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], + regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); + svcinfo(" PSR: %08x EXC_RETURN: %08x CONTROL: %08x\n", + regs[REG_XPSR], regs[REG_EXC_RETURN], regs[REG_CONTROL]); } #endif + UNUSED(tcb); return OK; } diff --git a/arch/arm/src/armv7-r/arm_sigdeliver.c b/arch/arm/src/armv7-r/arm_sigdeliver.c index 5a63458b9b04f..009ad90657d87 100644 --- a/arch/arm/src/armv7-r/arm_sigdeliver.c +++ b/arch/arm/src/armv7-r/arm_sigdeliver.c @@ -159,5 +159,7 @@ void arm_sigdeliver(void) #endif g_running_tasks[this_cpu()] = NULL; - arm_fullcontextrestore(regs); + rtcb->xcp.regs = rtcb->xcp.saved_regs; + arm_fullcontextrestore(); + UNUSED(regs); } diff --git a/arch/arm/src/armv7-r/arm_syscall.c b/arch/arm/src/armv7-r/arm_syscall.c index 414518012e88f..315a6f42d4723 100644 --- a/arch/arm/src/armv7-r/arm_syscall.c +++ b/arch/arm/src/armv7-r/arm_syscall.c @@ -253,46 +253,7 @@ uint32_t *arm_syscall(uint32_t *regs) break; #endif - /* R0=SYS_restore_context: Restore task context - * - * void arm_fullcontextrestore(uint32_t *restoreregs) - * noreturn_function; - * - * At this point, the following values are saved in context: - * - * R0 = SYS_restore_context - * R1 = restoreregs - */ - case SYS_restore_context: - { - /* Replace 'regs' with the pointer to the register set in - * regs[REG_R1]. On return from the system call, that register - * set will determine the restored context. - */ - - tcb->xcp.regs = (uint32_t *)regs[REG_R1]; - DEBUGASSERT(up_interrupt_context()); - } - break; - - /* R0=SYS_switch_context: This a switch context command: - * - * void arm_switchcontext(uint32_t **saveregs, - * uint32_t *restoreregs); - * - * At this point, the following values are saved in context: - * - * R0 = SYS_switch_context - * R1 = saveregs - * R2 = restoreregs - * - * In this case, we do both: We save the context registers to the save - * register area reference by the saved contents of R1 and then set - * regs to the save register area referenced by the saved - * contents of R2. - */ - case SYS_switch_context: break; diff --git a/arch/arm/src/armv8-m/arm_sigdeliver.c b/arch/arm/src/armv8-m/arm_sigdeliver.c index 2db03f17d166b..aff8738235c16 100644 --- a/arch/arm/src/armv8-m/arm_sigdeliver.c +++ b/arch/arm/src/armv8-m/arm_sigdeliver.c @@ -174,5 +174,8 @@ void arm_sigdeliver(void) #endif rtcb->irqcount--; #endif - arm_fullcontextrestore(regs); + g_running_tasks[this_cpu()] = NULL; + rtcb->xcp.regs = rtcb->xcp.saved_regs; + arm_fullcontextrestore(); + UNUSED(regs); } diff --git a/arch/arm/src/armv8-m/arm_svcall.c b/arch/arm/src/armv8-m/arm_svcall.c index 2a42d19dc7dc8..32e78636c7a07 100644 --- a/arch/arm/src/armv8-m/arm_svcall.c +++ b/arch/arm/src/armv8-m/arm_svcall.c @@ -125,9 +125,8 @@ static void dispatch_syscall(void) int arm_svcall(int irq, void *context, void *arg) { - struct tcb_s *tcb = this_task(); uint32_t *regs = (uint32_t *)context; - uint32_t *new_regs = regs; + struct tcb_s *tcb; uint32_t cmd; cmd = regs[REG_R0]; @@ -157,41 +156,15 @@ int arm_svcall(int irq, void *context, void *arg) switch (cmd) { - /* R0=SYS_restore_context: This a restore context command: - * - * void arm_fullcontextrestore(uint32_t *restoreregs) - * noreturn_function; - * - * At this point, the following values are saved in context: - * - * R0 = SYS_restore_context - * R1 = restoreregs - */ - case SYS_restore_context: - { - DEBUGASSERT(regs[REG_R1] != 0); - new_regs = (uint32_t *)regs[REG_R1]; - tcb->xcp.regs = (uint32_t *)regs[REG_R1]; - } - break; - - /* R0=SYS_switch_context: This a switch context command: - * - * void arm_switchcontext(uint32_t **saveregs, - * uint32_t *restoreregs); - * - * At this point, the following values are saved in context: - * - * R0 = SYS_switch_context - * R1 = saveregs - * R2 = restoreregs - */ - case SYS_switch_context: { - DEBUGASSERT(regs[REG_R1] != 0 && regs[REG_R2] != 0); - new_regs = (uint32_t *)regs[REG_R2]; + tcb = this_task(); + restore_critical_section(tcb, this_cpu()); + +#ifdef CONFIG_DEBUG_SYSCALL_INFO + regs = tcb->xcp.regs; +#endif } break; @@ -446,30 +419,23 @@ int arm_svcall(int irq, void *context, void *arg) * switch. */ - if (regs != new_regs) - { - restore_critical_section(tcb, this_cpu()); - #ifdef CONFIG_DEBUG_SYSCALL_INFO - regs = new_regs; - - svcinfo("SVCall Return:\n"); - svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", - regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], - regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", - regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], - regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); - svcinfo(" PSR: %08x EXC_RETURN: %08x CONTROL: %08x\n", - regs[REG_XPSR], regs[REG_EXC_RETURN], regs[REG_CONTROL]); -#endif - } -#ifdef CONFIG_DEBUG_SYSCALL_INFO - else +# ifndef CONFIG_DEBUG_SVCALL + if (cmd > SYS_switch_context) +# endif { - svcinfo("SVCall Return: %d\n", regs[REG_R0]); + svcinfo("SVCall Return:\n"); + svcinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], + regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); + svcinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], + regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); + svcinfo(" PSR: %08x EXC_RETURN: %08x CONTROL: %08x\n", + regs[REG_XPSR], regs[REG_EXC_RETURN], regs[REG_CONTROL]); } #endif + UNUSED(tcb); return OK; } diff --git a/arch/arm/src/armv8-r/arm_sigdeliver.c b/arch/arm/src/armv8-r/arm_sigdeliver.c index e4a8ad59353b1..5e4015e986a55 100644 --- a/arch/arm/src/armv8-r/arm_sigdeliver.c +++ b/arch/arm/src/armv8-r/arm_sigdeliver.c @@ -157,5 +157,7 @@ void arm_sigdeliver(void) #endif g_running_tasks[this_cpu()] = NULL; - arm_fullcontextrestore(regs); + rtcb->xcp.regs = rtcb->xcp.saved_regs; + arm_fullcontextrestore(); + UNUSED(regs); } diff --git a/arch/arm/src/armv8-r/arm_syscall.c b/arch/arm/src/armv8-r/arm_syscall.c index f1a4d8175b08e..e478aafecf618 100644 --- a/arch/arm/src/armv8-r/arm_syscall.c +++ b/arch/arm/src/armv8-r/arm_syscall.c @@ -253,46 +253,7 @@ uint32_t *arm_syscall(uint32_t *regs) break; #endif - /* R0=SYS_restore_context: Restore task context - * - * void arm_fullcontextrestore(uint32_t *restoreregs) - * noreturn_function; - * - * At this point, the following values are saved in context: - * - * R0 = SYS_restore_context - * R1 = restoreregs - */ - case SYS_restore_context: - { - /* Replace 'regs' with the pointer to the register set in - * regs[REG_R1]. On return from the system call, that register - * set will determine the restored context. - */ - - tcb->xcp.regs = (uint32_t *)regs[REG_R1]; - DEBUGASSERT(up_interrupt_context()); - } - break; - - /* R0=SYS_switch_context: This a switch context command: - * - * void arm_switchcontext(uint32_t **saveregs, - * uint32_t *restoreregs); - * - * At this point, the following values are saved in context: - * - * R0 = SYS_switch_context - * R1 = saveregs - * R2 = restoreregs - * - * In this case, we do both: We save the context registers to the save - * register area reference by the saved contents of R1 and then set - * regs to the save register area referenced by the saved - * contents of R2. - */ - case SYS_switch_context: break; diff --git a/arch/arm/src/common/arm_exit.c b/arch/arm/src/common/arm_exit.c index f238dfa5f3fb6..fa49dc5fed785 100644 --- a/arch/arm/src/common/arm_exit.c +++ b/arch/arm/src/common/arm_exit.c @@ -54,25 +54,17 @@ void up_exit(int status) { - struct tcb_s *tcb = this_task(); - /* 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 */ - arm_fullcontextrestore(tcb->xcp.regs); + arm_fullcontextrestore(); /* arm_fullcontextrestore() should not return but could if the software * interrupts are disabled. diff --git a/arch/arm/src/common/arm_internal.h b/arch/arm/src/common/arm_internal.h index 6303c6fc96da4..b76ca2facce1f 100644 --- a/arch/arm/src/common/arm_internal.h +++ b/arch/arm/src/common/arm_internal.h @@ -147,8 +147,8 @@ /* Context switching */ #ifndef arm_fullcontextrestore -# define arm_fullcontextrestore(restoreregs) \ - sys_call1(SYS_restore_context, (uintptr_t)restoreregs); +# define arm_fullcontextrestore() \ + sys_call0(SYS_restore_context); #else extern void arm_fullcontextrestore(uint32_t *restoreregs); #endif