[rtems commit] Optional Classic Signal initialization

Sebastian Huber sebh at rtems.org
Wed Feb 3 09:30:40 UTC 2016


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Dec 14 14:56:41 2015 +0100

Optional Classic Signal initialization

Update #2408.

---

 cpukit/rtems/Makefile.am                      |  1 -
 cpukit/rtems/include/rtems/rtems/signalimpl.h |  9 ------
 cpukit/rtems/src/signal.c                     | 45 ---------------------------
 cpukit/rtems/src/signalcatch.c                | 17 ++++++++++
 cpukit/sapi/src/rtemsapi.c                    |  2 --
 cpukit/score/include/rtems/sysinit.h          |  1 +
 testsuites/sptests/spsysinit01/init.c         | 13 ++++++++
 7 files changed, 31 insertions(+), 57 deletions(-)

diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am
index 83ee630..211aef4 100644
--- a/cpukit/rtems/Makefile.am
+++ b/cpukit/rtems/Makefile.am
@@ -208,7 +208,6 @@ librtems_a_SOURCES += src/systemeventsend.c
 librtems_a_SOURCES += src/systemeventreceive.c
 
 ## SIGNAL_C_FILES
-librtems_a_SOURCES += src/signal.c
 librtems_a_SOURCES += src/signalcatch.c
 librtems_a_SOURCES += src/signalsend.c
 
diff --git a/cpukit/rtems/include/rtems/rtems/signalimpl.h b/cpukit/rtems/include/rtems/rtems/signalimpl.h
index e093394..b19b2ac 100644
--- a/cpukit/rtems/include/rtems/rtems/signalimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/signalimpl.h
@@ -32,15 +32,6 @@ extern "C" {
  */
 /**@{*/
 
-/**
- *  @brief Signal Manager Initialization
- *
- *  Signal Manager
- *
- *  This routine performs the initialization necessary for this manager.
- */
-void _Signal_Manager_initialization( void );
-
 void _Signal_Action_handler(
   Thread_Control *thread,
   Thread_Action *action,
diff --git a/cpukit/rtems/src/signal.c b/cpukit/rtems/src/signal.c
deleted file mode 100644
index 5eeaeeb..0000000
--- a/cpukit/rtems/src/signal.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * @file
- *
- * @brief Signal Manager Initialization
- * @ingroup ClassicSignal Signals
- */
-
-/*
- *  COPYRIGHT (c) 1989-1999.
- *  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.org/license/LICENSE.
- */
-
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/rtems/signalimpl.h>
-
-/*
- *  _Signal_Manager_initialization
- *
- *  This routine initializes all signal manager related data structures.
- *
- *  Input parameters:   NONE
- *
- *  Output parameters:  NONE
- */
-
-void _Signal_Manager_initialization( void )
-{
-  /*
-   *  Register the MP Process Packet routine.
-   */
-
-#if defined(RTEMS_MULTIPROCESSING)
-  _MPCI_Register_packet_processor(
-    MP_PACKET_SIGNAL,
-    _Signal_MP_Process_packet
-  );
-#endif
-}
diff --git a/cpukit/rtems/src/signalcatch.c b/cpukit/rtems/src/signalcatch.c
index 1bbeea7..bab4157 100644
--- a/cpukit/rtems/src/signalcatch.c
+++ b/cpukit/rtems/src/signalcatch.c
@@ -18,6 +18,7 @@
 #include "config.h"
 #endif
 
+#include <rtems/sysinit.h>
 #include <rtems/rtems/signalimpl.h>
 #include <rtems/rtems/asrimpl.h>
 #include <rtems/rtems/tasks.h>
@@ -89,3 +90,19 @@ rtems_status_code rtems_signal_catch(
   _Thread_Enable_dispatch();
   return RTEMS_SUCCESSFUL;
 }
+
+#if defined(RTEMS_MULTIPROCESSING)
+static void _Signal_Manager_initialization( void )
+{
+  _MPCI_Register_packet_processor(
+    MP_PACKET_SIGNAL,
+    _Signal_MP_Process_packet
+  );
+}
+
+RTEMS_SYSINIT_ITEM(
+  _Signal_Manager_initialization,
+  RTEMS_SYSINIT_CLASSIC_SIGNAL,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
+#endif
diff --git a/cpukit/sapi/src/rtemsapi.c b/cpukit/sapi/src/rtemsapi.c
index 422cf6c..a5da72c 100644
--- a/cpukit/sapi/src/rtemsapi.c
+++ b/cpukit/sapi/src/rtemsapi.c
@@ -35,11 +35,9 @@
 #include <rtems/rtems/ratemonimpl.h>
 #include <rtems/rtems/regionimpl.h>
 #include <rtems/rtems/semimpl.h>
-#include <rtems/rtems/signalimpl.h>
 
 void _RTEMS_API_Initialize(void)
 {
-  _Signal_Manager_initialization();
   _Event_Manager_initialization();
   _Message_queue_Manager_initialization();
   _Semaphore_Manager_initialization();
diff --git a/cpukit/score/include/rtems/sysinit.h b/cpukit/score/include/rtems/sysinit.h
index cd60487..6351e12 100644
--- a/cpukit/score/include/rtems/sysinit.h
+++ b/cpukit/score/include/rtems/sysinit.h
@@ -33,6 +33,7 @@ extern "C" {
 #define RTEMS_SYSINIT_USER_EXTENSIONS            000320
 #define RTEMS_SYSINIT_CLASSIC_TASKS              000340
 #define RTEMS_SYSINIT_CLASSIC_TIMER              000341
+#define RTEMS_SYSINIT_CLASSIC_SIGNAL             000342
 #define RTEMS_SYSINIT_IDLE_THREADS               000380
 #define RTEMS_SYSINIT_BSP_LIBC                   000400
 #define RTEMS_SYSINIT_BEFORE_DRIVERS             000500
diff --git a/testsuites/sptests/spsysinit01/init.c b/testsuites/sptests/spsysinit01/init.c
index 6d05e0f..f7c3073 100644
--- a/testsuites/sptests/spsysinit01/init.c
+++ b/testsuites/sptests/spsysinit01/init.c
@@ -49,6 +49,8 @@ typedef enum {
   CLASSIC_TASKS_POST,
   CLASSIC_TIMER_PRE,
   CLASSIC_TIMER_POST,
+  CLASSIC_SIGNAL_PRE,
+  CLASSIC_SIGNAL_POST,
   IDLE_THREADS_PRE,
   IDLE_THREADS_POST,
   BSP_LIBC_PRE,
@@ -178,6 +180,17 @@ 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_IDLE_THREADS)
 {
   assert(_System_state_Is_before_initialization(_System_state_Get()));




More information about the vc mailing list