diff --git a/arch/arm/src/armv6-m/arm_svcall.c b/arch/arm/src/armv6-m/arm_svcall.c index 62f57e302a47d..4bda7e1ad664d 100644 --- a/arch/arm/src/armv6-m/arm_svcall.c +++ b/arch/arm/src/armv6-m/arm_svcall.c @@ -474,7 +474,7 @@ int arm_svcall(int irq, void *context, void *arg) # endif #endif - if (regs != up_current_regs()) + if (regs != tcb->xcp.regs) { restore_critical_section(this_task(), this_cpu()); } diff --git a/arch/arm/src/armv7-m/arm_svcall.c b/arch/arm/src/armv7-m/arm_svcall.c index 6c6f507aeca1b..1ccd70650d9f0 100644 --- a/arch/arm/src/armv7-m/arm_svcall.c +++ b/arch/arm/src/armv7-m/arm_svcall.c @@ -483,7 +483,7 @@ int arm_svcall(int irq, void *context, void *arg) # endif #endif - if (regs != up_current_regs()) + if (regs != tcb->xcp.regs) { restore_critical_section(this_task(), this_cpu()); } diff --git a/arch/arm/src/armv8-m/arm_svcall.c b/arch/arm/src/armv8-m/arm_svcall.c index aeb427322c07d..f364767c40c89 100644 --- a/arch/arm/src/armv8-m/arm_svcall.c +++ b/arch/arm/src/armv8-m/arm_svcall.c @@ -484,7 +484,7 @@ int arm_svcall(int irq, void *context, void *arg) # endif #endif - if (regs != up_current_regs()) + if (regs != tcb->xcp.regs) { restore_critical_section(this_task(), this_cpu()); }