diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-09-10 11:47:24 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-09-10 12:01:50 +0200 |
commit | 1fe1b820de02c274c2b2b3431340152734ee9fb6 (patch) | |
tree | 27100a93af1ce3764ffd9178ede2bcafd842b77a /testsuites/sptests | |
parent | e58f1cd381edf890c8021f7a7bd2a3428d4da30d (diff) |
score: Fix PER_CPU_DATA_GET_BY_OFFSET()
Add uniprocessor version for PER_CPU_DATA_GET_BY_OFFSET(). Fix warnings
in uniprocessor configurations.
Update #3507.
Diffstat (limited to 'testsuites/sptests')
-rw-r--r-- | testsuites/sptests/sppercpudata01/init.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/testsuites/sptests/sppercpudata01/init.c b/testsuites/sptests/sppercpudata01/init.c index 4c20ea7e2b..94f5185d4e 100644 --- a/testsuites/sptests/sppercpudata01/init.c +++ b/testsuites/sptests/sppercpudata01/init.c @@ -74,11 +74,16 @@ static void test_initial_values(void) unsigned short *s; unsigned int *i; unsigned long *l; + uintptr_t off; t *pt; set_affinity(cpu_index); cpu = _Per_CPU_Get_by_index(cpu_index); + off = PER_CPU_DATA_OFFSET(c); + c = PER_CPU_DATA_GET_BY_OFFSET(cpu, unsigned char, off); + rtems_test_assert(*c == 1); + c = PER_CPU_DATA_GET(cpu, unsigned char, c); rtems_test_assert(*c == 1); @@ -197,6 +202,7 @@ static void test_unique_values(unsigned int v) unsigned short *s; unsigned int *i; unsigned long *l; + uintptr_t off; t *pt; set_affinity(cpu_index); @@ -206,6 +212,10 @@ static void test_unique_values(unsigned int v) ++v; rtems_test_assert(*c == (unsigned char) v); + off = PER_CPU_DATA_OFFSET(c); + c = PER_CPU_DATA_GET_BY_OFFSET(cpu, unsigned char, off); + rtems_test_assert(*c == (unsigned char) v); + c = PER_CPU_DATA_GET(cpu, unsigned char, cz); ++v; rtems_test_assert(*c == (unsigned char) v); |