summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-03 10:29:30 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-06-04 08:37:06 +0200
commit8e46738436b18d0f1a9424a95b678ab1596cb092 (patch)
tree252be226da9107952a87628fd4e5265df603c167 /cpukit/score/src
parentsptests/spsem03: New test (diff)
downloadrtems-8e46738436b18d0f1a9424a95b678ab1596cb092.tar.bz2
score: Replace _Scheduler_Allocate/Free()
Replace _Scheduler_Allocate() with _Scheduler_Node_initialize(). Remove the return status and thus the node initialization must be always successful. Rename _Scheduler_Free() to _Scheduler_Node_destroy().
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/schedulercbsnodeinit.c (renamed from cpukit/score/src/schedulercbsallocate.c)6
-rw-r--r--cpukit/score/src/schedulerdefaultnodedestroy.c (renamed from cpukit/score/src/schedulerdefaultallocatefree.c)19
-rw-r--r--cpukit/score/src/schedulerdefaultnodeinit.c31
-rw-r--r--cpukit/score/src/scheduleredfnodeinit.c (renamed from cpukit/score/src/scheduleredfallocate.c)4
-rw-r--r--cpukit/score/src/schedulerpriorityaffinitysmp.c4
-rw-r--r--cpukit/score/src/schedulerprioritysmp.c4
-rw-r--r--cpukit/score/src/schedulersimplesmp.c4
-rw-r--r--cpukit/score/src/threadinitialize.c12
-rw-r--r--cpukit/score/src/threadrestart.c2
9 files changed, 47 insertions, 39 deletions
diff --git a/cpukit/score/src/schedulercbsallocate.c b/cpukit/score/src/schedulercbsnodeinit.c
index 6a29088eb6..b76380fcad 100644
--- a/cpukit/score/src/schedulercbsallocate.c
+++ b/cpukit/score/src/schedulercbsnodeinit.c
@@ -20,9 +20,9 @@
#include <rtems/score/schedulercbsimpl.h>
-bool _Scheduler_CBS_Allocate(
+void _Scheduler_CBS_Node_initialize(
const Scheduler_Control *scheduler,
- Thread_Control *the_thread
+ Thread_Control *the_thread
)
{
Scheduler_CBS_Node *node = _Scheduler_CBS_Node_get( the_thread );
@@ -32,6 +32,4 @@ bool _Scheduler_CBS_Allocate(
node->Base.thread = the_thread;
node->Base.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
node->cbs_server = NULL;
-
- return true;
}
diff --git a/cpukit/score/src/schedulerdefaultallocatefree.c b/cpukit/score/src/schedulerdefaultnodedestroy.c
index c865385dfb..d1d84f366a 100644
--- a/cpukit/score/src/schedulerdefaultallocatefree.c
+++ b/cpukit/score/src/schedulerdefaultnodedestroy.c
@@ -1,7 +1,7 @@
/**
* @file
*
- * @brief Scheduler Default Allocate and Release Operation
+ * @brief Scheduler Default Node Destruction Operation
*
* @ingroup ScoreScheduler
*/
@@ -21,22 +21,11 @@
#include <rtems/score/scheduler.h>
-bool _Scheduler_default_Allocate(
+void _Scheduler_default_Node_destroy(
const Scheduler_Control *scheduler,
Thread_Control *the_thread
)
{
- ( void ) scheduler;
- ( void ) the_thread;
-
- return true;
-}
-
-void _Scheduler_default_Free(
- const Scheduler_Control *scheduler,
- Thread_Control *the_thread
-)
-{
- ( void ) scheduler;
- ( void ) the_thread;
+ (void) scheduler;
+ (void) the_thread;
}
diff --git a/cpukit/score/src/schedulerdefaultnodeinit.c b/cpukit/score/src/schedulerdefaultnodeinit.c
new file mode 100644
index 0000000000..ab371bd7fe
--- /dev/null
+++ b/cpukit/score/src/schedulerdefaultnodeinit.c
@@ -0,0 +1,31 @@
+/**
+ * @file
+ *
+ * @brief Scheduler Default Node Initialization Operation
+ *
+ * @ingroup ScoreScheduler
+ */
+
+/*
+ * COPYRIGHT (c) 2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * 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/scheduler.h>
+
+void _Scheduler_default_Node_initialize(
+ const Scheduler_Control *scheduler,
+ Thread_Control *the_thread
+)
+{
+ (void) scheduler;
+ (void) the_thread;
+}
diff --git a/cpukit/score/src/scheduleredfallocate.c b/cpukit/score/src/scheduleredfnodeinit.c
index f9aaa57b8a..031feb08f2 100644
--- a/cpukit/score/src/scheduleredfallocate.c
+++ b/cpukit/score/src/scheduleredfnodeinit.c
@@ -20,7 +20,7 @@
#include <rtems/score/scheduleredfimpl.h>
-bool _Scheduler_EDF_Allocate(
+void _Scheduler_EDF_Node_initialize(
const Scheduler_Control *scheduler,
Thread_Control *the_thread
)
@@ -31,6 +31,4 @@ bool _Scheduler_EDF_Allocate(
node->thread = the_thread;
node->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN;
-
- return true;
}
diff --git a/cpukit/score/src/schedulerpriorityaffinitysmp.c b/cpukit/score/src/schedulerpriorityaffinitysmp.c
index 0d9525d894..317d8ce32d 100644
--- a/cpukit/score/src/schedulerpriorityaffinitysmp.c
+++ b/cpukit/score/src/schedulerpriorityaffinitysmp.c
@@ -32,7 +32,7 @@ _Scheduler_priority_affinity_Node_get( Thread_Control *thread )
_Scheduler_Node_get( thread );
}
-bool _Scheduler_priority_affinity_SMP_Allocate(
+void _Scheduler_priority_affinity_SMP_Node_initialize(
const Scheduler_Control *scheduler,
Thread_Control *the_thread
)
@@ -44,8 +44,6 @@ bool _Scheduler_priority_affinity_SMP_Allocate(
node->Affinity = *_CPU_set_Default();
node->Affinity.set = &node->Affinity.preallocated;
-
- return true;
}
bool _Scheduler_priority_affinity_SMP_Get_affinity(
diff --git a/cpukit/score/src/schedulerprioritysmp.c b/cpukit/score/src/schedulerprioritysmp.c
index 56bb0ac91b..e0ed75c477 100644
--- a/cpukit/score/src/schedulerprioritysmp.c
+++ b/cpukit/score/src/schedulerprioritysmp.c
@@ -64,7 +64,7 @@ void _Scheduler_priority_SMP_Initialize( const Scheduler_Control *scheduler )
_Scheduler_priority_Ready_queue_initialize( &self->Ready[ 0 ] );
}
-bool _Scheduler_priority_SMP_Allocate(
+void _Scheduler_priority_SMP_Node_initialize(
const Scheduler_Control *scheduler,
Thread_Control *thread
)
@@ -72,8 +72,6 @@ bool _Scheduler_priority_SMP_Allocate(
Scheduler_SMP_Node *node = _Scheduler_SMP_Node_get( thread );
_Scheduler_SMP_Node_initialize( node );
-
- return true;
}
static void _Scheduler_priority_SMP_Do_update(
diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c
index d5d3908f30..029da67b7a 100644
--- a/cpukit/score/src/schedulersimplesmp.c
+++ b/cpukit/score/src/schedulersimplesmp.c
@@ -42,7 +42,7 @@ void _Scheduler_simple_SMP_Initialize( const Scheduler_Control *scheduler )
_Chain_Initialize_empty( &self->Ready );
}
-bool _Scheduler_simple_SMP_Allocate(
+void _Scheduler_simple_SMP_Node_initialize(
const Scheduler_Control *scheduler,
Thread_Control *the_thread
)
@@ -50,8 +50,6 @@ bool _Scheduler_simple_SMP_Allocate(
Scheduler_SMP_Node *node = _Scheduler_SMP_Node_get( the_thread );
_Scheduler_SMP_Node_initialize( node );
-
- return true;
}
static void _Scheduler_simple_SMP_Do_update(
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index 9c65d73586..2a79549848 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -52,7 +52,7 @@ bool _Thread_Initialize(
#endif
bool extension_status;
size_t i;
- bool scheduler_allocated = false;
+ bool scheduler_node_initialized = false;
Per_CPU_Control *cpu = _Per_CPU_Get_by_index( 0 );
#if defined( RTEMS_SMP )
@@ -198,10 +198,8 @@ bool _Thread_Initialize(
the_thread->real_priority = priority;
the_thread->Start.initial_priority = priority;
- scheduler_allocated = _Scheduler_Allocate( scheduler, the_thread );
- if ( !scheduler_allocated ) {
- goto failed;
- }
+ _Scheduler_Node_initialize( scheduler, the_thread );
+ scheduler_node_initialized = true;
_Thread_Set_priority( the_thread, priority );
@@ -246,8 +244,8 @@ bool _Thread_Initialize(
failed:
- if ( scheduler_allocated ) {
- _Scheduler_Free( scheduler, the_thread );
+ if ( scheduler_node_initialized ) {
+ _Scheduler_Node_destroy( scheduler, the_thread );
}
_Workspace_Free( the_thread->Start.tls_area );
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index c65ef9a21b..92470e5e35 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -71,7 +71,7 @@ static void _Thread_Free( Thread_Control *the_thread )
/*
* Free the per-thread scheduling information.
*/
- _Scheduler_Free( _Scheduler_Get( the_thread ), the_thread );
+ _Scheduler_Node_destroy( _Scheduler_Get( the_thread ), the_thread );
/*
* The thread might have been FP. So deal with that.