diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-20 13:27:55 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-20 13:35:13 +0100 |
commit | 7c21077db6d42a8176f29e83fbe51afac6f6a717 (patch) | |
tree | 35770c90a465587b1886fa656dd28d994fcaa136 /testsuites | |
parent | 556e45f24b6c02a37fa20402fc84c927fc406dac (diff) |
sppercpudata01: Test PER_CPU_DATA_OFFSET()
Make sure PER_CPU_DATA_OFFSET() is tested also in uniprocessor
configurations.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/sptests/sppercpudata01/init.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); |