[rtems commit] score: Add function to send a SMP message to a set of CPUs
Daniel Hellstrom
danielh at rtems.org
Fri Aug 22 11:07:54 UTC 2014
Module: rtems
Branch: master
Commit: a68cc1bb10e72504a6c4169c64eb1cfc1280da67
Changeset: http://git.rtems.org/rtems/commit/?id=a68cc1bb10e72504a6c4169c64eb1cfc1280da67
Author: Daniel Cederman <cederman at gaisler.com>
Date: Tue Jul 8 11:33:55 2014 +0200
score: Add function to send a SMP message to a set of CPUs
---
cpukit/score/include/rtems/score/smpimpl.h | 15 +++++++++++++++
cpukit/score/src/smp.c | 16 ++++++++++++++++
2 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/cpukit/score/include/rtems/score/smpimpl.h b/cpukit/score/include/rtems/score/smpimpl.h
index e2fee39..d49f88f 100644
--- a/cpukit/score/include/rtems/score/smpimpl.h
+++ b/cpukit/score/include/rtems/score/smpimpl.h
@@ -175,6 +175,21 @@ void _SMP_Broadcast_message(
uint32_t message
);
+/**
+ * @brief Sends a SMP message to a set of processors.
+ *
+ * The sending processor may be part of the set.
+ *
+ * @param[in] setsize The size of the set of target processors of the message.
+ * @param[in] cpus The set of target processors of the message.
+ * @param[in] message The message.
+ */
+void _SMP_Send_message_multicast(
+ const size_t setsize,
+ const cpu_set_t *cpus,
+ unsigned long message
+);
+
#endif /* defined( RTEMS_SMP ) */
/**
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
index f0554fe..7140664 100644
--- a/cpukit/score/src/smp.c
+++ b/cpukit/score/src/smp.c
@@ -177,4 +177,20 @@ void _SMP_Broadcast_message( uint32_t message )
}
}
+void _SMP_Send_message_multicast(
+ const size_t setsize,
+ const cpu_set_t *cpus,
+ unsigned long message
+)
+{
+ uint32_t cpu_count = _SMP_Get_processor_count();
+ uint32_t cpu_index;
+
+ for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) {
+ if ( CPU_ISSET_S( cpu_index, setsize, cpus ) ) {
+ _SMP_Send_message( cpu_index, message );
+ }
+ }
+}
+
SMP_Test_message_handler _SMP_Test_message_handler;
More information about the vc
mailing list