From e0aba8cb9edd3630be3b81e1f1c3e8bdaf728d1e Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Sat, 27 Mar 2021 11:15:43 +0100 Subject: score: Fix task stack initialization Do not adjust the stack area begin address since this may confuse the stack allocator and result in failed stack frees. Account for the alignment overhead in the stack space size estimate. Check that the stack size is in the expected interval. --- testsuites/psxtests/psxconfig01/init.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'testsuites/psxtests/psxconfig01/init.c') diff --git a/testsuites/psxtests/psxconfig01/init.c b/testsuites/psxtests/psxconfig01/init.c index 6d7a227793..96bd4d8b3d 100644 --- a/testsuites/psxtests/psxconfig01/init.c +++ b/testsuites/psxtests/psxconfig01/init.c @@ -480,7 +480,11 @@ static rtems_task Init(rtems_task_argument argument) eno = pthread_attr_getstacksize(&attr, &stack_size); rtems_test_assert(eno == 0); - rtems_test_assert(stack_size == CPU_STACK_MINIMUM_SIZE); + rtems_test_assert(stack_size >= CPU_STACK_MINIMUM_SIZE); + rtems_test_assert( + stack_size <= CPU_STACK_MINIMUM_SIZE + CPU_STACK_ALIGNMENT - + CPU_HEAP_ALIGNMENT + ); eno = pthread_attr_destroy(&attr); rtems_test_assert(eno == 0); -- cgit v1.2.3