[PATCH 1/4] score: Add scheduler name

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Apr 9 11:28:47 UTC 2014


---
 cpukit/sapi/include/confdefs.h               |   45 ++++++++++++++++++++++----
 cpukit/sapi/include/rtems/scheduler.h        |   35 ++++++++++++--------
 cpukit/score/include/rtems/score/scheduler.h |    5 +++
 doc/user/conf.t                              |   35 ++++++++++++++++++++
 4 files changed, 99 insertions(+), 21 deletions(-)

diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
index 2a37474..81f9c26 100644
--- a/cpukit/sapi/include/confdefs.h
+++ b/cpukit/sapi/include/confdefs.h
@@ -666,6 +666,10 @@ const rtems_libio_helper rtems_fs_init_helper =
  * If the Priority Scheduler is selected, then configure for it.
  */
 #if defined(CONFIGURE_SCHEDULER_PRIORITY)
+  #if !defined(CONFIGURE_SCHEDULER_NAME)
+    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('P', 'R', 'I', 'O')
+  #endif
+
   #define CONFIGURE_SCHEDULER_CONTEXT \
     RTEMS_SCHEDULER_CONTEXT_PRIORITY( \
       dflt, \
@@ -673,7 +677,7 @@ const rtems_libio_helper rtems_fs_init_helper =
     )
 
   #define CONFIGURE_SCHEDULER_CONTROL \
-    RTEMS_SCHEDULER_CONTROL_PRIORITY(dflt)
+    RTEMS_SCHEDULER_CONTROL_PRIORITY(dflt, CONFIGURE_SCHEDULER_NAME)
 #endif
 
 /*
@@ -681,6 +685,10 @@ const rtems_libio_helper rtems_fs_init_helper =
  * it.
  */
 #if defined(CONFIGURE_SCHEDULER_PRIORITY_SMP)
+  #if !defined(CONFIGURE_SCHEDULER_NAME)
+    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('P', 'R', 'I', 'O')
+  #endif
+
   #define CONFIGURE_SCHEDULER_CONTEXT \
     RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP( \
       dflt, \
@@ -688,7 +696,7 @@ const rtems_libio_helper rtems_fs_init_helper =
     )
 
   #define CONFIGURE_SCHEDULER_CONTROL \
-    RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP(dflt)
+    RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP(dflt, CONFIGURE_SCHEDULER_NAME)
 #endif
 
 /*
@@ -696,6 +704,10 @@ const rtems_libio_helper rtems_fs_init_helper =
  * it.
  */
 #if defined(CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP)
+  #if !defined(CONFIGURE_SCHEDULER_NAME)
+    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('P', 'A', 'F', 'F')
+  #endif
+
   #define CONFIGURE_SCHEDULER_CONTEXT \
     RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP( \
       dflt, \
@@ -703,45 +715,64 @@ const rtems_libio_helper rtems_fs_init_helper =
     )
 
   #define CONFIGURE_SCHEDULER_CONTROL \
-    RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP(dflt)
+    RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP(dflt, CONFIGURE_SCHEDULER_NAME)
 #endif
 
 /*
  * If the Simple Priority Scheduler is selected, then configure for it.
  */
 #if defined(CONFIGURE_SCHEDULER_SIMPLE)
+  #if !defined(CONFIGURE_SCHEDULER_NAME)
+    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('S', 'I', 'M', 'P')
+  #endif
+
   #define CONFIGURE_SCHEDULER_CONTEXT RTEMS_SCHEDULER_CONTEXT_SIMPLE(dflt)
 
-  #define CONFIGURE_SCHEDULER_CONTROL RTEMS_SCHEDULER_CONTROL_SIMPLE(dflt)
+  #define CONFIGURE_SCHEDULER_CONTROL \
+    RTEMS_SCHEDULER_CONTROL_SIMPLE(dflt, CONFIGURE_SCHEDULER_NAME)
 #endif
 
 /*
  * If the Simple SMP Priority Scheduler is selected, then configure for it.
  */
 #if defined(CONFIGURE_SCHEDULER_SIMPLE_SMP)
+  #if !defined(CONFIGURE_SCHEDULER_NAME)
+    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('P', 'S', 'I', 'M')
+  #endif
+
   #define CONFIGURE_SCHEDULER_CONTEXT \
     RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(dflt)
 
   #define CONFIGURE_SCHEDULER_CONTROL \
