[rtems commit] score: Add scheduler name

Sebastian Huber sebh at rtems.org
Tue Apr 15 09:08:29 UTC 2014


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Apr  9 10:33:00 2014 +0200

score: Add scheduler name

---

 cpukit/sapi/include/confdefs.h               |   52 ++++++++++++++++++++++----
 cpukit/sapi/include/rtems/scheduler.h        |   35 ++++++++++-------
 cpukit/score/include/rtems/score/scheduler.h |    5 ++
 doc/user/conf.t                              |   37 ++++++++++++++++++
 4 files changed, 107 insertions(+), 22 deletions(-)

diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
index e62e917..5ec0cf2 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('U', 'P', 'D', ' ')
+  #endif
+
   #if !defined(CONFIGURE_SCHEDULER_CONTROLS)
     #define CONFIGURE_SCHEDULER_CONTEXT \
       RTEMS_SCHEDULER_CONTEXT_PRIORITY( \
@@ -674,7 +678,7 @@ const rtems_libio_helper rtems_fs_init_helper =
       )
 
     #define CONFIGURE_SCHEDULER_CONTROLS \
-      RTEMS_SCHEDULER_CONTROL_PRIORITY(dflt)
+      RTEMS_SCHEDULER_CONTROL_PRIORITY(dflt, CONFIGURE_SCHEDULER_NAME)
   #endif
 #endif
 
@@ -683,6 +687,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('M', 'P', 'D', ' ')
+  #endif
+
   #if !defined(CONFIGURE_SCHEDULER_CONTROLS)
     #define CONFIGURE_SCHEDULER_CONTEXT \
       RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP( \
@@ -691,7 +699,7 @@ const rtems_libio_helper rtems_fs_init_helper =
       )
 
     #define CONFIGURE_SCHEDULER_CONTROLS \
-      RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP(dflt)
+      RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP(dflt, CONFIGURE_SCHEDULER_NAME)
   #endif
 #endif
 
@@ -700,6 +708,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('M', 'P', 'A', ' ')
+  #endif
+
   #if !defined(CONFIGURE_SCHEDULER_CONTROLS)
     #define CONFIGURE_SCHEDULER_CONTEXT \
       RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP( \
@@ -708,7 +720,10 @@ const rtems_libio_helper rtems_fs_init_helper =
       )
 
     #define CONFIGURE_SCHEDULER_CONTROLS \
-      RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP(dflt)
+      RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP( \
+        dflt, \
+        CONFIGURE_SCHEDULER_NAME \
+      )
   #endif
 #endif
 
@@ -716,10 +731,15 @@ const rtems_libio_helper rtems_fs_init_helper =
  * 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('U', 'P', 'S', ' ')
+  #endif
+
   #if !defined(CONFIGURE_SCHEDULER_CONTROLS)
     #define CONFIGURE_SCHEDULER_CONTEXT RTEMS_SCHEDULER_CONTEXT_SIMPLE(dflt)
 
-    #define CONFIGURE_SCHEDULER_CONTROLS RTEMS_SCHEDULER_CONTROL_SIMPLE(dflt)
+    #define CONFIGURE_SCHEDULER_CONTROLS \
+      RTEMS_SCHEDULER_CONTROL_SIMPLE(dflt, CONFIGURE_SCHEDULER_NAME)
   #endif
 #endif
 
@@ -727,12 +747,16 @@ const rtems_libio_helper rtems_fs_init_helper =
  * 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('M', 'P', 'S', ' ')
+  #endif
+
   #if !defined(CONFIGURE_SCHEDULER_CONTROLS)
     #define CONFIGURE_SCHEDULER_CONTEXT \
       RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(dflt)
 
     #define CONFIGURE_SCHEDULER_CONTROLS \
-      RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(dflt)
+      RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(dflt, CONFIGURE_SCHEDULER_NAME)
   #endif
 #endif
 
@@ -740,10 +764,15 @@ const rtems_libio_helper rtems_fs_init_helper =
  * 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('U', 'E', 'D', 'F')
+  #endif
+
   #if !defined(CONFIGURE_SCHEDULER_CONTROLS)
     #define CONFIGURE_SCHEDULER_CONTEXT RTEMS_SCHEDULER_CONTEXT_EDF(dflt)
 
-    #define CONFIGURE_SCHEDULER_CONTROLS RTEMS_SCHEDULER_CONTROL_EDF(dflt)
+    #define CONFIGURE_SCHEDULER_CONTROLS \
+      RTEMS_SCHEDULER_CONTROL_EDF(dflt, CONFIGURE_SCHEDULER_NAME)
   #endif
 #endif
 
@@ -751,10 +780,15 @@ const rtems_libio_helper rtems_fs_init_helper =
  * 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('U', 'C', 'B', 'S')
+  #endif
+
   #if !defined(CONFIGURE_SCHEDULER_CONTROLS)
     #define CONFIGURE_SCHEDULER_CONTEXT RTEMS_SCHEDULER_CONTEXT_CBS(dflt)
 
-    #define CONFIGURE_SCHEDULER_CONTROLS RTEMS_SCHEDULER_CONTROL_CBS(dflt)
+    #define CONFIGURE_SCHEDULER_CONTROLS \
+      RTEMS_SCHEDULER_CONTROL_CBS(dflt, CONFIGURE_SCHEDULER_NAME)
   #endif
 
   #ifndef CONFIGURE_CBS_MAXIMUM_SERVERS
@@ -775,7 +809,9 @@ const rtems_libio_helper rtems_fs_init_helper =
  * this code to know which scheduler is configured by the user.
  */
 #ifdef CONFIGURE_INIT
-  CONFIGURE_SCHEDULER_CONTEXT;
+  #if defined(CONFIGURE_SCHEDULER_CONTEXT)
+    CONFIGURE_SCHEDULER_CONTEXT;
+  #endif
 
   const Scheduler_Control _Scheduler_Table[] = {
     CONFIGURE_SCHEDULER_CONTROLS
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 d4e1339..3fd47c7 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 afecef1..9b093f8 100644
--- a/doc/user/conf.t
+++ b/doc/user/conf.t
@@ -3705,6 +3705,43 @@ 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{"UCBS"} for the Uni-Processor CBS scheduler,
+ at item @code{"UEDF"} for the Uni-Processor EDF scheduler,
+ at item @code{"UPD "} for the Uni-Processor Deterministic Priority scheduler,
+ at item @code{"UPS "} for the Uni-Processor Simple Priority scheduler,
+ at item @code{"MPA "} for the Multi-Processor Priority Affinity scheduler, and
+ at item @code{"MPD "} for the Multi-Processor Deterministic Priority scheduler, and
+ at item @code{"MPS "} for the Multi-Processor 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




More information about the vc mailing list