[rtems commit] rtems: Fix MPCI initialization

Sebastian Huber sebh at rtems.org
Thu Jan 2 08:49:06 UTC 2020


Module:    rtems
Branch:    master
Commit:    453bb4b64225afd3040badb632f7b4adedc816cd
Changeset: http://git.rtems.org/rtems/commit/?id=453bb4b64225afd3040badb632f7b4adedc816cd

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Sun Dec 29 17:43:46 2019 +0100

rtems: Fix MPCI initialization

Update #2408.

---

 cpukit/include/rtems/rtems/msgmp.h    | 11 -----------
 cpukit/include/rtems/rtems/partmp.h   | 11 -----------
 cpukit/include/rtems/rtems/semmp.h    | 10 ----------
 cpukit/include/rtems/rtems/taskmp.h   | 10 ----------
 cpukit/include/rtems/sysinit.h        |  8 ++++++--
 cpukit/rtems/src/eventseize.c         |  6 +++---
 cpukit/rtems/src/msgmp.c              | 23 +++++++++++++++--------
 cpukit/rtems/src/msgqcreate.c         | 16 ++--------------
 cpukit/rtems/src/partcreate.c         | 14 +-------------
 cpukit/rtems/src/partmp.c             | 23 +++++++++++++++--------
 cpukit/rtems/src/semcreate.c          |  9 +--------
 cpukit/rtems/src/semmp.c              | 22 ++++++++++++++++------
 cpukit/rtems/src/signalcatch.c        |  6 +++---
 cpukit/rtems/src/taskcreate.c         |  9 +--------
 cpukit/rtems/src/taskmp.c             | 31 ++++++++++++++-----------------
 testsuites/sptests/spsysinit01/init.c | 26 --------------------------
 16 files changed, 77 insertions(+), 158 deletions(-)

