diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-22 10:10:39 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-28 09:26:18 +0200 |
commit | e5120a566c432dbe2c29acc7e02131896d827c5f (patch) | |
tree | 01d6848c0091505b79d3bdaa094d9f92f4e2c758 /cpukit/score/include/rtems | |
parent | rtems: Account for the network semaphore. (diff) | |
download | rtems-e5120a566c432dbe2c29acc7e02131896d827c5f.tar.bz2 |
score: Add _CPU_Get_current_per_CPU_control()
Add optional method _CPU_Get_current_per_CPU_control() to obtain the
per-CPU control of the current processor.
This is optional. Not every CPU port needs this. It is only an
optional optimization variant. In case this macro is undefined, the
default implementation using the current processor index will be used.
Diffstat (limited to 'cpukit/score/include/rtems')
-rw-r--r-- | cpukit/score/include/rtems/score/percpu.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h index afc38031df..a1b0a38900 100644 --- a/cpukit/score/include/rtems/score/percpu.h +++ b/cpukit/score/include/rtems/score/percpu.h @@ -235,7 +235,7 @@ typedef struct { * * This structure is used to hold per core state information. */ -typedef struct { +typedef struct Per_CPU_Control { /** * @brief CPU port specific control. */ @@ -437,8 +437,12 @@ extern Per_CPU_Control_envelope _Per_CPU_Information[] CPU_STRUCTURE_ALIGNMENT; * we can use _Per_CPU_Get_snapshot()). All other places must use * _Per_CPU_Get() so that we can add checks for RTEMS_DEBUG. */ -#define _Per_CPU_Get_snapshot() \ - ( &_Per_CPU_Information[ _SMP_Get_current_processor() ].per_cpu ) +#if defined( _CPU_Get_current_per_CPU_control ) + #define _Per_CPU_Get_snapshot() _CPU_Get_current_per_CPU_control() +#else + #define _Per_CPU_Get_snapshot() \ + ( &_Per_CPU_Information[ _SMP_Get_current_processor() ].per_cpu ) +#endif #if defined( RTEMS_SMP ) static inline Per_CPU_Control *_Per_CPU_Get( void ) |