summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-19 11:01:31 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-05-20 08:52:39 +0200
commit85d6e845d2b9c47779cc96438e3aa6e894b4a71a (patch)
tree3425c4ba0cc422f01ff648a37c9cc2ca6b209e77 /cpukit/score
parentscore: Move per-processor job data structures (diff)
downloadrtems-85d6e845d2b9c47779cc96438e3aa6e894b4a71a.tar.bz2
score: Add _Per_CPU_Add_job()
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/src/smpmulticastaction.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/cpukit/score/src/smpmulticastaction.c b/cpukit/score/src/smpmulticastaction.c
index ad3b1531ec..1207000e6a 100644
--- a/cpukit/score/src/smpmulticastaction.c
+++ b/cpukit/score/src/smpmulticastaction.c
@@ -57,6 +57,24 @@ void _Per_CPU_Perform_jobs( Per_CPU_Control *cpu )
_Per_CPU_Jobs_ISR_disable_and_acquire( cpu, &lock_context );
}
+}
+
+void _Per_CPU_Add_job( Per_CPU_Control *cpu, Per_CPU_Job *job )
+{
+ ISR_lock_Context lock_context;
+
+ _Atomic_Store_ulong( &job->done, 0, ATOMIC_ORDER_RELAXED );
+ _Assert( job->next == NULL );
+
+ _Per_CPU_Jobs_ISR_disable_and_acquire( cpu, &lock_context );
+
+ if ( cpu->Jobs.head == NULL ) {
+ cpu->Jobs.head = job;
+ } else {
+ *cpu->Jobs.tail = job;
+ }
+
+ cpu->Jobs.tail = &job->next;
_Per_CPU_Jobs_release_and_ISR_enable( cpu, &lock_context );
}
@@ -97,27 +115,14 @@ static void _SMP_Issue_action_jobs(
for ( cpu_index = 0; cpu_index < cpu_max; ++cpu_index ) {
if ( _Processor_mask_Is_set( targets, cpu_index ) ) {
- ISR_lock_Context lock_context;
- Per_CPU_Job *job;
- Per_CPU_Control *cpu;
+ Per_CPU_Job *job;
+ Per_CPU_Control *cpu;
job = &jobs->Jobs[ cpu_index ];
- _Atomic_Store_ulong( &job->done, 0, ATOMIC_ORDER_RELAXED );
- _Assert( job->next == NULL );
job->context = &jobs->Context;
-
cpu = _Per_CPU_Get_by_index( cpu_index );
- _Per_CPU_Jobs_ISR_disable_and_acquire( cpu, &lock_context );
-
- if ( cpu->Jobs.head == NULL ) {
- cpu->Jobs.head = job;
- } else {
- *cpu->Jobs.tail = job;
- }
-
- cpu->Jobs.tail = &job->next;
- _Per_CPU_Jobs_release_and_ISR_enable( cpu, &lock_context );
+ _Per_CPU_Add_job( cpu, job );
_SMP_Send_message( cpu_index, SMP_MESSAGE_PERFORM_JOBS );
}
}