summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/smp.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-03 13:37:14 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-04 13:36:09 +0100
commit5b0d2c1965e1dab2915231866aaa5623ced66330 (patch)
treee425e0eb73815b874efbd946c80047341f304793 /cpukit/score/src/smp.c
parentscore: Add _Per_CPU_Is_boot_processor() (diff)
downloadrtems-5b0d2c1965e1dab2915231866aaa5623ced66330.tar.bz2
score: Add _SMP_Before_multitasking_action()
The use case for this is the Cortex-A9 MPCore which has per-processor registers (only accessible by a particular processor) for the global timer used by the clock driver. This might be useful for other drivers as well. Update #2554.
Diffstat (limited to '')
-rw-r--r--cpukit/score/src/smp.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
index 8049643a95..4dacd4ed5c 100644
--- a/cpukit/score/src/smp.c
+++ b/cpukit/score/src/smp.c
@@ -211,4 +211,27 @@ void _SMP_Send_message_multicast(
}
}
+bool _SMP_Before_multitasking_action_broadcast(
+ SMP_Action_handler handler,
+ void *arg
+)
+{
+ bool done = true;
+ uint32_t cpu_count = _SMP_Get_processor_count();
+ uint32_t cpu_index;
+
+ for ( cpu_index = 0 ; done && cpu_index < cpu_count ; ++cpu_index ) {
+ Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index );
+
+ if (
+ !_Per_CPU_Is_boot_processor( cpu )
+ && _Per_CPU_Is_processor_online( cpu )
+ ) {
+ done = _SMP_Before_multitasking_action( cpu, handler, arg );
+ }
+ }
+
+ return done;
+}
+
SMP_Test_message_handler _SMP_Test_message_handler;