summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-18 06:31:33 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-05-20 08:49:35 +0200
commit4f0686382b60375d7e7f09aa1f99cf6ecbce7067 (patch)
tree1a34627219626795c05fb71bf6add3bb0ddd2071 /cpukit/score
parentposix: Remove unused OBJECTS_POSIX_INTERRUPTS (diff)
downloadrtems-4f0686382b60375d7e7f09aa1f99cf6ecbce7067.tar.bz2
score: Use dedicated lock for per-CPU jobs
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/src/smpmulticastaction.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/cpukit/score/src/smpmulticastaction.c b/cpukit/score/src/smpmulticastaction.c
index 0a73bff11f..ea430e8e7c 100644
--- a/cpukit/score/src/smpmulticastaction.c
+++ b/cpukit/score/src/smpmulticastaction.c
@@ -89,31 +89,33 @@ struct Per_CPU_Jobs {
Per_CPU_Job Jobs[ CPU_MAXIMUM_PROCESSORS ];
};
+#define _Per_CPU_Jobs_ISR_disable_and_acquire( cpu, lock_context ) \
+ _ISR_lock_ISR_disable_and_acquire( &( cpu )->Jobs.Lock, lock_context )
+
+#define _Per_CPU_Jobs_release_and_ISR_enable( cpu, lock_context ) \
+ _ISR_lock_Release_and_ISR_enable( &( cpu )->Jobs.Lock, lock_context )
+
void _Per_CPU_Perform_jobs( Per_CPU_Control *cpu )
{
ISR_lock_Context lock_context;
Per_CPU_Job *job;
- _ISR_lock_ISR_disable( &lock_context );
- _Per_CPU_Acquire( cpu, &lock_context );
+ _Per_CPU_Jobs_ISR_disable_and_acquire( cpu, &lock_context );
while ( ( job = cpu->Jobs.head ) != NULL ) {
Per_CPU_Jobs *jobs;
cpu->Jobs.head = job->next;
- _Per_CPU_Release( cpu, &lock_context );
- _ISR_lock_ISR_enable( &lock_context );
+ _Per_CPU_Jobs_release_and_ISR_enable( cpu, &lock_context );
jobs = job->jobs;
( *jobs->handler )( jobs->arg );
_Atomic_Store_ulong( &job->done, PER_CPU_JOB_DONE, ATOMIC_ORDER_RELEASE );
- _ISR_lock_ISR_disable( &lock_context );
- _Per_CPU_Acquire( cpu, &lock_context );
+ _Per_CPU_Jobs_ISR_disable_and_acquire( cpu, &lock_context );
}
- _Per_CPU_Release( cpu, &lock_context );
- _ISR_lock_ISR_enable( &lock_context );
+ _Per_CPU_Jobs_release_and_ISR_enable( cpu, &lock_context );
}
static void _Per_CPU_Try_perform_jobs( Per_CPU_Control *cpu_self )
@@ -157,8 +159,7 @@ static void _SMP_Issue_action_jobs(
job->jobs = jobs;
cpu = _Per_CPU_Get_by_index( cpu_index );
- _ISR_lock_ISR_disable( &lock_context );
- _Per_CPU_Acquire( cpu, &lock_context );
+ _Per_CPU_Jobs_ISR_disable_and_acquire( cpu, &lock_context );
if ( cpu->Jobs.head == NULL ) {
cpu->Jobs.head = job;
@@ -168,8 +169,7 @@ static void _SMP_Issue_action_jobs(
cpu->Jobs.tail = &job->next;
- _Per_CPU_Release( cpu, &lock_context );
- _ISR_lock_ISR_enable( &lock_context );
+ _Per_CPU_Jobs_release_and_ISR_enable( cpu, &lock_context );
_SMP_Send_message( cpu_index, SMP_MESSAGE_PERFORM_JOBS );
}
}