<div dir="ltr">Looks OK. I assume this is infrastructure for something that is coming.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 3, 2016 at 8:47 AM, Sebastian Huber <span dir="ltr"><<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
cpukit/score/include/rtems/score/smpimpl.h | 11 +++++++++++<br>
cpukit/score/src/smp.c | 5 ++++-<br>
testsuites/smptests/smpipi01/init.c | 10 ++++++++++<br>
3 files changed, 25 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/cpukit/score/include/rtems/score/smpimpl.h b/cpukit/score/include/rtems/score/smpimpl.h<br>
index 09c47ec..386216f 100644<br>
--- a/cpukit/score/include/rtems/score/smpimpl.h<br>
+++ b/cpukit/score/include/rtems/score/smpimpl.h<br>
@@ -20,6 +20,7 @@<br>
<br>
#include <rtems/score/smp.h><br>
#include <rtems/score/percpu.h><br>
+#include <rtems/score/processormask.h><br>
#include <rtems/fatal.h><br>
#include <rtems/rtems/cache.h><br>
<br>
@@ -91,6 +92,16 @@ static inline void _SMP_Fatal( SMP_Fatal_code code )<br>
#if defined( RTEMS_SMP )<br>
<br>
/**<br>
+ * @brief Set of online processors.<br>
+ *<br>
+ * A processor is online if was started during system initialization. In this<br>
+ * case its corresponding bit in the mask is set.<br>
+ *<br>
+ * @see _SMP_Handler_initialize().<br>
+ */<br>
+extern Processor_mask _SMP_Online_processors;<br>
+<br>
+/**<br>
* @brief Performs high-level initialization of a secondary processor and runs<br>
* the application threads.<br>
*<br>
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c<br>
index b2713f1..68a55ff 100644<br>
--- a/cpukit/score/src/smp.c<br>
+++ b/cpukit/score/src/smp.c<br>
@@ -29,6 +29,8 @@<br>
#error "deferred FP switch not implemented for SMP"<br>
#endif<br>
<br>
+Processor_mask _SMP_Online_processors;<br>
+<br>
uint32_t _SMP_Processor_count;<br>
<br>
static void _SMP_Start_processors( uint32_t cpu_count )<br>
@@ -36,7 +38,6 @@ static void _SMP_Start_processors( uint32_t cpu_count )<br>
uint32_t cpu_index_self = _SMP_Get_current_processor();<br>
uint32_t cpu_index;<br>
<br>
-<br>
for ( cpu_index = 0 ; cpu_index < cpu_count; ++cpu_index ) {<br>
const Scheduler_Assignment *assignment =<br>
_Scheduler_Get_assignment( cpu_index );<br>
@@ -69,6 +70,8 @@ static void _SMP_Start_processors( uint32_t cpu_count )<br>
<br>
++context->processor_count;<br>
cpu->scheduler_context = context;<br>
+<br>
+ _Processor_mask_Set( _SMP_Online_processors, cpu_index );<br>
}<br>
}<br>
}<br>
diff --git a/testsuites/smptests/smpipi01/init.c b/testsuites/smptests/smpipi01/init.c<br>
index db0688c..8c39d18 100644<br>
--- a/testsuites/smptests/smpipi01/init.c<br>
+++ b/testsuites/smptests/smpipi01/init.c<br>
@@ -161,6 +161,10 @@ static void test_send_message_flood(<br>
}<br>
<br>
for (cpu_index = 0; cpu_index < cpu_count; ++cpu_index) {<br>
+ rtems_test_assert(<br>
+ _Processor_mask_Is_set(_SMP_Online_processors, cpu_index)<br>
+ );<br>
+<br>
printf(<br>
"inter-processor interrupts for processor %"<br>
PRIu32 "%s: %" PRIu32 "\n",<br>
@@ -169,6 +173,12 @@ static void test_send_message_flood(<br>
ctx->counters[cpu_index].value<br>
);<br>
}<br>
+<br>
+ for (; cpu_index < CPU_COUNT; ++cpu_index) {<br>
+ rtems_test_assert(<br>
+ !_Processor_mask_Is_set(_SMP_Online_processors, cpu_index)<br>
+ );<br>
+ }<br>
}<br>
<br>
static void test(void)<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.4.5<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</font></span></blockquote></div><br></div>