[rtems commit] Optional Classic Event initialization

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


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

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

Optional Classic Event initialization

Update #2408.

---

 cpukit/rtems/Makefile.am                     |  1 -
 cpukit/rtems/include/rtems/rtems/eventimpl.h | 12 -----------
 cpukit/rtems/src/event.c                     | 32 ----------------------------
 cpukit/rtems/src/eventseize.c                | 14 ++++++++++++
 cpukit/sapi/src/rtemsapi.c                   |  2 --
 cpukit/score/include/rtems/sysinit.h         |  1 +
 testsuites/sptests/spsysinit01/init.c        | 13 +++++++++++
 7 files changed, 28 insertions(+), 47 deletions(-)

diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am
index 211aef4..6c87b94 100644
--- a/cpukit/rtems/Makefile.am
+++ b/cpukit/rtems/Makefile.am
@@ -199,7 +199,6 @@ librtems_a_SOURCES += src/semdata.c
 librtems_a_SOURCES += src/semsetpriority.c
 
 ## EVENT_C_FILES
-librtems_a_SOURCES += src/event.c
 librtems_a_SOURCES += src/eventreceive.c
 librtems_a_SOURCES += src/eventseize.c
 librtems_a_SOURCES += src/eventsend.c
diff --git a/cpukit/rtems/include/rtems/rtems/eventimpl.h b/cpukit/rtems/include/rtems/rtems/eventimpl.h
index 460b7ce..f4850d2 100644
--- a/cpukit/rtems/include/rtems/rtems/eventimpl.h
+++ b/cpukit/rtems/include/rtems/rtems/eventimpl.h
@@ -44,18 +44,6 @@ extern "C" {
  */
 #define EVENT_SETS_NONE_PENDING 0
 
-/**
- *  @brief Event Manager Initialization
- *
- *  Event Manager
- *
- *  This routine performs the initialization necessary for this manager.
- *
- *  - INTERRUPT LATENCY:
- *    + single case
- */
-void _Event_Manager_initialization( void );
-
 void _Event_Seize(
   rtems_event_set    event_in,
   rtems_option       option_set,
diff --git a/cpukit/rtems/src/event.c b/cpukit/rtems/src/event.c
deleted file mode 100644
index 7ec44d7..0000000
--- a/cpukit/rtems/src/event.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- *  @file
- *
- *  @brief Event Manager Initialization
- *  @ingroup ClassicEvent
- */
-
-/*
- *  COPYRIGHT (c) 1989-2008.
- *  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/eventimpl.h>
-
-void _Event_Manager_initialization( void )
-{
-  /*
-   *  Register the MP Process Packet routine.
-   */
-
-#if defined(RTEMS_MULTIPROCESSING)
-  _MPCI_Register_packet_processor( MP_PACKET_EVENT, _Event_MP_Process_packet );
-#endif
-}
diff --git a/cpukit/rtems/src/eventseize.c b/cpukit/rtems/src/eventseize.c
index 9c41b77..3dc554f 100644
--- a/cpukit/rtems/src/eventseize.c
+++ b/cpukit/rtems/src/eventseize.c
@@ -18,6 +18,7 @@
   #include "config.h"
 #endif
 
+#include <rtems/sysinit.h>
 #include <rtems/rtems/eventimpl.h>
 #include <rtems/rtems/optionsimpl.h>
 #include <rtems/score/threadimpl.h>
@@ -118,3 +119,16 @@ void _Event_Seize(
 
   _Thread_Dispatch_enable( cpu_self );
 }
+
+#if defined(RTEMS_MULTIPROCESSING)
+static void _Event_Manager_initialization( void )
+{
+  _MPCI_Register_packet_processor( MP_PACKET_EVENT, _Event_MP_Process_packet );
+}
+
+RTEMS_SYSINIT_ITEM(
+  _Event_Manager_initialization,
+  RTEMS_SYSINIT_CLASSIC_EVENT,
+  RTEMS_SYSINIT_ORDER_MIDDLE
+);
+#endif
diff --git a/cpukit/sapi/src/rtemsapi.c b/cpukit/sapi/src/rtemsapi.c
index a5da72c..3a6005a 100644
--- a/cpukit/sapi/src/rtemsapi.c
+++ b/cpukit/sapi/src/rtemsapi.c
@@ -29,7 +29,6 @@
 #include <rtems/rtems/barrierimpl.h>
 #include <rtems/rtems/clock.h>
 #include <rtems/rtems/dpmemimpl.h>
-#include <rtems/rtems/eventimpl.h>
 #include <rtems/rtems/messageimpl.h>
 #include <rtems/rtems/partimpl.h>
 #include <rtems/rtems/ratemonimpl.h>
@@ -38,7 +37,6 @@
 
 void _RTEMS_API_Initialize(void)
 {
-  _Event_Manager_initialization();
   _Message_queue_Manager_initialization();
   _Semaphore_Manager_initialization();
   _Partition_Manager_initialization();
diff --git a/cpukit/score/include/rtems/sysinit.h b/cpukit/score/include/rtems/sysinit.h
index 6351e12..a5013e2 100644
--- a/cpukit/score/include/rtems/sysinit.h
+++ b/cpukit/score/include/rtems/sysinit.h
@@ -34,6 +34,7 @@ extern "C" {
 #define RTEMS_SYSINIT_CLASSIC_TASKS              000340
 #define RTEMS_SYSINIT_CLASSIC_TIMER              000341
 #define RTEMS_SYSINIT_CLASSIC_SIGNAL             000342
+#define RTEMS_SYSINIT_CLASSIC_EVENT              000343
 #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 f7c3073..00eae4b 100644
--- a/testsuites/sptests/spsysinit01/init.c
+++ b/testsuites/sptests/spsysinit01/init.c
@@ -51,6 +51,8 @@ typedef enum {
   CLASSIC_TIMER_POST,
   CLASSIC_SIGNAL_PRE,
   CLASSIC_SIGNAL_POST,
+  CLASSIC_EVENT_PRE,
+  CLASSIC_EVENT_POST,
   IDLE_THREADS_PRE,
   IDLE_THREADS_POST,
   BSP_LIBC_PRE,
@@ -191,6 +193,17 @@ 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_IDLE_THREADS)
 {
   assert(_System_state_Is_before_initialization(_System_state_Get()));




More information about the vc mailing list