[rtems commit] score: Add and use _Scheduler_SMP_Start_idle()
Sebastian Huber
sebh at rtems.org
Thu May 15 11:10:48 UTC 2014
Module: rtems
Branch: master
Commit: 6359b68afebf75608bd7f05dc6cddd957c4ba9ca
Changeset: http://git.rtems.org/rtems/commit/?id=6359b68afebf75608bd7f05dc6cddd957c4ba9ca
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Thu May 15 08:47:50 2014 +0200
score: Add and use _Scheduler_SMP_Start_idle()
---
cpukit/score/Makefile.am | 1 +
.../rtems/score/schedulerpriorityaffinitysmp.h | 2 +-
.../include/rtems/score/schedulerprioritysmp.h | 8 +-----
.../score/include/rtems/score/schedulersimplesmp.h | 8 +-----
cpukit/score/include/rtems/score/schedulersmp.h | 6 ++++
.../score/include/rtems/score/schedulersmpimpl.h | 15 ----------
cpukit/score/src/schedulerprioritysmp.c | 11 -------
cpukit/score/src/schedulersimplesmp.c | 11 -------
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 7968f02..200d11d 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 6b66504..55271dc 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 267a488..1030b9f 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 70f0336..6c4d421 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 db8798d..c71cc86 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 365edbb..3650e4c 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 0c02b44..956b7cf 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 88f301a..a743cf9 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 0000000..420bcc0
--- /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 );
+}
More information about the vc
mailing list