diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-10 08:26:33 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-10 08:29:53 +0100 |
commit | 189da5f4428356e94182eb1313c6309cfcbddd04 (patch) | |
tree | f82a3e992553affbb35de8dd2786fe4c3bf7ad9c | |
parent | userext: Fix configuration (diff) | |
download | rtems-189da5f4428356e94182eb1313c6309cfcbddd04.tar.bz2 |
score: Optimize _Per_CPU_Get_index()
Optimize _Per_CPU_Get_index() in uniprocessor configurations.
-rw-r--r-- | cpukit/include/rtems/score/percpu.h | 5 |
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( |