Skip to content

Commit

Permalink
Revert "arch: arm: cortex_m: restore comment lost in translation"
Browse files Browse the repository at this point in the history
This reverts commit 7d76162.

Signed-off-by: Anas Nashif <[email protected]>
  • Loading branch information
nashif authored and mmahadevan108 committed Nov 1, 2024
1 parent aaeaef0 commit 7aa4032
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions arch/arm/core/cortex_m/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 7aa4032

Please sign in to comment.