[PATCH 07/18] score: Remove SMP_MESSAGE_CLOCK_TICK

Sebastian Huber sebastian.huber at embedded-brains.de
Mon May 20 07:33:33 UTC 2019


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 afd5d01f1e..478a37f5d7 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 d8b2dd3edc..0543b17ec5 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 ecea1fda43..1b7841630b 100644
--- a/cpukit/include/rtems/score/smpimpl.h
+++ b/cpukit/include/rtems/score/smpimpl.h
@@ -57,16 +57,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.
  */
-- 
2.16.4




More information about the devel mailing list