[PATCH 11/17] score: Rename RTEMS_BSP_SMP_SHUTDOWN

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Feb 17 15:51:36 UTC 2014


Rename RTEMS_BSP_SMP_SHUTDOWN in SMP_MESSAGE_SHUTDOWN since SMP messages
have nothing to do with the BSP.  Use UINT32_C() instead of casts.
---
 cpukit/score/include/rtems/score/smp.h |   12 ++++++------
 cpukit/score/src/smp.c                 |    8 ++++----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/cpukit/score/include/rtems/score/smp.h b/cpukit/score/include/rtems/score/smp.h
index 88e3ec8..0643c62 100644
--- a/cpukit/score/include/rtems/score/smp.h
+++ b/cpukit/score/include/rtems/score/smp.h
@@ -35,11 +35,11 @@ extern "C" {
  */
 
 /**
- *  This defines the bit which indicates the interprocessor interrupt
- *  has been requested so that this CPU will be shutdown.  This is done
- *  as part of rtems_executive_shutdown().
+ * @brief SMP message to request a processor shutdown.
+ *
+ * @see _SMP_Send_message().
  */
-#define RTEMS_BSP_SMP_SHUTDOWN                  0x04
+#define SMP_MESSAGE_SHUTDOWN UINT32_C(0x1)
 
 #if !defined( ASM )
 
@@ -58,7 +58,7 @@ typedef enum {
     return _SMP_Processor_count;
   }
 #else
-  #define _SMP_Get_processor_count() ( ( uint32_t ) 1 )
+  #define _SMP_Get_processor_count() UINT32_C(1)
 #endif
 
 #if defined( RTEMS_SMP )
@@ -120,7 +120,7 @@ void _SMP_Request_other_cores_to_perform_first_context_switch(void);
     return _CPU_SMP_Get_current_processor();
   }
 #else
-  #define _SMP_Get_current_processor() ( ( uint32_t ) 0 )
+  #define _SMP_Get_current_processor() UINT32_C(0)
 #endif
 
 #ifdef __cplusplus
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
index 994bfea..c03c148 100644
--- a/cpukit/score/src/smp.c
+++ b/cpukit/score/src/smp.c
@@ -61,21 +61,21 @@ void rtems_smp_process_interrupt( void )
     #if defined(RTEMS_DEBUG)
       {
         void *sp = __builtin_frame_address(0);
-        if ( !(message & RTEMS_BSP_SMP_SHUTDOWN) ) {
+        if ( !(message & SMP_MESSAGE_SHUTDOWN) ) {
           printk(
             "ISR on CPU %d -- (0x%02x) (0x%p)\n",
             _Per_CPU_Get_index( self_cpu ),
             message,
             sp
           );
-          if ( message & RTEMS_BSP_SMP_SHUTDOWN )
+          if ( message & SMP_MESSAGE_SHUTDOWN )
             printk( "shutdown\n" );
         }
         printk( "Dispatch level %d\n", _Thread_Dispatch_get_disable_level() );
       }
     #endif
 
-    if ( ( message & RTEMS_BSP_SMP_SHUTDOWN ) != 0 ) {
+    if ( ( message & SMP_MESSAGE_SHUTDOWN ) != 0 ) {
       _Per_CPU_Change_state( self_cpu, PER_CPU_STATE_SHUTDOWN );
 
       rtems_fatal( RTEMS_FATAL_SOURCE_SMP, SMP_FATAL_SHUTDOWN );
@@ -149,7 +149,7 @@ void _SMP_Request_other_cores_to_shutdown( void )
       const Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( cpu );
 
       if ( per_cpu->state != PER_CPU_STATE_BEFORE_INITIALIZATION ) {
-        _SMP_Send_message( cpu, RTEMS_BSP_SMP_SHUTDOWN );
+        _SMP_Send_message( cpu, SMP_MESSAGE_SHUTDOWN );
       }
     }
   }
-- 
1.7.7




More information about the devel mailing list