score: Add and use _Scheduler_SMP_Start_idle()

This commit is contained in:
Sebastian Huber
2014-05-15 12:18:49 +02:00
parent 3733b22410
commit 6359b68afe
9 changed files with 39 additions and 52 deletions
+1
View File
@@ -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
@@ -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 \
}
@@ -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
@@ -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
@@ -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
@@ -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
-11
View File
@@ -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 );
}
-11
View File
@@ -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 );
}
+29
View File
@@ -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 );
}