xtensa: userspace: only write 0xAA to stack if INIT_STACKS
Only clear the user stack to 0xAA if CONFIG_INIT_STACKS is enabled. Otherwise, write 0x00 as if the stack is in BSS. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
0e7def1977
commit
0d79481540
1 changed files with 3 additions and 2 deletions
|
@ -1057,7 +1057,8 @@ static inline int reset_region(uint32_t *ptables, uintptr_t start, size_t size,
|
||||||
|
|
||||||
void xtensa_user_stack_perms(struct k_thread *thread)
|
void xtensa_user_stack_perms(struct k_thread *thread)
|
||||||
{
|
{
|
||||||
(void)memset((void *)thread->stack_info.start, 0xAA,
|
(void)memset((void *)thread->stack_info.start,
|
||||||
|
(IS_ENABLED(CONFIG_INIT_STACKS)) ? 0xAA : 0x00,
|
||||||
thread->stack_info.size - thread->stack_info.delta);
|
thread->stack_info.size - thread->stack_info.delta);
|
||||||
|
|
||||||
update_region(thread_page_tables_get(thread),
|
update_region(thread_page_tables_get(thread),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue