summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-17 14:56:51 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-19 09:59:41 +0100
commit6ca4f6af8ae91d52f5836805f05a7b9b77a2feac (patch)
tree4d27afa23ac8af242cd77a5520ce045ae2b51f3b
parentf8ff2a011cad523453cff8208b3dbd82aa66a110 (diff)
downloadrtems-6ca4f6af8ae91d52f5836805f05a7b9b77a2feac.tar.bz2
score: Add and use <rtems/score/smpimpl.h>
Collect SMP implementation specific parts in the <rtems/score/smpimpl.h> header file.
-rw-r--r--cpukit/sapi/src/exinit.c12
-rw-r--r--cpukit/score/Makefile.am1
-rw-r--r--cpukit/score/include/rtems/score/percpu.h7
-rw-r--r--cpukit/score/include/rtems/score/smp.h66
-rw-r--r--cpukit/score/include/rtems/score/smpimpl.h123
-rw-r--r--cpukit/score/preinstall.am4
-rw-r--r--cpukit/score/src/interr.c2
-rw-r--r--cpukit/score/src/smp.c2
8 files changed, 134 insertions, 83 deletions
diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c
index e8b009ba60..d265455afd 100644
--- a/cpukit/sapi/src/exinit.c
+++ b/cpukit/sapi/src/exinit.c
@@ -45,6 +45,7 @@
#include <rtems/score/isr.h>
#include <rtems/score/priority.h>
#include <rtems/score/schedulerimpl.h>
+#include <rtems/score/smpimpl.h>
#include <rtems/score/threadimpl.h>
#include <rtems/score/todimpl.h>
#include <rtems/score/userextimpl.h>
@@ -59,11 +60,6 @@
#include <rtems/posix/posixapi.h>
#endif
-#if defined(RTEMS_SMP)
- #include <rtems/score/smp.h>
- #include <rtems/score/percpu.h>
-#endif
-
Objects_Information *_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ];
void rtems_initialize_data_structures(void)
@@ -150,9 +146,7 @@ void rtems_initialize_data_structures(void)
_POSIX_API_Initialize();
#endif
- #if defined(RTEMS_SMP)
- _SMP_Handler_initialize();
- #endif
+ _SMP_Handler_initialize();
_System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING );
@@ -216,9 +210,7 @@ void rtems_initialize_start_multitasking(void)
{
_System_state_Set( SYSTEM_STATE_UP );
-#if defined(RTEMS_SMP)
_SMP_Request_other_cores_to_perform_first_context_switch();
-#endif
_Thread_Start_multitasking();
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index 482e78de12..b247af6950 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -61,6 +61,7 @@ include_rtems_score_HEADERS += include/rtems/score/schedulersmpimpl.h
include_rtems_score_HEADERS += include/rtems/score/smp.h
include_rtems_score_HEADERS += include/rtems/score/smpbarrier.h
include_rtems_score_HEADERS += include/rtems/score/smplock.h
+include_rtems_score_HEADERS += include/rtems/score/smpimpl.h
include_rtems_score_HEADERS += include/rtems/score/stack.h
include_rtems_score_HEADERS += include/rtems/score/stackimpl.h
include_rtems_score_HEADERS += include/rtems/score/states.h
diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h
index 8acd867fcb..4c46b50425 100644
--- a/cpukit/score/include/rtems/score/percpu.h
+++ b/cpukit/score/include/rtems/score/percpu.h
@@ -307,13 +307,6 @@ static inline void _Per_CPU_Send_interrupt( const Per_CPU_Control *per_cpu )
}
/**
- * @brief Initialize SMP Handler
- *
- * This method initialize the SMP Handler.
- */
-void _SMP_Handler_initialize(void);
-
-/**
* @brief Allocate and Initialize Per CPU Structures
*
* This method allocates and initialize the per CPU structure.
diff --git a/cpukit/score/include/rtems/score/smp.h b/cpukit/score/include/rtems/score/smp.h
index 3c60baaed2..521cd7b21e 100644
--- a/cpukit/score/include/rtems/score/smp.h
+++ b/cpukit/score/include/rtems/score/smp.h
@@ -34,20 +34,6 @@ extern "C" {
* @{
*/
-/**
- * @brief SMP message to request a processor shutdown.
- *
- * @see _SMP_Send_message().
- */
-#define SMP_MESSAGE_SHUTDOWN UINT32_C(0x1)
-
-/**
- * @brief SMP fatal codes.
- */
-typedef enum {
- SMP_FATAL_SHUTDOWN
-} SMP_Fatal_code;
-
#if defined( RTEMS_SMP )
SCORE_EXTERN uint32_t _SMP_Processor_count;
@@ -60,56 +46,6 @@ typedef enum {
#endif
#if defined( RTEMS_SMP )
-
-/**
- * @brief Sends a SMP message to a processor.
- *
- * The target processor may be the sending processor.
- *
- * @param[in] cpu The target processor of the message.
- * @param[in] message The message.
- */
-void _SMP_Send_message( uint32_t cpu, uint32_t message );
-
-/**
- * @brief Request of others CPUs.
- *
- * This method is invoked by RTEMS when it needs to make a request
- * of the other CPUs. It should be implemented using some type of
- * interprocessor interrupt. CPUs not including the originating
- * CPU should receive the message.
- *
- * @param [in] message is message to send
- */
-void _SMP_Broadcast_message(
- uint32_t message
-);
-
-/**
- * @brief Request other cores to perform first context switch.
- *
- * Send message to other cores requesting them to perform
- * their first context switch operation.
- */
-void _SMP_Request_other_cores_to_perform_first_context_switch(void);
-
-#endif /* defined( RTEMS_SMP ) */
-
-/**
- * @brief Request other cores to shutdown.
- *
- * Send message to other cores requesting them to shutdown.
- */
-#if defined( RTEMS_SMP )
- void _SMP_Request_other_cores_to_shutdown( void );
-#else
- #define _SMP_Request_other_cores_to_shutdown() \
- do { } while ( 0 )
-#endif
-
-/** @} */
-
-#if defined( RTEMS_SMP )
RTEMS_COMPILER_PURE_ATTRIBUTE static inline uint32_t
_SMP_Get_current_processor( void )
{
@@ -119,6 +55,8 @@ void _SMP_Request_other_cores_to_perform_first_context_switch(void);
#define _SMP_Get_current_processor() UINT32_C(0)
#endif
+/** @} */
+
#ifdef __cplusplus
}
#endif
diff --git a/cpukit/score/include/rtems/score/smpimpl.h b/cpukit/score/include/rtems/score/smpimpl.h
new file mode 100644
index 0000000000..59f2b10b67
--- /dev/null
+++ b/cpukit/score/include/rtems/score/smpimpl.h
@@ -0,0 +1,123 @@
+/**
+ * @file
+ *
+ * @ingroup ScoreSMPImpl
+ *
+ * @brief SuperCore SMP Implementation
+ */
+
+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifndef _RTEMS_SCORE_SMPIMPL_H
+#define _RTEMS_SCORE_SMPIMPL_H
+
+#include <rtems/score/smp.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup ScoreSMP SMP Support
+ *
+ * @ingroup Score
+ *
+ * This defines the interface of the SuperCore SMP support.
+ *
+ * @{
+ */
+
+/**
+ * @brief SMP message to request a processor shutdown.
+ *
+ * @see _SMP_Send_message().
+ */
+#define SMP_MESSAGE_SHUTDOWN UINT32_C(0x1)
+
+/**
+ * @brief SMP fatal codes.
+ */
+typedef enum {
+ SMP_FATAL_SHUTDOWN
+} SMP_Fatal_code;
+
+/**
+ * @brief Initialize SMP Handler
+ *
+ * This method initialize the SMP Handler.
+ */
+#if defined( RTEMS_SMP )
+ void _SMP_Handler_initialize( void );
+#else
+ #define _SMP_Handler_initialize() \
+ do { } while ( 0 )
+#endif
+
+#if defined( RTEMS_SMP )
+
+/**
+ * @brief Sends a SMP message to a processor.
+ *
+ * The target processor may be the sending processor.
+ *
+ * @param[in] cpu The target processor of the message.
+ * @param[in] message The message.
+ */
+void _SMP_Send_message( uint32_t cpu, uint32_t message );
+
+/**
+ * @brief Request of others CPUs.
+ *
+ * This method is invoked by RTEMS when it needs to make a request
+ * of the other CPUs. It should be implemented using some type of
+ * interprocessor interrupt. CPUs not including the originating
+ * CPU should receive the message.
+ *
+ * @param [in] message is message to send
+ */
+void _SMP_Broadcast_message(
+ uint32_t message
+);
+
+#endif /* defined( RTEMS_SMP ) */
+
+/**
+ * @brief Request other cores to perform first context switch.
+ *
+ * Send message to other cores requesting them to perform
+ * their first context switch operation.
+ */
+#if defined( RTEMS_SMP )
+ void _SMP_Request_other_cores_to_perform_first_context_switch( void );
+#else
+ #define _SMP_Request_other_cores_to_perform_first_context_switch() \
+ do { } while ( 0 )
+#endif
+
+/**
+ * @brief Request other cores to shutdown.
+ *
+ * Send message to other cores requesting them to shutdown.
+ */
+#if defined( RTEMS_SMP )
+ void _SMP_Request_other_cores_to_shutdown( void );
+#else
+ #define _SMP_Request_other_cores_to_shutdown() \
+ do { } while ( 0 )
+#endif
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */
diff --git a/cpukit/score/preinstall.am b/cpukit/score/preinstall.am
index ceefbe7e6e..c9d0ab9ff4 100644
--- a/cpukit/score/preinstall.am
+++ b/cpukit/score/preinstall.am
@@ -227,6 +227,10 @@ $(PROJECT_INCLUDE)/rtems/score/smplock.h: include/rtems/score/smplock.h $(PROJEC
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/smplock.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/smplock.h
+$(PROJECT_INCLUDE)/rtems/score/smpimpl.h: include/rtems/score/smpimpl.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/smpimpl.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/smpimpl.h
+
$(PROJECT_INCLUDE)/rtems/score/stack.h: include/rtems/score/stack.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/stack.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/stack.h
diff --git a/cpukit/score/src/interr.c b/cpukit/score/src/interr.c
index bb15e0cbe4..3836f527cb 100644
--- a/cpukit/score/src/interr.c
+++ b/cpukit/score/src/interr.c
@@ -20,7 +20,7 @@
#include <rtems/score/interr.h>
#include <rtems/score/isrlevel.h>
-#include <rtems/score/smp.h>
+#include <rtems/score/smpimpl.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/userextimpl.h>
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
index f3aa25f011..6c2f78b2eb 100644
--- a/cpukit/score/src/smp.c
+++ b/cpukit/score/src/smp.c
@@ -19,10 +19,10 @@
#endif
#include <rtems/bspsmp.h>
+#include <rtems/score/smpimpl.h>
#include <rtems/score/assert.h>
#include <rtems/score/threaddispatch.h>
#include <rtems/score/threadimpl.h>
-#include <rtems/score/smp.h>
#include <rtems/config.h>
#include <rtems/fatal.h>