From 23cdecd8395b75e8a90076898b4d60c546851190 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 27 Sep 2022 08:52:05 +0200 Subject: score: Require power of two CPU_STACK_MINIMUM_SIZE For most CPU ports this was already the case. This makes it possible to use the size as an object alignment using RTEMS_ALIGNED(). --- cpukit/score/src/percpuasm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cpukit/score/src/percpuasm.c') diff --git a/cpukit/score/src/percpuasm.c b/cpukit/score/src/percpuasm.c index 6e5a727b76..4bd92be37d 100644 --- a/cpukit/score/src/percpuasm.c +++ b/cpukit/score/src/percpuasm.c @@ -44,7 +44,7 @@ #include #define PER_CPU_IS_POWER_OF_TWO( value ) \ - ( ( ( ( value ) - 1 ) & ( value ) ) == 0 ) + ( ( value ) > 1 && ( ( ( value ) - 1 ) & ( value ) ) == 0 ) /* * The minimum alignment of two is due to the Heap Handler which uses the @@ -72,6 +72,11 @@ RTEMS_STATIC_ASSERT( CPU_STACK_ALIGNMENT ); +RTEMS_STATIC_ASSERT( + PER_CPU_IS_POWER_OF_TWO( CPU_STACK_MINIMUM_SIZE ), + CPU_STACK_MINIMUM_SIZE +); + RTEMS_STATIC_ASSERT( sizeof(void *) == CPU_SIZEOF_POINTER, CPU_SIZEOF_POINTER -- cgit v1.2.3