diff --git a/cpukit/include/rtems/rtems/msgmp.h b/cpukit/include/rtems/rtems/msgmp.h
index b7aa3f9..6b08c86 100644
--- a/cpukit/include/rtems/rtems/msgmp.h
+++ b/cpukit/include/rtems/rtems/msgmp.h
@@ -167,17 +167,6 @@ rtems_status_code _Message_queue_MP_Urgent(
 );
 
 /**
- *
- * @brief _Message_queue_MP_Process_packet
- *
- * This routine performs the actions specific to this package for
- * the request from another node.
- */
-void _Message_queue_MP_Process_packet (
-  rtems_packet_prefix *the_packet_prefix
-);
-
-/**
  *  @brief _Message_queue_MP_Send_object_was_deleted
  *
  *  This routine is invoked indirectly by the thread queue
diff --git a/cpukit/include/rtems/rtems/partmp.h b/cpukit/include/rtems/rtems/partmp.h
index 26bdd9c..bd78d42 100644
--- a/cpukit/include/rtems/rtems/partmp.h
+++ b/cpukit/include/rtems/rtems/partmp.h
@@ -100,17 +100,6 @@ rtems_status_code _Partition_MP_Return_buffer(
   void     *buffer
 );
 
-/**
- *
- *  @brief Partition_MP_Process_packet
- *
- *  This routine performs the actions specific to this package for
- *  the request from another node.
- */
-void _Partition_MP_Process_packet (
-  rtems_packet_prefix *the_packet_prefix
-);
-
 /*
  *  @brief Partition_MP_Send_object_was_deleted
  *
diff --git a/cpukit/include/rtems/rtems/semmp.h b/cpukit/include/rtems/rtems/semmp.h
index 4a3dbe6..68b5e60 100644
--- a/cpukit/include/rtems/rtems/semmp.h
+++ b/cpukit/include/rtems/rtems/semmp.h
@@ -95,16 +95,6 @@ rtems_status_code _Semaphore_MP_Obtain(
 rtems_status_code _Semaphore_MP_Release( rtems_id id );
 
 /**
- *  @brief Semaphore MP Process Packet
- *
- *  This routine performs the actions specific to this package for
- *  the request from another node.
- */
-void _Semaphore_MP_Process_packet (
-  rtems_packet_prefix *the_packet_prefix
-);
-
-/**
  *  @brief Semaphore MP Send Object was Deleted
  *
  *  This routine is invoked indirectly by the thread queue
diff --git a/cpukit/include/rtems/rtems/taskmp.h b/cpukit/include/rtems/rtems/taskmp.h
index 8acfb0d..dd5d094 100644
--- a/cpukit/include/rtems/rtems/taskmp.h
+++ b/cpukit/include/rtems/rtems/taskmp.h
@@ -87,16 +87,6 @@ rtems_status_code _RTEMS_tasks_MP_Suspend( rtems_id id );
 rtems_status_code _RTEMS_tasks_MP_Resume( rtems_id id );
 
 /**
- *  @brief _RTEMS_tasks_MP_Process_packet
- *
- *  This routine performs the actions specific to this package for
- *  the request from another node.
- */
-void _RTEMS_tasks_MP_Process_packet (
-  rtems_packet_prefix *the_packet_prefix
-);
-
-/**
  *  @brief _RTEMS_tasks_MP_Send_object_was_deleted
  *
  *  This routine is invoked indirectly by the thread queue
diff --git a/cpukit/include/rtems/sysinit.h b/cpukit/include/rtems/sysinit.h
index b349a70..9f5cfb6 100644
--- a/cpukit/include/rtems/sysinit.h
+++ b/cpukit/include/rtems/sysinit.h
@@ -36,12 +36,16 @@ extern "C" {
 #define RTEMS_SYSINIT_MP                         000800
 #define RTEMS_SYSINIT_USER_EXTENSIONS            000900
 #define RTEMS_SYSINIT_CLASSIC_TASKS              000a00
+#define RTEMS_SYSINIT_CLASSIC_TASKS_MP           000a80
 #define RTEMS_SYSINIT_CLASSIC_TIMER              000b00
-#define RTEMS_SYSINIT_CLASSIC_SIGNAL             000c00
-#define RTEMS_SYSINIT_CLASSIC_EVENT              000d00
+#define RTEMS_SYSINIT_CLASSIC_SIGNAL_MP          000c00
+#define RTEMS_SYSINIT_CLASSIC_EVENT_MP           000d00
 #define RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE      000e00
+#define RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE_MP   000e80
 #define RTEMS_SYSINIT_CLASSIC_SEMAPHORE          000f00
+#define RTEMS_SYSINIT_CLASSIC_SEMAPHORE_MP       000f80
 #define RTEMS_SYSINIT_CLASSIC_PARTITION          001000
+#define RTEMS_SYSINIT_CLASSIC_PARTITION_MP       001080
 #define RTEMS_SYSINIT_CLASSIC_REGION             001100
 #define RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY 001200
 #define RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC     001300
diff --git a/cpukit/rtems/src/eventseize.c b/cpukit/rtems/src/eventseize.c
index 0d60979..f07a62b 100644
--- a/cpukit/rtems/src/eventseize.c
+++ b/cpukit/rtems/src/eventseize.c
@@ -101,14 +101,14 @@ rtems_status_code _Event_Seize(
 }
 
 #if defined(RTEMS_MULTIPROCESSING)
-static void _Event_Manager_initialization( void )
+static void _Event_MP_Initialize( void )
 {
   _MPCI_Register_packet_processor( MP_PACKET_EVENT, _Event_MP_Process_packet );
 }
 
 RTEMS_SYSINIT_ITEM(
-  _Event_Manager_initialization,
-  RTEMS_SYSINIT_CLASSIC_EVENT,
+  _Event_MP_Initialize,
+  RTEMS_SYSINIT_CLASSIC_EVENT_MP,
   RTEMS_SYSINIT_ORDER_MIDDLE
 );
 #endif
diff --git a/cpukit/rtems/src/msgmp.c b/cpukit/rtems/src/msgmp.c
index 6ec6982..78a7c7c 100644
--- a/cpukit/rtems/src/msgmp.c
+++ b/cpukit/rtems/src/msgmp.c
@@ -24,6 +24,7 @@
 #include <rtems/score/coremsgimpl.h>
 #include <rtems/score/statesimpl.h>
 #include <rtems/score/threadimpl.h>
+#include <rtems/sysinit.h>
 
 RTEMS_STATIC_ASSERT(
   MESSAGE_QUEUE_MP_PACKET_SIZE <= MP_PACKET_MINIMUM_PACKET_SIZE,
@@ -361,13 +362,7 @@ static void _Message_queue_MP_Send_response_packet (
   }
 }
 
-/*
- *
- *  _Message_queue_MP_Process_packet
- *
- */
-
-void _Message_queue_MP_Process_packet (
+static void _Message_queue_MP_Process_packet (
   rtems_packet_prefix   *the_packet_prefix
 )
 {
@@ -590,4 +585,16 @@ void  _Message_queue_Core_message_queue_mp_support(
   );
 }
 
-/* end of file */
+static void _Message_queue_MP_Initialize( void )
+{
+  _MPCI_Register_packet_processor(
+    MP_PACKET_MESSAGE_QUEUE,
+    _Message_queue_MP_Process_packet
+  );
+}
+
+RTEMS_SYSINIT_ITEM(
+  _Message_queue_MP_Initialize,
+  RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE_MP,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/rtems/src/msgqcreate.c b/cpukit/rtems/src/msgqcreate.c
index 2925d24..7054873 100644
--- a/cpukit/rtems/src/msgqcreate.c
+++ b/cpukit/rtems/src/msgqcreate.c
@@ -144,21 +144,9 @@ rtems_status_code rtems_message_queue_create(
   return RTEMS_SUCCESSFUL;
 }
 
-static void _Message_queue_Manager_initialization(void)
+static void _Message_queue_Manager_initialization( void )
 {
-   _Objects_Initialize_information( &_Message_queue_Information);
-
-  /*
-   *  Register the MP Process Packet routine.
-   */
-
-#if defined(RTEMS_MULTIPROCESSING)
-  _MPCI_Register_packet_processor(
-    MP_PACKET_MESSAGE_QUEUE,
-    _Message_queue_MP_Process_packet
-  );
-#endif
-
+  _Objects_Initialize_information( &_Message_queue_Information);
 }
 
 RTEMS_SYSINIT_ITEM(
diff --git a/cpukit/rtems/src/partcreate.c b/cpukit/rtems/src/partcreate.c
index 99d0d59..ccbae77 100644
--- a/cpukit/rtems/src/partcreate.c
+++ b/cpukit/rtems/src/partcreate.c
@@ -116,21 +116,9 @@ rtems_status_code rtems_partition_create(
   return RTEMS_SUCCESSFUL;
 }
 
-static void _Partition_Manager_initialization(void)
+static void _Partition_Manager_initialization( void )
 {
   _Objects_Initialize_information( &_Partition_Information );
-
-  /*
-   *  Register the MP Process Packet routine.
-   */
-
-#if defined(RTEMS_MULTIPROCESSING)
-  _MPCI_Register_packet_processor(
-    MP_PACKET_PARTITION,
-    _Partition_MP_Process_packet
-  );
-#endif
-
 }
 
 RTEMS_SYSINIT_ITEM(
diff --git a/cpukit/rtems/src/partmp.c b/cpukit/rtems/src/partmp.c
index c613ce2..b22b244 100644
--- a/cpukit/rtems/src/partmp.c
+++ b/cpukit/rtems/src/partmp.c
@@ -23,6 +23,7 @@
 #include <rtems/score/statesimpl.h>
 #include <rtems/score/threadimpl.h>
 #include <rtems/score/threadqimpl.h>
+#include <rtems/sysinit.h>
 
 RTEMS_STATIC_ASSERT(
   sizeof(Partition_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE,
@@ -206,13 +207,7 @@ static void _Partition_MP_Send_response_packet (
   }
 }
 
-/*
- *
- *  _Partition_MP_Process_packet
- *
- */
-
-void _Partition_MP_Process_packet (
+static void _Partition_MP_Process_packet(
   rtems_packet_prefix  *the_packet_prefix
 )
 {
@@ -326,4 +321,16 @@ void _Partition_MP_Send_extract_proxy (
 
 }
 
-/* end of file */
+static void _Partition_MP_Initialize( void )
+{
+  _MPCI_Register_packet_processor(
+    MP_PACKET_PARTITION,
+    _Partition_MP_Process_packet
+  );
+}
+
+RTEMS_SYSINIT_ITEM(
+  _Partition_MP_Initialize,
+  RTEMS_SYSINIT_CLASSIC_PARTITION_MP,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/rtems/src/semcreate.c b/cpukit/rtems/src/semcreate.c
index 81a9681..4157856 100644
--- a/cpukit/rtems/src/semcreate.c
+++ b/cpukit/rtems/src/semcreate.c
@@ -267,16 +267,9 @@ rtems_status_code rtems_semaphore_create(
   return RTEMS_SUCCESSFUL;
 }
 
-static void _Semaphore_Manager_initialization(void)
+static void _Semaphore_Manager_initialization( void )
 {
   _Objects_Initialize_information( &_Semaphore_Information );
-
-#if defined(RTEMS_MULTIPROCESSING)
-  _MPCI_Register_packet_processor(
-    MP_PACKET_SEMAPHORE,
-    _Semaphore_MP_Process_packet
-  );
-#endif
 }
 
 RTEMS_SYSINIT_ITEM(
diff --git a/cpukit/rtems/src/semmp.c b/cpukit/rtems/src/semmp.c
index f6a5525..0246e1f 100644
--- a/cpukit/rtems/src/semmp.c
+++ b/cpukit/rtems/src/semmp.c
@@ -21,6 +21,7 @@
 #include <rtems/rtems/semimpl.h>
 #include <rtems/rtems/optionsimpl.h>
 #include <rtems/rtems/statusimpl.h>
+#include <rtems/sysinit.h>
 
 RTEMS_STATIC_ASSERT(
   sizeof(Semaphore_MP_Packet) <= MP_PACKET_MINIMUM_PACKET_SIZE,
@@ -187,7 +188,7 @@ static void _Semaphore_MP_Send_response_packet (
   }
 }
 
-void _Semaphore_MP_Process_packet (
+static void _Semaphore_MP_Process_packet (
   rtems_packet_prefix  *the_packet_prefix
 )
 {
@@ -295,7 +296,6 @@ void _Semaphore_MP_Send_extract_proxy (
 
 }
 
-#if defined(RTEMS_MULTIPROCESSING)
 void  _Semaphore_Core_mutex_mp_support (
   Thread_Control *the_thread,
   Objects_Id      id
@@ -309,9 +309,7 @@ void  _Semaphore_Core_mutex_mp_support (
      the_thread
    );
 }
-#endif
 
-#if defined(RTEMS_MULTIPROCESSING)
 void  _Semaphore_Core_semaphore_mp_support (
   Thread_Control *the_thread,
   Objects_Id      id
@@ -325,5 +323,17 @@ void  _Semaphore_Core_semaphore_mp_support (
      the_thread
    );
 }
-#endif
-/* end of file */
+
+static void _Semaphore_MP_Initialize( void )
+{
+  _MPCI_Register_packet_processor(
+    MP_PACKET_SEMAPHORE,
+    _Semaphore_MP_Process_packet
+  );
+}
+
+RTEMS_SYSINIT_ITEM(
+  _Semaphore_MP_Initialize,
+  RTEMS_SYSINIT_CLASSIC_SEMAPHORE_MP,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/cpukit/rtems/src/signalcatch.c b/cpukit/rtems/src/signalcatch.c
index 03c2b97..63efa5c 100644
--- a/cpukit/rtems/src/signalcatch.c
+++ b/cpukit/rtems/src/signalcatch.c
@@ -89,7 +89,7 @@ rtems_status_code rtems_signal_catch(
 }
 
 #if defined(RTEMS_MULTIPROCESSING)
-static void _Signal_Manager_initialization( void )
+static void _Signal_MP_Initialize( void )
 {
   _MPCI_Register_packet_processor(
     MP_PACKET_SIGNAL,
@@ -98,8 +98,8 @@ static void _Signal_Manager_initialization( void )
 }
 
 RTEMS_SYSINIT_ITEM(
-  _Signal_Manager_initialization,
-  RTEMS_SYSINIT_CLASSIC_SIGNAL,
+  _Signal_MP_Initialize,
+  RTEMS_SYSINIT_CLASSIC_SIGNAL_MP,
   RTEMS_SYSINIT_ORDER_MIDDLE
 );
 #endif
diff --git a/cpukit/rtems/src/taskcreate.c b/cpukit/rtems/src/taskcreate.c
index 4055e1e..e27b82c 100644
--- a/cpukit/rtems/src/taskcreate.c
+++ b/cpukit/rtems/src/taskcreate.c
@@ -242,17 +242,10 @@ static User_extensions_Control _RTEMS_tasks_User_extensions = {
   }
 };
 
-static void _RTEMS_tasks_Manager_initialization(void)
+static void _RTEMS_tasks_Manager_initialization( void )
 {
   _Thread_Initialize_information( &_RTEMS_tasks_Information );
   _User_extensions_Add_API_set( &_RTEMS_tasks_User_extensions );
-
-#if defined(RTEMS_MULTIPROCESSING)
-  _MPCI_Register_packet_processor(
-    MP_PACKET_TASKS,
-    _RTEMS_tasks_MP_Process_packet
-  );
-#endif
 }
 
 RTEMS_SYSINIT_ITEM(
diff --git a/cpukit/rtems/src/taskmp.c b/cpukit/rtems/src/taskmp.c
index e3742c5..d929c35 100644
--- a/cpukit/rtems/src/taskmp.c
+++ b/cpukit/rtems/src/taskmp.c
@@ -24,6 +24,7 @@
 #include <rtems/score/statesimpl.h>
 #include <rtems/score/threadimpl.h>
 #include <rtems/score/threadqimpl.h>
+#include <rtems/sysinit.h>
 
 /**
  *  The following data structure defines the packet used to perform
@@ -221,7 +222,7 @@ static void _RTEMS_tasks_MP_Send_response_packet (
  *
  */
 
-void _RTEMS_tasks_MP_Process_packet (
+static void _RTEMS_tasks_MP_Process_packet (
   rtems_packet_prefix  *the_packet_prefix
 )
 {
@@ -312,20 +313,16 @@ void _RTEMS_tasks_MP_Process_packet (
   }
 }
 
-/*
- *  _RTEMS_tasks_MP_Send_object_was_deleted
- *
- *  This routine is not neededby the Tasks since a task
- *  cannot be globally deleted.
- *
- */
-
-/*
- *  _RTEMS_tasks_MP_Send_extract_proxy
- *
- *  This routine is not neededby the Tasks since a task
- *  cannot be globally deleted.
- *
- */
+static void _RTEMS_tasks_MP_Initialize( void )
+{
+  _MPCI_Register_packet_processor(
+    MP_PACKET_TASKS,
+    _RTEMS_tasks_MP_Process_packet
+  );
+}
 
-/* end of file */
+RTEMS_SYSINIT_ITEM(
+  _RTEMS_tasks_MP_Initialize,
+  RTEMS_SYSINIT_CLASSIC_TASKS_MP,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
diff --git a/testsuites/sptests/spsysinit01/init.c b/testsuites/sptests/spsysinit01/init.c
index fd9c267..20d48c6 100644
--- a/testsuites/sptests/spsysinit01/init.c
+++ b/testsuites/sptests/spsysinit01/init.c
@@ -87,10 +87,6 @@ typedef enum {
   CLASSIC_TASKS_POST,
   CLASSIC_TIMER_PRE,
   CLASSIC_TIMER_POST,
-  CLASSIC_SIGNAL_PRE,
-  CLASSIC_SIGNAL_POST,
-  CLASSIC_EVENT_PRE,
-  CLASSIC_EVENT_POST,
   CLASSIC_MESSAGE_QUEUE_PRE,
   CLASSIC_MESSAGE_QUEUE_POST,
   CLASSIC_SEMAPHORE_PRE,
@@ -310,28 +306,6 @@ LAST(RTEMS_SYSINIT_CLASSIC_TIMER)
   next_step(CLASSIC_TIMER_POST);
 }
 
-FIRST(RTEMS_SYSINIT_CLASSIC_SIGNAL)
-{
-  /* There is nothing to do in case RTEMS_MULTIPROCESSING is not defined */
-  next_step(CLASSIC_SIGNAL_PRE);
-}
-
-LAST(RTEMS_SYSINIT_CLASSIC_SIGNAL)
-{
-  next_step(CLASSIC_SIGNAL_POST);
-}
-
-FIRST(RTEMS_SYSINIT_CLASSIC_EVENT)
-{
-  /* There is nothing to do in case RTEMS_MULTIPROCESSING is not defined */
-  next_step(CLASSIC_EVENT_PRE);
-}
-
-LAST(RTEMS_SYSINIT_CLASSIC_EVENT)
-{
-  next_step(CLASSIC_EVENT_POST);
-}
-
 FIRST(RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE)
 {
   assert(info_not_init(&_Message_queue_Information));



More information about the vc mailing list