summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-12 10:32:32 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-20 10:14:04 +0200
commit9d83f58ab8208b49a4e27d4ff077cf526f902477 (patch)
tree93ef828f12d6edf27104fc4a313520f1649fec9a /cpukit/score
parentscore: Add _Priority_bit_map_Is_empty() (diff)
downloadrtems-9d83f58ab8208b49a4e27d4ff077cf526f902477.tar.bz2
smp: Replace Scheduler_simple_smp_Control
Replace Scheduler_simple_smp_Control with Scheduler_SMP_Control. Rename _Scheduler_simple_smp_Instance() to _Scheduler_SMP_Instance().
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/Makefile.am2
-rw-r--r--cpukit/score/include/rtems/score/schedulersimplesmp.h6
-rw-r--r--cpukit/score/include/rtems/score/schedulersmp.h51
-rw-r--r--cpukit/score/include/rtems/score/schedulersmpimpl.h52
-rw-r--r--cpukit/score/preinstall.am8
-rw-r--r--cpukit/score/src/schedulersimplesmp.c22
6 files changed, 123 insertions, 18 deletions
diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index c6954f62ec..5136d8119c 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -55,6 +55,8 @@ include_rtems_score_HEADERS += include/rtems/score/schedulerpriority.h
include_rtems_score_HEADERS += include/rtems/score/schedulerpriorityimpl.h
include_rtems_score_HEADERS += include/rtems/score/schedulersimple.h
include_rtems_score_HEADERS += include/rtems/score/schedulersimpleimpl.h
+include_rtems_score_HEADERS += include/rtems/score/schedulersmp.h
+include_rtems_score_HEADERS += include/rtems/score/schedulersmpimpl.h
include_rtems_score_HEADERS += include/rtems/score/smp.h
include_rtems_score_HEADERS += include/rtems/score/smplock.h
include_rtems_score_HEADERS += include/rtems/score/stack.h
diff --git a/cpukit/score/include/rtems/score/schedulersimplesmp.h b/cpukit/score/include/rtems/score/schedulersimplesmp.h
index 6cc87f3dec..5329610dee 100644
--- a/cpukit/score/include/rtems/score/schedulersimplesmp.h
+++ b/cpukit/score/include/rtems/score/schedulersimplesmp.h
@@ -25,6 +25,7 @@ extern "C" {
#include <rtems/score/scheduler.h>
#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/schedulersmp.h>
/**
* @defgroup ScoreSchedulerSMP Simple SMP Scheduler
@@ -48,11 +49,6 @@ extern "C" {
* @{
*/
-typedef struct {
- Chain_Control ready;
- Chain_Control scheduled;
-} Scheduler_simple_smp_Control;
-
/**
* @brief Entry points for the Simple SMP Scheduler.
*/
diff --git a/cpukit/score/include/rtems/score/schedulersmp.h b/cpukit/score/include/rtems/score/schedulersmp.h
new file mode 100644
index 0000000000..8b649b7331
--- /dev/null
+++ b/cpukit/score/include/rtems/score/schedulersmp.h
@@ -0,0 +1,51 @@
+/**
+ * @file
+ *
+ * @brief SMP Scheduler API
+ *
+ * @ingroup ScoreSchedulerSMP
+ */
+
+/*
+ * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifndef _RTEMS_SCORE_SCHEDULERSMP_H
+#define _RTEMS_SCORE_SCHEDULERSMP_H
+
+#include <rtems/score/chain.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @defgroup ScoreSchedulerSMP SMP Scheduler
+ *
+ * @ingroup ScoreScheduler
+ *
+ * @{
+ */
+
+typedef struct {
+ Chain_Control scheduled;
+ Chain_Control ready[ 1 ];
+} Scheduler_SMP_Control;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _RTEMS_SCORE_SCHEDULERSMP_H */
diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h
new file mode 100644
index 0000000000..7736d2bbf8
--- /dev/null
+++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h
@@ -0,0 +1,52 @@
+/**
+ * @file
+ *
+ * @brief SMP Scheduler Implementation
+ *
+ * @ingroup ScoreSchedulerSMP
+ */
+
+/*
+ * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifndef _RTEMS_SCORE_SCHEDULERSMPIMPL_H
+#define _RTEMS_SCORE_SCHEDULERSMPIMPL_H
+
+#include <rtems/score/schedulersmp.h>
+#include <rtems/score/scheduler.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/percpu.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @addtogroup ScoreSchedulerSMP
+ *
+ * @{
+ */
+
+static inline Scheduler_SMP_Control *_Scheduler_SMP_Instance( void )
+{
+ return _Scheduler.information;
+}
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _RTEMS_SCORE_SCHEDULERSMPIMPL_H */
diff --git a/cpukit/score/preinstall.am b/cpukit/score/preinstall.am
index 14d873ce4c..4e645f4b48 100644
--- a/cpukit/score/preinstall.am
+++ b/cpukit/score/preinstall.am
@@ -203,6 +203,14 @@ $(PROJECT_INCLUDE)/rtems/score/schedulersimpleimpl.h: include/rtems/score/schedu
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulersimpleimpl.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulersimpleimpl.h
+$(PROJECT_INCLUDE)/rtems/score/schedulersmp.h: include/rtems/score/schedulersmp.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulersmp.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulersmp.h
+
+$(PROJECT_INCLUDE)/rtems/score/schedulersmpimpl.h: include/rtems/score/schedulersmpimpl.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulersmpimpl.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulersmpimpl.h
+
$(PROJECT_INCLUDE)/rtems/score/smp.h: include/rtems/score/smp.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/smp.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/smp.h
diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c
index e26151025c..090572302e 100644
--- a/cpukit/score/src/schedulersimplesmp.c
+++ b/cpukit/score/src/schedulersimplesmp.c
@@ -20,19 +20,15 @@
#include <rtems/score/schedulersimplesmp.h>
#include <rtems/score/schedulersimpleimpl.h>
+#include <rtems/score/schedulersmpimpl.h>
#include <rtems/score/wkspace.h>
-static Scheduler_simple_smp_Control *_Scheduler_simple_smp_Instance( void )
-{
- return _Scheduler.information;
-}
-
void _Scheduler_simple_smp_Initialize( void )
{
- Scheduler_simple_smp_Control *self =
+ Scheduler_SMP_Control *self =
_Workspace_Allocate_or_fatal_error( sizeof( *self ) );
- _Chain_Initialize_empty( &self->ready );
+ _Chain_Initialize_empty( &self->ready[ 0 ] );
_Chain_Initialize_empty( &self->scheduled );
_Scheduler.information = self;
@@ -112,7 +108,7 @@ static void _Scheduler_simple_smp_Enqueue_ordered(
Chain_Node_order order
)
{
- Scheduler_simple_smp_Control *self = _Scheduler_simple_smp_Instance();
+ Scheduler_SMP_Control *self = _Scheduler_SMP_Instance();
/*
* The scheduled chain has exactly processor count nodes after
@@ -127,11 +123,11 @@ static void _Scheduler_simple_smp_Enqueue_ordered(
_Scheduler_simple_smp_Insert( &self->scheduled, thread, order );
_Scheduler_simple_smp_Move_from_scheduled_to_ready(
- &self->ready,
+ &self->ready[ 0 ],
lowest_scheduled
);
} else {
- _Scheduler_simple_smp_Insert( &self->ready, thread, order );
+ _Scheduler_simple_smp_Insert( &self->ready[ 0 ], thread, order );
}
}
@@ -153,13 +149,13 @@ void _Scheduler_simple_smp_Enqueue_priority_fifo( Thread_Control *thread )
void _Scheduler_simple_smp_Extract( Thread_Control *thread )
{
- Scheduler_simple_smp_Control *self = _Scheduler_simple_smp_Instance();
+ Scheduler_SMP_Control *self = _Scheduler_SMP_Instance();
_Chain_Extract_unprotected( &thread->Object.Node );
if ( thread->is_scheduled ) {
Thread_Control *highest_ready =
- (Thread_Control *) _Chain_First( &self->ready );
+ (Thread_Control *) _Chain_First( &self->ready[ 0 ] );
_Scheduler_simple_smp_Allocate_processor( highest_ready, thread );
@@ -192,7 +188,7 @@ void _Scheduler_simple_smp_Start_idle(
Per_CPU_Control *cpu
)
{
- Scheduler_simple_smp_Control *self = _Scheduler_simple_smp_Instance();
+ Scheduler_SMP_Control *self = _Scheduler_SMP_Instance();
thread->is_scheduled = true;
thread->cpu = cpu;