summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-12 11:13:32 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-12 11:15:40 +0200
commitef9d20f691cd8bd2135a6d513bf0e2372ba6c93b (patch)
tree29987a4572519f3d9b94e0e9309fdcfc78613396 /cpukit/score
parentbsp/imx: CLOCK_DRIVER_USE_ONLY_BOOT_PROCESSOR (diff)
downloadrtems-ef9d20f691cd8bd2135a6d513bf0e2372ba6c93b.tar.bz2
score: More robust _SMP_Multicast_action()
If the caller already disabled interrupts, then do not disable thread dispatching. Calling _SMP_Multicast_action() with interrupts disabled is a questionable use case.
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/src/smpmulticastaction.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/cpukit/score/src/smpmulticastaction.c b/cpukit/score/src/smpmulticastaction.c
index 966a119217..88f874eb59 100644
--- a/cpukit/score/src/smpmulticastaction.c
+++ b/cpukit/score/src/smpmulticastaction.c
@@ -218,6 +218,7 @@ void _SMP_Multicast_action(
Per_CPU_Jobs jobs;
uint32_t cpu_max;
Per_CPU_Control *cpu_self;
+ uint32_t isr_level;
cpu_max = _SMP_Get_processor_maximum();
_Assert( cpu_max <= CPU_MAXIMUM_PROCESSORS );
@@ -228,9 +229,18 @@ void _SMP_Multicast_action(
jobs.handler = handler;
jobs.arg = arg;
+ isr_level = _ISR_Get_level();
+
+ if ( isr_level == 0 ) {
+ cpu_self = _Thread_Dispatch_disable();
+ } else {
+ cpu_self = _Per_CPU_Get();
+ }
- cpu_self = _Thread_Dispatch_disable();
_SMP_Issue_action_jobs( targets, &jobs, cpu_max );
_SMP_Wait_for_action_jobs( targets, &jobs, cpu_max, cpu_self );
- _Thread_Dispatch_enable( cpu_self );
+
+ if ( isr_level == 0 ) {
+ _Thread_Dispatch_enable( cpu_self );
+ }
}