[PATCH 1/2] Introduce general purpose system server event

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Nov 11 11:01:25 UTC 2015


Use this event for the interrupt server to avoid conflicts with
application events used by interrupt handlers.
---
 c/src/lib/libbsp/shared/src/irq-server.c | 8 +++-----
 cpukit/rtems/include/rtems/rtems/event.h | 5 +++--
 cpukit/rtems/src/timerserver.c           | 4 ++--
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/c/src/lib/libbsp/shared/src/irq-server.c b/c/src/lib/libbsp/shared/src/irq-server.c
index 5e5dbf1..3537493 100644
--- a/c/src/lib/libbsp/shared/src/irq-server.c
+++ b/c/src/lib/libbsp/shared/src/irq-server.c
@@ -27,8 +27,6 @@
 
 #include <bsp/irq-generic.h>
 
-#define BSP_INTERRUPT_EVENT RTEMS_EVENT_13
-
 RTEMS_INTERRUPT_LOCK_DEFINE(
   static,
   bsp_interrupt_server_lock,
@@ -73,7 +71,7 @@ static void bsp_interrupt_server_trigger(void *arg)
     ++bsp_interrupt_server_errors;
   }
 
-  rtems_event_send(bsp_interrupt_server_id, BSP_INTERRUPT_EVENT);
+  rtems_event_system_send(bsp_interrupt_server_id, RTEMS_EVENT_SYSTEM_SERVER);
 }
 
 static bsp_interrupt_server_entry *bsp_interrupt_server_get_entry(void)
@@ -106,8 +104,8 @@ static void bsp_interrupt_server_task(rtems_task_argument arg)
     rtems_event_set events = 0;
     bsp_interrupt_server_entry *e = NULL;
 
-    sc = rtems_event_receive(
-      BSP_INTERRUPT_EVENT,
+    sc = rtems_event_system_receive(
+      RTEMS_EVENT_SYSTEM_SERVER,
       RTEMS_EVENT_ALL | RTEMS_WAIT,
       RTEMS_NO_TIMEOUT,
       &events
diff --git a/cpukit/rtems/include/rtems/rtems/event.h b/cpukit/rtems/include/rtems/rtems/event.h
index 012452a..4263a4b 100644
--- a/cpukit/rtems/include/rtems/rtems/event.h
+++ b/cpukit/rtems/include/rtems/rtems/event.h
@@ -319,9 +319,10 @@ rtems_status_code rtems_event_receive (
 #define RTEMS_EVENT_SYSTEM_NETWORK_CLOSE RTEMS_EVENT_26
 
 /**
- * @brief Reserved system event for the timer server.
+ * @brief Reserved system event for the server threads, e.g timer or interrupt
+ * server.
  */
-#define RTEMS_EVENT_SYSTEM_TIMER_SERVER RTEMS_EVENT_30
+#define RTEMS_EVENT_SYSTEM_SERVER RTEMS_EVENT_30
 
 /**
  * @brief Reserved system event for transient usage.
diff --git a/cpukit/rtems/src/timerserver.c b/cpukit/rtems/src/timerserver.c
index 29e7bc4..7d75780 100644
--- a/cpukit/rtems/src/timerserver.c
+++ b/cpukit/rtems/src/timerserver.c
@@ -256,7 +256,7 @@ static rtems_task _Timer_server_Body(
     );
 
     (void) rtems_event_system_receive(
-      RTEMS_EVENT_SYSTEM_TIMER_SERVER,
+      RTEMS_EVENT_SYSTEM_SERVER,
       RTEMS_EVENT_ALL | RTEMS_WAIT,
       RTEMS_NO_TIMEOUT,
       &events
@@ -281,7 +281,7 @@ static void _Timer_server_Wakeup(
     _Timer_server_Get_seconds
   );
 
-  (void) rtems_event_system_send( id, RTEMS_EVENT_SYSTEM_TIMER_SERVER );
+  (void) rtems_event_system_send( id, RTEMS_EVENT_SYSTEM_SERVER );
 }
 
 static void _Timer_server_Initialize_watchdogs(
-- 
1.8.4.5



More information about the devel mailing list