[rtems commit] score: Remove SMP_MESSAGE_CLOCK_TICK

Sebastian Huber sebh at rtems.org
Tue May 21 04:25:00 UTC 2019


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Apr 18 07:38:13 2019 +0200

score: Remove SMP_MESSAGE_CLOCK_TICK

Use _SMP_Multicast_action() instead.

---

 bsps/i386/pc386/clock/ckinit.c       | 10 +++++++++-
 bsps/i386/pc386/start/smp-imps.c     | 11 +----------
 cpukit/include/rtems/score/smpimpl.h | 10 ----------
 3 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/bsps/i386/pc386/clock/ckinit.c b/bsps/i386/pc386/clock/ckinit.c
index afd5d01..478a37f 100644
--- a/bsps/i386/pc386/clock/ckinit.c
+++ b/bsps/i386/pc386/clock/ckinit.c
@@ -29,6 +29,9 @@
 #include <libcpu/cpuModel.h>
 #include <assert.h>
 #include <rtems/timecounter.h>
+#ifdef RTEMS_SMP
+#include <rtems/score/smpimpl.h>
+#endif
 
 #define CLOCK_VECTOR 0
 
@@ -66,7 +69,12 @@ extern volatile uint32_t Clock_driver_ticks;
 
 #ifdef RTEMS_SMP
 #define Clock_driver_support_at_tick() \
-  _SMP_Send_message_broadcast(SMP_MESSAGE_CLOCK_TICK)
+  do {                                                              \
+    Processor_mask targets;                                         \
+    _Processor_mask_Assign(&targets, _SMP_Get_online_processors()); \
+    _Processor_mask_Clear(&targets, _SMP_Get_current_processor());  \
+    _SMP_Multicast_action(&targets, Clock_isr, NULL);               \
+  } while (0)
 #endif
 
 static uint32_t pc386_get_timecount_tsc(struct timecounter *tc)
diff --git a/bsps/i386/pc386/start/smp-imps.c b/bsps/i386/pc386/start/smp-imps.c
index d8b2dd3..0543b17 100644
--- a/bsps/i386/pc386/start/smp-imps.c
+++ b/bsps/i386/pc386/start/smp-imps.c
@@ -744,22 +744,13 @@ static void smp_apic_ack(void)
   IMPS_LAPIC_WRITE(LAPIC_EOI, 0 );     /* ACK the interrupt */
 }
 
-/* FIXME: There should be a header file for this */
-void Clock_isr(void *arg);
-
 static void bsp_inter_processor_interrupt(void *arg)
 {
-  unsigned long message;
-
   (void) arg;
 
   smp_apic_ack();
 
-  message = _SMP_Inter_processor_interrupt_handler(_Per_CPU_Get());
-
-  if ((message & SMP_MESSAGE_CLOCK_TICK) != 0) {
-    Clock_isr(NULL);
-  }
+  _SMP_Inter_processor_interrupt_handler(_Per_CPU_Get());
 }
 
 static void ipi_install_irq(void)
diff --git a/cpukit/include/rtems/score/smpimpl.h b/cpukit/include/rtems/score/smpimpl.h
index ecea1fd..1b78416 100644
--- a/cpukit/include/rtems/score/smpimpl.h
+++ b/cpukit/include/rtems/score/smpimpl.h
@@ -58,16 +58,6 @@ extern "C" {
 #define SMP_MESSAGE_PERFORM_JOBS 0x4UL
 
 /**
- * @brief SMP message to request a clock tick.
- *
- * This message is provided for systems without a proper interrupt affinity
- * support and may be used by the clock driver.
- *
- * @see _SMP_Send_message().
- */
-#define SMP_MESSAGE_CLOCK_TICK 0x8UL
-
-/**
  * @brief SMP fatal codes.
  */
 typedef enum {




More information about the vc mailing list