Skip to content

Commit d80fc81

Browse files
committed
Set uVisor main stack guard protection for v8-M
1 parent a1b1751 commit d80fc81

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/system/src/main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,15 @@ UVISOR_NAKED void main_entry(uint32_t caller)
7676
"it eq\n"
7777
"popeq {pc}\n"
7878

79-
/* Set the MSP. Since we are changing stacks we need to pop and re-push
79+
/* Set the MSP and MSPLIM. Since we are changing stacks we need to pop and re-push
8080
* the lr value. */
8181
"pop {r0}\n"
8282
"ldr r1, =__uvisor_stack_top__\n"
8383
"msr MSP, r1\n"
84+
#if defined(ARCH_CORE_ARMv8M)
85+
"ldr r1, =__uvisor_stack_start__\n"
86+
"msr MSPLIM, r1\n"
87+
#endif
8488
"push {r0}\n"
8589

8690
/* First initialization stage. */

0 commit comments

Comments
 (0)