From 7aa4032ac6f5096a0d4b32bbdc7e5798ac4d5d5d Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Thu, 31 Oct 2024 15:05:41 -0400 Subject: [PATCH] Revert "arch: arm: cortex_m: restore comment lost in translation" This reverts commit 7d7616214b90a26207e79a2e2fa3305e8a483db7. Signed-off-by: Anas Nashif --- arch/arm/core/cortex_m/swap.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/arch/arm/core/cortex_m/swap.c b/arch/arm/core/cortex_m/swap.c index 027fb47a01f0..b60f6acd675d 100644 --- a/arch/arm/core/cortex_m/swap.c +++ b/arch/arm/core/cortex_m/swap.c @@ -96,15 +96,11 @@ uintptr_t z_arm_pendsv_c(uintptr_t exc_ret) /* restore mode */ IF_ENABLED(CONFIG_USERSPACE, ({ - CONTROL_Type ctrl = {.w = __get_CONTROL()}; - /* exit privileged state when returning to thread mode. */ - ctrl.b.nPRIV = 0; - /* __set_CONTROL inserts an ISB which is may not be necessary here - * (stack pointer may not be touched), but it's recommended to avoid - * executing pre-fetched instructions with the previous privilege. - */ - __set_CONTROL(ctrl.w | current->arch.mode); - })); + CONTROL_Type ctrl = {.w = __get_CONTROL()}; + /* exit privileged state when returing to thread mode. */ + ctrl.b.nPRIV = 0; + __set_CONTROL(ctrl.w | current->arch.mode); + })); return exc_ret; }