Skip to content

Commit

Permalink
tests: kernel: userspace: correct address of thread priv stack start
Browse files Browse the repository at this point in the history
In ARM architecture z_priv_stack_find() returns the start of a
thread's privilege stack; we do not need to subtract the length
of a (possible) stack guard. This commit corrects the assigning
of the start address of a thread privilege stack in
test/kerne/mem_protect/mem_protect/userspace.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
  • Loading branch information
ioannisg authored and andrewboie committed Jun 17, 2019
1 parent c06a74c commit 02a3c52
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/kernel/mem_protect/userspace/src/main.c
Expand Up @@ -1095,8 +1095,7 @@ void test_main(void)
k_mem_domain_add_thread(&dom0, k_current_get());

#if defined(CONFIG_ARM)
priv_stack_ptr = (int *)z_priv_stack_find(ztest_thread_stack) -
MPU_GUARD_ALIGN_AND_SIZE;
priv_stack_ptr = (int *)z_priv_stack_find(ztest_thread_stack);

#endif
k_thread_access_grant(k_current_get(),
Expand Down

0 comments on commit 02a3c52

Please sign in to comment.