From 7c21077db6d42a8176f29e83fbe51afac6f6a717 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 20 Dec 2019 13:27:55 +0100 Subject: sppercpudata01: Test PER_CPU_DATA_OFFSET() Make sure PER_CPU_DATA_OFFSET() is tested also in uniprocessor configurations. --- testsuites/sptests/sppercpudata01/init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'testsuites/sptests') diff --git a/testsuites/sptests/sppercpudata01/init.c b/testsuites/sptests/sppercpudata01/init.c index eec4883e92..3d105ee61f 100644 --- a/testsuites/sptests/sppercpudata01/init.c +++ b/testsuites/sptests/sppercpudata01/init.c @@ -25,7 +25,8 @@ const char rtems_test_name[] = "SPPERCPUDATA 1"; -static PER_CPU_DATA_ITEM(unsigned char, c) = 1; +static RTEMS_ALIGNED(CPU_HEAP_ALIGNMENT) + PER_CPU_DATA_ITEM(unsigned char, c) = 1; static PER_CPU_DATA_ITEM(unsigned char, cz); @@ -85,6 +86,7 @@ static void test_initial_values(void) cpu = _Per_CPU_Get_by_index(cpu_index); off = PER_CPU_DATA_OFFSET(c); + rtems_test_assert(off % CPU_HEAP_ALIGNMENT == 0); c = PER_CPU_DATA_GET_BY_OFFSET(cpu, unsigned char, off); rtems_test_assert(*c == 1); @@ -225,6 +227,7 @@ static void test_unique_values(unsigned int v) rtems_test_assert(*c == (unsigned char) v); off = PER_CPU_DATA_OFFSET(c); + rtems_test_assert(off % CPU_HEAP_ALIGNMENT == 0); c = PER_CPU_DATA_GET_BY_OFFSET(cpu, unsigned char, off); rtems_test_assert(*c == (unsigned char) v); -- cgit v1.2.3