diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-05-15 08:47:50 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-05-15 12:18:49 +0200 |
commit | 6359b68afebf75608bd7f05dc6cddd957c4ba9ca (patch) | |
tree | 99afe5c5f5d89ab1dcf53ecaea9e98d47643a692 | |
parent | score: Add and use _Scheduler_default_Schedule() (diff) | |
download | rtems-6359b68afebf75608bd7f05dc6cddd957c4ba9ca.tar.bz2 |
score: Add and use _Scheduler_SMP_Start_idle()
-rw-r--r-- | cpukit/score/Makefile.am | 1 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h | 2 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/schedulerprioritysmp.h | 8 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/schedulersimplesmp.h | 8 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/schedulersmp.h | 6 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/schedulersmpimpl.h | 15 | ||||
-rw-r--r-- | cpukit/score/src/schedulerprioritysmp.c | 11 | ||||
-rw-r--r-- | cpukit/score/src/schedulersimplesmp.c | 11 | ||||
-rw-r--r-- | cpukit/score/src/schedulersmpstartidle.c | 29 |
9 files changed, 39 insertions, 52 deletions
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am index 7968f0261c..200d11d9c8 100644 --- a/cpukit/score/Makefile.am +++ b/cpukit/score/Makefile.am @@ -136,6 +136,7 @@ libscore_a_SOURCES += src/cpuset.c libscore_a_SOURCES += src/cpusetprintsupport.c libscore_a_SOURCES += src/schedulerdefaultgetaffinity.c libscore_a_SOURCES += src/schedulerdefaultsetaffinity.c +libscore_a_SOURCES += src/schedulersmpstartidle.c endif ## CORE_APIMUTEX_C_FILES diff --git a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h index 6b66504793..55271dcf0e 100644 --- a/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h +++ b/cpukit/score/include/rtems/score/schedulerpriorityaffinitysmp.h @@ -61,7 +61,7 @@ extern "C" { _Scheduler_priority_Priority_compare, \ _Scheduler_default_Release_job, \ _Scheduler_default_Tick, \ - _Scheduler_priority_SMP_Start_idle, \ + _Scheduler_SMP_Start_idle, \ _Scheduler_priority_affinity_SMP_Get_affinity, \ _Scheduler_priority_affinity_SMP_Set_affinity \ } diff --git a/cpukit/score/include/rtems/score/schedulerprioritysmp.h b/cpukit/score/include/rtems/score/schedulerprioritysmp.h index 267a488e14..1030b9fac0 100644 --- a/cpukit/score/include/rtems/score/schedulerprioritysmp.h +++ b/cpukit/score/include/rtems/score/schedulerprioritysmp.h @@ -90,7 +90,7 @@ typedef struct { _Scheduler_priority_Priority_compare, \ _Scheduler_default_Release_job, \ _Scheduler_default_Tick, \ - _Scheduler_priority_SMP_Start_idle, \ + _Scheduler_SMP_Start_idle, \ _Scheduler_default_Get_affinity, \ _Scheduler_default_Set_affinity \ } @@ -129,12 +129,6 @@ void _Scheduler_priority_SMP_Yield( Thread_Control *thread ); -void _Scheduler_priority_SMP_Start_idle( - const Scheduler_Control *scheduler, - Thread_Control *thread, - Per_CPU_Control *cpu -); - /** @} */ #ifdef __cplusplus diff --git a/cpukit/score/include/rtems/score/schedulersimplesmp.h b/cpukit/score/include/rtems/score/schedulersimplesmp.h index 70f0336de4..6c4d421ed7 100644 --- a/cpukit/score/include/rtems/score/schedulersimplesmp.h +++ b/cpukit/score/include/rtems/score/schedulersimplesmp.h @@ -71,7 +71,7 @@ typedef struct { _Scheduler_priority_Priority_compare, \ _Scheduler_default_Release_job, \ _Scheduler_default_Tick, \ - _Scheduler_simple_SMP_Start_idle, \ + _Scheduler_SMP_Start_idle, \ _Scheduler_default_Get_affinity, \ _Scheduler_default_Set_affinity \ } @@ -105,12 +105,6 @@ void _Scheduler_simple_SMP_Yield( Thread_Control *thread ); -void _Scheduler_simple_SMP_Start_idle( - const Scheduler_Control *scheduler, - Thread_Control *thread, - Per_CPU_Control *cpu -); - /** @} */ #ifdef __cplusplus diff --git a/cpukit/score/include/rtems/score/schedulersmp.h b/cpukit/score/include/rtems/score/schedulersmp.h index db8798dcd0..c71cc86c0c 100644 --- a/cpukit/score/include/rtems/score/schedulersmp.h +++ b/cpukit/score/include/rtems/score/schedulersmp.h @@ -98,6 +98,12 @@ typedef struct { Scheduler_SMP_Node_state state; } Scheduler_SMP_Node; +void _Scheduler_SMP_Start_idle( + const Scheduler_Control *scheduler, + Thread_Control *thread, + Per_CPU_Control *cpu +); + /** @} */ #ifdef __cplusplus diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h index 365edbb845..3650e4c742 100644 --- a/cpukit/score/include/rtems/score/schedulersmpimpl.h +++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h @@ -620,21 +620,6 @@ static inline void _Scheduler_SMP_Insert_scheduled_fifo( ); } -static inline void _Scheduler_SMP_Start_idle( - Scheduler_Context *context, - Thread_Control *thread, - Per_CPU_Control *cpu -) -{ - Scheduler_SMP_Context *self = _Scheduler_SMP_Get_self( context ); - Scheduler_SMP_Node *node = _Scheduler_SMP_Node_get( thread ); - - node->state = SCHEDULER_SMP_NODE_SCHEDULED; - - _Thread_Set_CPU( thread, cpu ); - _Chain_Append_unprotected( &self->Scheduled, &thread->Object.Node ); -} - /** @} */ #ifdef __cplusplus diff --git a/cpukit/score/src/schedulerprioritysmp.c b/cpukit/score/src/schedulerprioritysmp.c index 0c02b4433e..956b7cf90f 100644 --- a/cpukit/score/src/schedulerprioritysmp.c +++ b/cpukit/score/src/schedulerprioritysmp.c @@ -325,14 +325,3 @@ void _Scheduler_priority_SMP_Yield( _ISR_Enable( level ); } - -void _Scheduler_priority_SMP_Start_idle( - const Scheduler_Control *scheduler, - Thread_Control *thread, - Per_CPU_Control *cpu -) -{ - Scheduler_Context *context = _Scheduler_Get_context( scheduler ); - - _Scheduler_SMP_Start_idle( context, thread, cpu ); -} diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c index 88f301a62c..a743cf9fff 100644 --- a/cpukit/score/src/schedulersimplesmp.c +++ b/cpukit/score/src/schedulersimplesmp.c @@ -261,14 +261,3 @@ void _Scheduler_simple_SMP_Yield( _ISR_Enable( level ); } - -void _Scheduler_simple_SMP_Start_idle( - const Scheduler_Control *scheduler, - Thread_Control *thread, - Per_CPU_Control *cpu -) -{ - Scheduler_Context *context = _Scheduler_Get_context( scheduler ); - - _Scheduler_SMP_Start_idle( context, thread, cpu ); -} diff --git a/cpukit/score/src/schedulersmpstartidle.c b/cpukit/score/src/schedulersmpstartidle.c new file mode 100644 index 0000000000..420bcc018e --- /dev/null +++ b/cpukit/score/src/schedulersmpstartidle.c @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2013-2014 embedded brains GmbH + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#if HAVE_CONFIG_H + #include "config.h" +#endif + +#include <rtems/score/schedulersmpimpl.h> + +void _Scheduler_SMP_Start_idle( + const Scheduler_Control *scheduler, + Thread_Control *thread, + Per_CPU_Control *cpu +) +{ + Scheduler_Context *context = _Scheduler_Get_context( scheduler ); + Scheduler_SMP_Context *self = _Scheduler_SMP_Get_self( context ); + Scheduler_SMP_Node *node = _Scheduler_SMP_Node_get( thread ); + + node->state = SCHEDULER_SMP_NODE_SCHEDULED; + + _Thread_Set_CPU( thread, cpu ); + _Chain_Append_unprotected( &self->Scheduled, &thread->Object.Node ); +} |