[rtems commit] score: Rename _Scheduler_simple_Allocate(), etc.

Sebastian Huber sebh at rtems.org
Thu Aug 8 12:11:18 UTC 2013


Module:    rtems
Branch:    master
Commit:    62d947d368e078dba583dfae8b26ae43f960a625
Changeset: http://git.rtems.org/rtems/commit/?id=62d947d368e078dba583dfae8b26ae43f960a625

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Aug  7 11:50:32 2013 +0200

score: Rename _Scheduler_simple_Allocate(), etc.

Rename _Scheduler_simple_Allocate() in _Scheduler_default_Allocate().
Rename _Scheduler_simple_Free() in _Scheduler_default_Free().

---

 cpukit/score/Makefile.am                           |    1 +
 cpukit/score/include/rtems/score/scheduler.h       |   20 ++++++++++
 cpukit/score/include/rtems/score/schedulersimple.h |   33 +----------------
 .../score/include/rtems/score/schedulersimplesmp.h |    4 +-
 cpukit/score/src/schedulerdefaultallocatefree.c    |   38 ++++++++++++++++++++
 cpukit/score/src/schedulersimple.c                 |   13 -------
 6 files changed, 63 insertions(+), 46 deletions(-)

diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index 609772c..d27ce3a 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -179,6 +179,7 @@ libscore_a_SOURCES += src/objectallocate.c src/objectclose.c \
 
 ## SCHEDULER_C_FILES
 libscore_a_SOURCES += src/scheduler.c
+libscore_a_SOURCES += src/schedulerdefaultallocatefree.c
 libscore_a_SOURCES += src/schedulerdefaultreleasejob.c
 libscore_a_SOURCES += src/schedulerdefaulttick.c
 libscore_a_SOURCES += src/schedulerdefaultstartidle.c
diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h
index 1b2ac8f..deefd9d 100644
--- a/cpukit/score/include/rtems/score/scheduler.h
+++ b/cpukit/score/include/rtems/score/scheduler.h
@@ -126,6 +126,26 @@ typedef struct {
 extern Scheduler_Control  _Scheduler;
 
 /**
+ * @brief Returns an arbitrary non-NULL value.
+ *
+ * @param[in] thread Unused.
+ *
+ * @return An arbitrary non-NULL value.
+ */
+void *_Scheduler_default_Allocate(
+  Thread_Control *thread
+);
+
+/**
+ * @brief Does nothing.
+ *
+ * @param[in] thread Unused.
+ */
+void _Scheduler_default_Free(
+  Thread_Control *thread
+);
+
+/**
  * @brief Does nothing.
  *
  * @param[in] thread Unused.
diff --git a/cpukit/score/include/rtems/score/schedulersimple.h b/cpukit/score/include/rtems/score/schedulersimple.h
index b4f7345..97c9e84 100644
--- a/cpukit/score/include/rtems/score/schedulersimple.h
+++ b/cpukit/score/include/rtems/score/schedulersimple.h
@@ -42,8 +42,8 @@ extern "C" {
     _Scheduler_simple_Yield,              /* yield entry point */ \
     _Scheduler_simple_Block,              /* block entry point */ \
     _Scheduler_simple_Unblock,            /* unblock entry point */ \
-    _Scheduler_simple_Allocate,           /* allocate entry point */ \
-    _Scheduler_simple_Free,               /* free entry point */ \
+    _Scheduler_default_Allocate,          /* allocate entry point */ \
+    _Scheduler_default_Free,              /* free entry point */ \
     _Scheduler_simple_Update,             /* update entry point */ \
     _Scheduler_simple_Enqueue,            /* enqueue entry point */ \
     _Scheduler_simple_Enqueue_first,      /* enqueue_first entry point */ \
@@ -150,23 +150,6 @@ void _Scheduler_simple_Enqueue_first(
 );
 
 /**
- *  @brief Return empty placeholder for the simple scheduler.
- *
- *  This routine is a place holder for any memeory allocation needed
- *  by the scheduler.  For the simple scheduler the routine is an empty
- *  place holder.
- *
- *  @param[in] the_thread is the thread the scheduler is allocating
- *             management memory for
- *
- *  @retval this routine returns -1 since this is just an empty placeholder
- *  and the return value may be defined differently by each scheduler.
- */
-void *_Scheduler_simple_Allocate(
-  Thread_Control *the_thread
-);
-
-/**
  *  @brief Stub for simple schedule update.
  *
  *  This routine does nothing, and is used as a stub for Schedule update
@@ -179,18 +162,6 @@ void _Scheduler_simple_Update(
 );
 
 /**
- *  @brief Stub for simple schedule free.
- *
- *  This routine does nothing, and is used as a stub for Schedule free
- *  The overhead of a function call will still be imposed.
- *
- *  @param[in] the_thread is the thread to be blocked
- */
-void _Scheduler_simple_Free(
-  Thread_Control *the_thread
-);
-
-/**
  *  _Scheduler_simple_Ready_queue_enqueue
  *
  *  This routine puts @a the_thread on the ready queue
diff --git a/cpukit/score/include/rtems/score/schedulersimplesmp.h b/cpukit/score/include/rtems/score/schedulersimplesmp.h
index c21b9d4..20462eb 100644
--- a/cpukit/score/include/rtems/score/schedulersimplesmp.h
+++ b/cpukit/score/include/rtems/score/schedulersimplesmp.h
@@ -64,8 +64,8 @@ typedef struct {
     _Scheduler_simple_smp_Yield, \
     _Scheduler_simple_smp_Extract, \
     _Scheduler_simple_smp_Enqueue_priority_fifo, \
-    _Scheduler_simple_Allocate, \
-    _Scheduler_simple_Free, \
+    _Scheduler_default_Allocate, \
+    _Scheduler_default_Free, \
     _Scheduler_simple_Update, \
     _Scheduler_simple_smp_Enqueue_priority_fifo, \
     _Scheduler_simple_smp_Enqueue_priority_lifo, \
diff --git a/cpukit/score/src/schedulerdefaultallocatefree.c b/cpukit/score/src/schedulerdefaultallocatefree.c
new file mode 100644
index 0000000..37f0981
--- /dev/null
+++ b/cpukit/score/src/schedulerdefaultallocatefree.c
@@ -0,0 +1,38 @@
+/**
+ * @file
+ *
+ * @brief Scheduler Default Allocate and Release 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.com/license/LICENSE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/scheduler.h>
+
+void *_Scheduler_default_Allocate(
+  Thread_Control *thread
+)
+{
+  ( void ) thread;
+
+  return ( void * )-1; /* maybe pick an appropriate poison value */
+}
+
+void _Scheduler_default_Free(
+  Thread_Control *thread
+)
+{
+  ( void ) thread;
+}
diff --git a/cpukit/score/src/schedulersimple.c b/cpukit/score/src/schedulersimple.c
index 84ffb74..bd6fe31 100644
--- a/cpukit/score/src/schedulersimple.c
+++ b/cpukit/score/src/schedulersimple.c
@@ -23,25 +23,12 @@
 #include <rtems/score/chainimpl.h>
 #include <rtems/score/wkspace.h>
 
-void * _Scheduler_simple_Allocate(
-  Thread_Control *the_thread
-)
-{
-  return (void*)-1; /* maybe pick an appropriate poison value */
-}
-
 void _Scheduler_simple_Update(
   Thread_Control *the_thread
 )
 {
 }
 
-void _Scheduler_simple_Free(
-  Thread_Control *the_thread
-)
-{
-}
-
 void _Scheduler_simple_Initialize ( void )
 {
   void *f;




More information about the vc mailing list