-    RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(dflt)
+    RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(dflt, CONFIGURE_SCHEDULER_NAME)
 #endif
 
 /*
  * If the EDF Scheduler is selected, then configure for it.
  */
 #if defined(CONFIGURE_SCHEDULER_EDF)
+  #if !defined(CONFIGURE_SCHEDULER_NAME)
+    #define CONFIGURE_SCHEDULER_NAME rtems_build_name(' ', 'E', 'D', 'F')
+  #endif
+
   #define CONFIGURE_SCHEDULER_CONTEXT RTEMS_SCHEDULER_CONTEXT_EDF(dflt)
 
-  #define CONFIGURE_SCHEDULER_CONTROL RTEMS_SCHEDULER_CONTROL_EDF(dflt)
+  #define CONFIGURE_SCHEDULER_CONTROL \
+    RTEMS_SCHEDULER_CONTROL_EDF(dflt, CONFIGURE_SCHEDULER_NAME)
 #endif
 
 /*
  * If the CBS Scheduler is selected, then configure for it.
  */
 #if defined(CONFIGURE_SCHEDULER_CBS)
+  #if !defined(CONFIGURE_SCHEDULER_NAME)
+    #define CONFIGURE_SCHEDULER_NAME rtems_build_name(' ', 'C', 'B', 'S')
+  #endif
+
   #define CONFIGURE_SCHEDULER_CONTEXT RTEMS_SCHEDULER_CONTEXT_CBS(dflt)
 
-  #define CONFIGURE_SCHEDULER_CONTROL RTEMS_SCHEDULER_CONTROL_CBS(dflt)
+  #define CONFIGURE_SCHEDULER_CONTROL \
+    RTEMS_SCHEDULER_CONTROL_CBS(dflt, CONFIGURE_SCHEDULER_NAME)
 
   #ifndef CONFIGURE_CBS_MAXIMUM_SERVERS
     #define CONFIGURE_CBS_MAXIMUM_SERVERS CONFIGURE_MAXIMUM_TASKS
diff --git a/cpukit/sapi/include/rtems/scheduler.h b/cpukit/sapi/include/rtems/scheduler.h
index 5d6b2ec..06824e9 100644
--- a/cpukit/sapi/include/rtems/scheduler.h
+++ b/cpukit/sapi/include/rtems/scheduler.h
@@ -43,10 +43,11 @@
   #define RTEMS_SCHEDULER_CONTEXT_CBS( name ) \
     static Scheduler_EDF_Context RTEMS_SCHEDULER_CONTEXT_CBS_NAME( name )
 
-  #define RTEMS_SCHEDULER_CONTROL_CBS( name ) \
+  #define RTEMS_SCHEDULER_CONTROL_CBS( name, obj_name ) \
     { \
       &RTEMS_SCHEDULER_CONTEXT_CBS_NAME( name ).Base, \
-      SCHEDULER_CBS_ENTRY_POINTS \
+      SCHEDULER_CBS_ENTRY_POINTS, \
+      ( obj_name ) \
     }
 #endif
 
@@ -59,10 +60,11 @@
   #define RTEMS_SCHEDULER_CONTEXT_EDF( name ) \
     static Scheduler_EDF_Context RTEMS_SCHEDULER_CONTEXT_EDF_NAME( name )
 
-  #define RTEMS_SCHEDULER_CONTROL_EDF( name ) \
+  #define RTEMS_SCHEDULER_CONTROL_EDF( name, obj_name ) \
     { \
       &RTEMS_SCHEDULER_CONTEXT_EDF_NAME( name ).Base, \
-      SCHEDULER_EDF_ENTRY_POINTS \
+      SCHEDULER_EDF_ENTRY_POINTS, \
+      ( obj_name ) \
     }
 #endif
 
@@ -78,10 +80,11 @@
       Chain_Control              Ready[ ( prio_count ) ]; \
     } RTEMS_SCHEDULER_CONTEXT_PRIORITY_NAME( name )
 
-  #define RTEMS_SCHEDULER_CONTROL_PRIORITY( name ) \
+  #define RTEMS_SCHEDULER_CONTROL_PRIORITY( name, obj_name ) \
     { \
       &RTEMS_SCHEDULER_CONTEXT_PRIORITY_NAME( name ).Base.Base, \
-      SCHEDULER_PRIORITY_ENTRY_POINTS \
+      SCHEDULER_PRIORITY_ENTRY_POINTS, \
+      ( obj_name ) \
     }
 #endif
 
