diff --git a/arch/arm/src/armv7-a/arm_syscall.c b/arch/arm/src/armv7-a/arm_syscall.c index 454f230131..4ca5b9441f 100644 --- a/arch/arm/src/armv7-a/arm_syscall.c +++ b/arch/arm/src/armv7-a/arm_syscall.c @@ -250,6 +250,25 @@ uint32_t *arm_syscall(uint32_t *regs) } break; #endif + /* R0=SYS_save_context: This is a save context command: + * + * int up_saveusercontext(void *saveregs); + * + * At this point, the following values are saved in context: + * + * R0 = SYS_save_context + * R1 = saveregs + * + * In this case, we simply need to copy the current registers to the + * save register space references in the saved R1 and return. + */ + + case SYS_save_context: + { + DEBUGASSERT(regs[REG_R1] != 0); + memcpy((uint32_t *)regs[REG_R1], regs, XCPTCONTEXT_SIZE); + } + break; /* R0=SYS_restore_context: Restore task context *