Skip to content
Browse files

arch: arm: userspace: don't subtract MPU guard from top of stack

ip register holds the stack_info.size (it is passed as argument
into z_arch_user_mode_enter(.)). We trust that the value of
stack_info.size contains the accurate size of the writable
stack buffer, above stack_info.start (as specified in kernel.h).
Therefore, we do not need to subtract any bytes for the MPU
stack guard. This allows us to clean-up one more occurrence of

Signed-off-by: Ioannis Glaropoulos <>
  • Loading branch information...
ioannisg authored and andrewboie committed May 24, 2019
1 parent 312b43f commit b3114efc5a5a7f06438a4edd1d700756a13e90f8
Showing with 0 additions and 4 deletions.
  1. +0 −4 arch/arm/core/userspace.S
@@ -90,10 +90,6 @@ SECTION_FUNC(TEXT,z_arm_userspace_enter)
ldr r0, [ip]
ldr ip, [ip, #4]

/* Guard is taken out of size, so adjust beginning and size of stack */

/* push args to stack */
push {r0,r1,r2,r3,ip,lr}

0 comments on commit b3114ef

Please sign in to comment.
You can’t perform that action at this time.