@@ -97,10 +100,11 @@
       Chain_Control                  Ready[ ( prio_count ) ]; \
     } RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP_NAME( name )
 
-  #define RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP( name ) \
+  #define RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP( name, obj_name ) \
     { \
       &RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP_NAME( name ).Base.Base, \
-      SCHEDULER_PRIORITY_AFFINITY_SMP_ENTRY_POINTS \
+      SCHEDULER_PRIORITY_AFFINITY_SMP_ENTRY_POINTS, \
+      ( obj_name ) \
     }
 #endif
 
@@ -116,10 +120,11 @@
       Chain_Control                  Ready[ ( prio_count ) ]; \
     } RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP_NAME( name )
 
-  #define RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( name ) \
+  #define RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP( name, obj_name ) \
     { \
       &RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP_NAME( name ).Base.Base, \
-      SCHEDULER_PRIORITY_SMP_ENTRY_POINTS \
+      SCHEDULER_PRIORITY_SMP_ENTRY_POINTS, \
+      ( obj_name ) \
     }
 #endif
 
@@ -133,10 +138,11 @@
     static Scheduler_simple_Context \
       RTEMS_SCHEDULER_CONTEXT_SIMPLE_NAME( name )
 
-  #define RTEMS_SCHEDULER_CONTROL_SIMPLE( name ) \
+  #define RTEMS_SCHEDULER_CONTROL_SIMPLE( name, obj_name ) \
     { \
       &RTEMS_SCHEDULER_CONTEXT_SIMPLE_NAME( name ).Base, \
-      SCHEDULER_SIMPLE_ENTRY_POINTS \
+      SCHEDULER_SIMPLE_ENTRY_POINTS, \
+      ( obj_name ) \
     }
 #endif
 
@@ -150,10 +156,11 @@
     static Scheduler_simple_SMP_Context \
       RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP_NAME( name )
 
-  #define RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP( name ) \
+  #define RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP( name, obj_name ) \
     { \
       &RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP_NAME( name ).Base, \
-      SCHEDULER_SIMPLE_SMP_ENTRY_POINTS \
+      SCHEDULER_SIMPLE_SMP_ENTRY_POINTS, \
+      ( obj_name ) \
     }
 #endif
 
diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h
index 003714d..846cd6271 100644
--- a/cpukit/score/include/rtems/score/scheduler.h
+++ b/cpukit/score/include/rtems/score/scheduler.h
@@ -165,6 +165,11 @@ struct Scheduler_Control {
    * @brief The scheduler operations.
    */
   Scheduler_Operations Operations;
+
+  /**
+   * @brief The scheduler name.
+   */
+  uint32_t name;
 };
 
 /**
diff --git a/doc/user/conf.t b/doc/user/conf.t
index 71c78b2..0796a8b 100644
--- a/doc/user/conf.t
+++ b/doc/user/conf.t
@@ -3672,6 +3672,41 @@ This scheduler is only available when RTEMS is configured with SMP
 support enabled.
 
 @c
+ at c === Configuring a Scheduler Name ===
+ at c
+ at subsection Configuring a Scheduler Name
+
+ at findex CONFIGURE_SCHEDULER_NAME
+
+ at table @b
+ at item CONSTANT:
+ at code{CONFIGURE_SCHEDULER_NAME}
+
+ at item DATA TYPE:
+RTEMS Name (@code{rtems_name}).
+
+ at item RANGE:
+Any value.
+
+ at item DEFAULT VALUE:
+The default name is
+ at itemize @bullet
+ at item @code{" CBS"} for the CBS scheduler,
+ at item @code{" EDF"} for the EDF scheduler,
+ at item @code{"PRIO"} for the Deterministic Priority scheduler,
+ at item @code{"PAFF"} for the Priority Affinity scheduler, and
+ at item @code{"PSIM"} for the Simple Priority scheduler.
+ at end itemize
+
+ at end table
+
+ at subheading DESCRIPTION:
+Schedulers can be identified via @code{rtems_scheduler_ident}.  The name of the scheduler is determined by the configuration.
+
+ at subheading NOTES:
+None.
+
+ at c
 @c === Configuring a User Scheduler ===
 @c
 @subsection Configuring a User Provided Scheduler
-- 
1.7.7




More information about the devel mailing list