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 /cpukit/include/rtems/score/percpudata.h | |
parent | Add more dummy values to <sys/priority.h> (diff) | |
download | rtems-1fe1b820de02c274c2b2b3431340152734ee9fb6.tar.bz2 |
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 '')
-rw-r--r-- | cpukit/include/rtems/score/percpudata.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cpukit/include/rtems/score/percpudata.h b/cpukit/include/rtems/score/percpudata.h index 3de99566ad..fe29fd9fba 100644 --- a/cpukit/include/rtems/score/percpudata.h +++ b/cpukit/include/rtems/score/percpudata.h @@ -76,8 +76,14 @@ RTEMS_LINKER_RWSET_DECLARE( _Per_CPU_Data, char ); * @param type The type of the item. * @param offset The offset of the item. */ +#ifdef RTEMS_SMP #define PER_CPU_DATA_GET_BY_OFFSET( cpu, type, offset ) \ (type *) ( cpu->data + offset ) +#else +#define PER_CPU_DATA_GET_BY_OFFSET( cpu, type, offset ) \ + (type *) ( (uintptr_t) RTEMS_LINKER_SET_BEGIN( _Per_CPU_Data ) + offset ), \ + (void) cpu +#endif /** * @brief Returns a pointer of the specified type to the specified per-CPU item @@ -92,7 +98,7 @@ RTEMS_LINKER_RWSET_DECLARE( _Per_CPU_Data, char ); PER_CPU_DATA_GET_BY_OFFSET( cpu, type, PER_CPU_DATA_OFFSET( item ) ) #else #define PER_CPU_DATA_GET( cpu, type, item ) \ - &_Linker_set__Per_CPU_Data_##item + &_Linker_set__Per_CPU_Data_##item, (void) cpu #endif /** @} */ |