summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-11 15:16:40 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-12 09:44:48 +0200
commite90486ab41a4edf045a6153675b6be9dcd422b71 (patch)
treeea0ad25fd9d9324ca02f9a26556d6cc5e2e9a592 /cpukit/include/rtems
parentscore: Use processor mask in _SMP_Multicast_action (diff)
downloadrtems-e90486ab41a4edf045a6153675b6be9dcd422b71.tar.bz2
score: Rework SMP multicast action
Use a FIFO list of jobs per processor to carry out the SMP multicast action. Use a done indicator per job to reduce the bus traffic a bit.
Diffstat (limited to '')
-rw-r--r--cpukit/include/rtems/score/percpu.h40
-rw-r--r--cpukit/include/rtems/score/smpimpl.h13
2 files changed, 44 insertions, 9 deletions
diff --git a/cpukit/include/rtems/score/percpu.h b/cpukit/include/rtems/score/percpu.h
index 27f4e93a46..cd7713db6d 100644
--- a/cpukit/include/rtems/score/percpu.h
+++ b/cpukit/include/rtems/score/percpu.h
@@ -74,6 +74,8 @@ struct _Thread_Control;
struct Scheduler_Context;
+struct Per_CPU_Job;
+
/**
* @defgroup PerCPU RTEMS Per CPU Information
*
@@ -495,6 +497,37 @@ typedef struct Per_CPU_Control {
Atomic_Uintptr before_multitasking_action;
/**
+ * @brief FIFO list of jobs to be performed by this processor.
+ *
+ * @see _SMP_Multicast_action().
+ */
+ struct {
+ /**
+ * @brief Lock to protect the FIFO list of jobs to be performed by this
+ * processor.
+ */
+ ISR_lock_Control Lock;
+
+ /**
+ * @brief Head of the FIFO list of jobs to be performed by this
+ * processor.
+ *
+ * This member is protected by the Per_CPU_Control::Jobs::Lock lock.
+ */
+ struct Per_CPU_Job *head;
+
+ /**
+ * @brief Tail of the FIFO list of jobs to be performed by this
+ * processor.
+ *
+ * This member is only valid if the head is not @c NULL.
+ *
+ * This member is protected by the Per_CPU_Control::Jobs::Lock lock.
+ */
+ struct Per_CPU_Job **tail;
+ } Jobs;
+
+ /**
* @brief Indicates if the processor has been successfully started via
* _CPU_SMP_Start_processor().
*/
@@ -710,6 +743,13 @@ bool _Per_CPU_State_wait_for_non_initial_state(
uint32_t timeout_in_ns
);
+/**
+ * @brief Performs the jobs of the specified processor.
+ *
+ * @param[in, out] cpu The jobs of this processor will be performed.
+ */
+void _Per_CPU_Perform_jobs( Per_CPU_Control *cpu );
+
#endif /* defined( RTEMS_SMP ) */
/*
diff --git a/cpukit/include/rtems/score/smpimpl.h b/cpukit/include/rtems/score/smpimpl.h
index 6b59b9497d..d6fdef5ca1 100644
--- a/cpukit/include/rtems/score/smpimpl.h
+++ b/cpukit/include/rtems/score/smpimpl.h
@@ -51,11 +51,11 @@ extern "C" {
#define SMP_MESSAGE_TEST 0x2UL
/**
- * @brief SMP message to request a multicast action.
+ * @brief SMP message to perform per-processor jobs.
*
* @see _SMP_Send_message().
*/
-#define SMP_MESSAGE_MULTICAST_ACTION 0x4UL
+#define SMP_MESSAGE_PERFORM_JOBS 0x4UL
/**
* @brief SMP message to request a clock tick.
@@ -158,11 +158,6 @@ static inline void _SMP_Set_test_message_handler(
}
/**
- * @brief Processes all pending multicast actions.
- */
-void _SMP_Multicast_actions_process( void );
-
-/**
* @brief Interrupt handler for inter-processor interrupts.
*
* @return The received message.
@@ -195,8 +190,8 @@ static inline long unsigned _SMP_Inter_processor_interrupt_handler(
( *_SMP_Test_message_handler )( cpu_self );
}
- if ( ( message & SMP_MESSAGE_MULTICAST_ACTION ) != 0 ) {
- _SMP_Multicast_actions_process();
+ if ( ( message & SMP_MESSAGE_PERFORM_JOBS ) != 0 ) {
+ _Per_CPU_Perform_jobs( cpu_self );
}
}