[PATCH 1/2] score: Add _Per_CPU_Get_snapshot()

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Apr 11 15:15:13 UTC 2014


---
 cpukit/score/include/rtems/score/percpu.h |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h
index 75ff3e2..92a6e8a 100644
--- a/cpukit/score/include/rtems/score/percpu.h
+++ b/cpukit/score/include/rtems/score/percpu.h
@@ -424,11 +424,13 @@ extern Per_CPU_Control_envelope _Per_CPU_Information[] CPU_STRUCTURE_ALIGNMENT;
   _ISR_Enable( isr_cookie )
 #endif
 
+#define _Per_CPU_Get_snapshot() \
+  ( &_Per_CPU_Information[ _SMP_Get_current_processor() ].per_cpu )
+
 #if defined( RTEMS_SMP )
 static inline Per_CPU_Control *_Per_CPU_Get( void )
 {
-  Per_CPU_Control *per_cpu =
-    &_Per_CPU_Information[ _SMP_Get_current_processor() ].per_cpu;
+  Per_CPU_Control *per_cpu = _Per_CPU_Get_snapshot();
 
   _Assert(
     per_cpu->thread_dispatch_disable_level != 0 || _ISR_Get_level() != 0
@@ -437,7 +439,7 @@ static inline Per_CPU_Control *_Per_CPU_Get( void )
   return per_cpu;
 }
 #else
-#define _Per_CPU_Get() ( &_Per_CPU_Information[ 0 ].per_cpu )
+#define _Per_CPU_Get() _Per_CPU_Get_snapshot()
 #endif
 
 static inline Per_CPU_Control *_Per_CPU_Get_by_index( uint32_t index )
-- 
1.7.7




More information about the devel mailing list