summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/percpu.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-12-10 08:26:33 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-12-10 08:29:53 +0100
commit189da5f4428356e94182eb1313c6309cfcbddd04 (patch)
treef82a3e992553affbb35de8dd2786fe4c3bf7ad9c /cpukit/include/rtems/score/percpu.h
parent5e589d965d3759a64f3467895e12d680bf1eceda (diff)
downloadrtems-189da5f4428356e94182eb1313c6309cfcbddd04.tar.bz2
score: Optimize _Per_CPU_Get_index()
Optimize _Per_CPU_Get_index() in uniprocessor configurations.
Diffstat (limited to 'cpukit/include/rtems/score/percpu.h')
-rw-r--r--cpukit/include/rtems/score/percpu.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/cpukit/include/rtems/score/percpu.h b/cpukit/include/rtems/score/percpu.h
index c661310a8b..7c95a9649a 100644
--- a/cpukit/include/rtems/score/percpu.h
+++ b/cpukit/include/rtems/score/percpu.h
@@ -654,10 +654,15 @@ static inline Per_CPU_Control *_Per_CPU_Get_by_index( uint32_t index )
static inline uint32_t _Per_CPU_Get_index( const Per_CPU_Control *cpu )
{
+#if defined(RTEMS_SMP)
const Per_CPU_Control_envelope *per_cpu_envelope =
( const Per_CPU_Control_envelope * ) cpu;
return ( uint32_t ) ( per_cpu_envelope - &_Per_CPU_Information[ 0 ] );
+#else
+ (void) cpu;
+ return 0;
+#endif
}
static inline struct _Thread_Control *_Per_CPU_Get_executing(