From 0036ddf1f6263c3d352645f4d3a9afe4ba388bb2 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 17 Sep 2021 08:12:35 +0200 Subject: score: Provide two thread pin/unpin defaults The uniprocessor schedulers do not support systems with more than more processors. So they rivially support thread pinning and thus the SMP_FATAL_SCHEDULER_PIN_OR_UNPIN_NOT_SUPPORTED cannot happen. Add a second default implementation for SMP schedulers which do not support thread pinning. Change license to BSD-2-Clause according to file history and re-licensing agreement. Update #3053. --- cpukit/include/rtems/score/scheduler.h | 27 +++++++++++++++++++--- .../rtems/score/schedulerpriorityaffinitysmp.h | 4 ++-- cpukit/include/rtems/score/schedulerprioritysmp.h | 4 ++-- cpukit/include/rtems/score/schedulersimplesmp.h | 4 ++-- cpukit/include/rtems/score/schedulerstrongapa.h | 4 ++-- 5 files changed, 32 insertions(+), 11 deletions(-) (limited to 'cpukit/include/rtems/score') diff --git a/cpukit/include/rtems/score/scheduler.h b/cpukit/include/rtems/score/scheduler.h index 6cb07c4ff1..36fc1fd39c 100644 --- a/cpukit/include/rtems/score/scheduler.h +++ b/cpukit/include/rtems/score/scheduler.h @@ -443,16 +443,37 @@ Priority_Control _Scheduler_default_Unmap_priority( Thread_Scheduler_state next_state ); + /** + * @brief Does nothing. + * + * This default implementation for the thread pin or unpin operations should + * be used by uniprocessor schedulers if SMP support is enabled. + * + * @param scheduler This parameter is unused. + * @param the_thread This parameter is unused. + * @param node This parameter is unused. + * @param cpu This parameter is unused. + */ + void _Scheduler_default_Pin_or_unpin_do_nothing( + const Scheduler_Control *scheduler, + Thread_Control *the_thread, + Scheduler_Node *node, + struct Per_CPU_Control *cpu + ); + /** * @brief Does nothing in a single processor system, otherwise a fatal error * is issued. * + * This default implementation for the thread pin or unpin operations should + * be used by SMP schedulers which do not support thread pinning. + * * @param scheduler This parameter is unused. * @param the_thread This parameter is unused. * @param node This parameter is unused. * @param cpu This parameter is unused. */ - void _Scheduler_default_Pin_or_unpin( + void _Scheduler_default_Pin_or_unpin_not_supported( const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node, @@ -474,8 +495,8 @@ Priority_Control _Scheduler_default_Unmap_priority( _Scheduler_default_Ask_for_help, \ _Scheduler_default_Reconsider_help_request, \ _Scheduler_default_Withdraw_node, \ - _Scheduler_default_Pin_or_unpin, \ - _Scheduler_default_Pin_or_unpin, \ + _Scheduler_default_Pin_or_unpin_do_nothing, \ + _Scheduler_default_Pin_or_unpin_do_nothing, \ NULL, \ NULL, #else diff --git a/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h b/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h index 772a83f541..1b660fa296 100644 --- a/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h +++ b/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h @@ -65,8 +65,8 @@ extern "C" { _Scheduler_priority_affinity_SMP_Ask_for_help, \ _Scheduler_priority_affinity_SMP_Reconsider_help_request, \ _Scheduler_priority_affinity_SMP_Withdraw_node, \ - _Scheduler_default_Pin_or_unpin, \ - _Scheduler_default_Pin_or_unpin, \ + _Scheduler_default_Pin_or_unpin_not_supported, \ + _Scheduler_default_Pin_or_unpin_not_supported, \ _Scheduler_priority_affinity_SMP_Add_processor, \ _Scheduler_priority_affinity_SMP_Remove_processor, \ _Scheduler_priority_affinity_SMP_Node_initialize, \ diff --git a/cpukit/include/rtems/score/schedulerprioritysmp.h b/cpukit/include/rtems/score/schedulerprioritysmp.h index 80979a36ba..56f4aa5a5b 100644 --- a/cpukit/include/rtems/score/schedulerprioritysmp.h +++ b/cpukit/include/rtems/score/schedulerprioritysmp.h @@ -93,8 +93,8 @@ typedef struct { _Scheduler_priority_SMP_Ask_for_help, \ _Scheduler_priority_SMP_Reconsider_help_request, \ _Scheduler_priority_SMP_Withdraw_node, \ - _Scheduler_default_Pin_or_unpin, \ - _Scheduler_default_Pin_or_unpin, \ + _Scheduler_default_Pin_or_unpin_not_supported, \ + _Scheduler_default_Pin_or_unpin_not_supported, \ _Scheduler_priority_SMP_Add_processor, \ _Scheduler_priority_SMP_Remove_processor, \ _Scheduler_priority_SMP_Node_initialize, \ diff --git a/cpukit/include/rtems/score/schedulersimplesmp.h b/cpukit/include/rtems/score/schedulersimplesmp.h index 158bea74db..961e60ae73 100644 --- a/cpukit/include/rtems/score/schedulersimplesmp.h +++ b/cpukit/include/rtems/score/schedulersimplesmp.h @@ -75,8 +75,8 @@ typedef struct { _Scheduler_simple_SMP_Ask_for_help, \ _Scheduler_simple_SMP_Reconsider_help_request, \ _Scheduler_simple_SMP_Withdraw_node, \ - _Scheduler_default_Pin_or_unpin, \ - _Scheduler_default_Pin_or_unpin, \ + _Scheduler_default_Pin_or_unpin_not_supported, \ + _Scheduler_default_Pin_or_unpin_not_supported, \ _Scheduler_simple_SMP_Add_processor, \ _Scheduler_simple_SMP_Remove_processor, \ _Scheduler_simple_SMP_Node_initialize, \ diff --git a/cpukit/include/rtems/score/schedulerstrongapa.h b/cpukit/include/rtems/score/schedulerstrongapa.h index 9ee922d46d..a3a19d80c1 100644 --- a/cpukit/include/rtems/score/schedulerstrongapa.h +++ b/cpukit/include/rtems/score/schedulerstrongapa.h @@ -161,8 +161,8 @@ typedef struct { _Scheduler_strong_APA_Ask_for_help, \ _Scheduler_strong_APA_Reconsider_help_request, \ _Scheduler_strong_APA_Withdraw_node, \ - _Scheduler_default_Pin_or_unpin, \ - _Scheduler_default_Pin_or_unpin, \ + _Scheduler_default_Pin_or_unpin_not_supported, \ + _Scheduler_default_Pin_or_unpin_not_supported, \ _Scheduler_strong_APA_Add_processor, \ _Scheduler_strong_APA_Remove_processor, \ _Scheduler_strong_APA_Node_initialize, \ -- cgit v1.2.3