tests: threads: fix kernel/thread_stack test

Fix the broken logic in the kernel/thread_stack test
The modified test should do direct read & write from estimated stack
pointer to highest address in the stack buffer.
Previously this test was start from lowest address in the stack
which would trigger exception of hardware stack checking scheme
violation on ARC boards and other targets with hardware stack
overflow detection.

Signed-off-by: Yuguo Zou <yuguo.zou@synopsys.com>
This commit is contained in:
Yuguo Zou 2021-09-24 15:58:14 +08:00 committed by Anas Nashif
commit 5b590faab5

View file

@ -160,8 +160,8 @@ void stack_buffer_scenarios(void)
*
* First test does direct read & write starting at the estimated
* stack pointer up to the highest addresses in the buffer
* Starting from &val which is close enough to stack pointer
*/
val = *stack_start;
stack_ptr = &val;
for (pos = stack_ptr; pos < stack_end; pos++) {
/* pos is volatile so this doesn't get optimized out */