diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-06-10 09:55:42 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-06-10 15:55:47 +0200 |
commit | fad01e6cf95f98adaca3157faa8b96c19296a68e (patch) | |
tree | 4cad0a1296d4af5c402a47dcbd3fdda949371f22 /cpukit/include/rtems/score | |
parent | splinkersets01: Test linker sets in library (diff) | |
download | rtems-fad01e6cf95f98adaca3157faa8b96c19296a68e.tar.bz2 |
score: Add PER_CPU_DATA_NEED_INITIALIZATION()
Make the initialization of the per-CPU data optional.
Change license to BSD-2-Clause according to file history and
re-licensing agreement.
Update #3053.
Diffstat (limited to 'cpukit/include/rtems/score')
-rw-r--r-- | cpukit/include/rtems/score/percpudata.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cpukit/include/rtems/score/percpudata.h b/cpukit/include/rtems/score/percpudata.h index cae73a62b0..da454fd7bf 100644 --- a/cpukit/include/rtems/score/percpudata.h +++ b/cpukit/include/rtems/score/percpudata.h @@ -51,6 +51,20 @@ extern "C" { RTEMS_LINKER_RWSET_DECLARE( _Per_CPU_Data, char ); /** + * @brief Translation units which define per-CPU items shall call this macro + * exactly once at file scope. + */ +#ifdef RTEMS_SMP +#define PER_CPU_DATA_NEED_INITIALIZATION() \ + static const char * const _Per_CPU_Data_reference \ + RTEMS_SECTION( ".rtemsroset.reference" ) RTEMS_USED = \ + RTEMS_LINKER_SET_BEGIN( _Per_CPU_Data ) +#else +#define PER_CPU_DATA_NEED_INITIALIZATION() \ + RTEMS_LINKER_RWSET_DECLARE( _Per_CPU_Data, char ) +#endif + +/** * @brief Declares a per-CPU item of the specified type. * * Items declared with this macro have external linkage. |