summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/isrsmp.c3
-rw-r--r--cpukit/score/src/schedulersimplesmp.c6
-rw-r--r--cpukit/score/src/smp.c21
-rw-r--r--cpukit/score/src/threaddispatch.c5
-rw-r--r--cpukit/score/src/threadinitialize.c4
5 files changed, 9 insertions, 30 deletions
diff --git a/cpukit/score/src/isrsmp.c b/cpukit/score/src/isrsmp.c
index c743f92fd9..2f292b0bea 100644
--- a/cpukit/score/src/isrsmp.c
+++ b/cpukit/score/src/isrsmp.c
@@ -72,8 +72,5 @@ int _ISR_SMP_Exit(void)
_Thread_Dispatch_decrement_disable_level();
- if ( retval == 0 )
- _SMP_Request_other_cores_to_dispatch();
-
return retval;
}
diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c
index 55c40a67e8..aeef215b3a 100644
--- a/cpukit/score/src/schedulersimplesmp.c
+++ b/cpukit/score/src/schedulersimplesmp.c
@@ -58,9 +58,15 @@ static void _Scheduler_simple_smp_Allocate_processor(
}
if ( heir != victim ) {
+ const Per_CPU_Control *cpu_of_executing = _Per_CPU_Get();
+
heir->cpu = cpu_of_victim;
cpu_of_victim->heir = heir;
cpu_of_victim->dispatch_necessary = true;
+
+ if ( cpu_of_victim != cpu_of_executing ) {
+ _Per_CPU_Send_interrupt( cpu_of_victim );
+ }
}
}
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
index 35e8a01b90..5b299b4feb 100644
--- a/cpukit/score/src/smp.c
+++ b/cpukit/score/src/smp.c
@@ -165,27 +165,6 @@ void _SMP_Request_other_cores_to_perform_first_context_switch( void )
}
}
-void _SMP_Request_other_cores_to_dispatch( void )
-{
- if ( _System_state_Is_up( _System_state_Get() ) ) {
- uint32_t self = _SMP_Get_current_processor();
- uint32_t ncpus = _SMP_Get_processor_count();
- uint32_t cpu;
-
- for ( cpu = 0 ; cpu < ncpus ; ++cpu ) {
- const Per_CPU_Control *per_cpu = &_Per_CPU_Information[ cpu ];
-
- if (
- cpu != self
- && per_cpu->state == PER_CPU_STATE_UP
- && per_cpu->dispatch_necessary
- ) {
- _SMP_Send_message( cpu, 0 );
- }
- }
- }
-}
-
void _SMP_Request_other_cores_to_shutdown( void )
{
uint32_t self = _SMP_Get_current_processor();
diff --git a/cpukit/score/src/threaddispatch.c b/cpukit/score/src/threaddispatch.c
index ac906e44d9..c5d0a2199b 100644
--- a/cpukit/score/src/threaddispatch.c
+++ b/cpukit/score/src/threaddispatch.c
@@ -65,11 +65,6 @@ void _Thread_Dispatch( void )
* once someone calls _Thread_Dispatch().
*/
_Thread_Disable_dispatch();
-
- /*
- * If necessary, send dispatch request to other cores.
- */
- _SMP_Request_other_cores_to_dispatch();
#else
_Thread_Dispatch_set_disable_level( 1 );
#endif
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index bd0031fa7c..a87614721a 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -181,7 +181,9 @@ bool _Thread_Initialize(
#if defined(RTEMS_SMP)
the_thread->is_scheduled = false;
the_thread->is_executing = false;
- the_thread->cpu = NULL;
+
+ /* Initialize the cpu field for the non-SMP schedulers */
+ the_thread->cpu = _Per_CPU_Get_by_index( 0 );
#endif
the_thread->current_state = STATES_DORMANT;