[rtems commit] score: SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY

Sebastian Huber sebh at rtems.org
Tue Sep 21 08:25:31 UTC 2021


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Sep 17 08:54:58 2021 +0200

score: SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY

Rename SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY in
SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION.  Add Doxygen comment.

---

 cpukit/include/rtems/score/scheduler.h            | 16 ++++++++++++++--
 cpukit/include/rtems/score/schedulercbs.h         |  2 +-
 cpukit/include/rtems/score/scheduleredf.h         |  2 +-
 cpukit/include/rtems/score/schedulerpriority.h    |  2 +-
 cpukit/include/rtems/score/schedulerprioritysmp.h |  2 +-
 cpukit/include/rtems/score/schedulersimple.h      |  2 +-
 cpukit/include/rtems/score/schedulersimplesmp.h   |  2 +-
 7 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/cpukit/include/rtems/score/scheduler.h b/cpukit/include/rtems/score/scheduler.h
index 25b6723..6cb07c4 100644
--- a/cpukit/include/rtems/score/scheduler.h
+++ b/cpukit/include/rtems/score/scheduler.h
@@ -605,11 +605,23 @@ void _Scheduler_default_Start_idle(
     Scheduler_Node          *node,
     const Processor_mask    *affinity
   );
+#endif
 
-  #define SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+/**
+ * @brief This define provides the default implementation for the
+ *   SMP-specific set affinity operation.
+ *
+ * The default implementation _Scheduler_default_Set_affinity() is intended for
+ * uniprocessor schedulers and SMP schedulers which only support an affinity to
+ * all online processors.
+ *
+ * If SMP support is disabled, the define evaluates to nothing.
+ */
+#if defined(RTEMS_SMP)
+  #define SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
     , _Scheduler_default_Set_affinity
 #else
-  #define SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY
+  #define SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION
 #endif
 
 /**
diff --git a/cpukit/include/rtems/score/schedulercbs.h b/cpukit/include/rtems/score/schedulercbs.h
index 396dfc1..4b7efc8 100644
--- a/cpukit/include/rtems/score/schedulercbs.h
+++ b/cpukit/include/rtems/score/schedulercbs.h
@@ -69,7 +69,7 @@ extern "C" {
     _Scheduler_CBS_Cancel_job,       /* cancel period of task */ \
     _Scheduler_default_Tick,         /* tick entry point */ \
     _Scheduler_default_Start_idle    /* start idle entry point */ \
-    SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+    SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
   }
 
 /* Return values for CBS server. */
diff --git a/cpukit/include/rtems/score/scheduleredf.h b/cpukit/include/rtems/score/scheduleredf.h
index 54b1cd7..9e643b9 100644
--- a/cpukit/include/rtems/score/scheduleredf.h
+++ b/cpukit/include/rtems/score/scheduleredf.h
@@ -68,7 +68,7 @@ extern "C" {
     _Scheduler_EDF_Cancel_job,       /* cancel period of task */ \
     _Scheduler_default_Tick,         /* tick entry point */ \
     _Scheduler_default_Start_idle    /* start idle entry point */ \
-    SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+    SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
   }
 
 typedef struct {
diff --git a/cpukit/include/rtems/score/schedulerpriority.h b/cpukit/include/rtems/score/schedulerpriority.h
index 45a312f..e0991f5 100644
--- a/cpukit/include/rtems/score/schedulerpriority.h
+++ b/cpukit/include/rtems/score/schedulerpriority.h
@@ -59,7 +59,7 @@ extern "C" {
     _Scheduler_default_Cancel_job,        /* cancel period of task */ \
     _Scheduler_default_Tick,              /* tick entry point */ \
     _Scheduler_default_Start_idle         /* start idle entry point */ \
-    SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+    SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
   }
 
 typedef struct {
diff --git a/cpukit/include/rtems/score/schedulerprioritysmp.h b/cpukit/include/rtems/score/schedulerprioritysmp.h
index d6ab6f6..80979a3 100644
--- a/cpukit/include/rtems/score/schedulerprioritysmp.h
+++ b/cpukit/include/rtems/score/schedulerprioritysmp.h
@@ -103,7 +103,7 @@ typedef struct {
     _Scheduler_default_Cancel_job, \
     _Scheduler_default_Tick, \
     _Scheduler_SMP_Start_idle \
-    SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+    SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
   }
 
 /**
diff --git a/cpukit/include/rtems/score/schedulersimple.h b/cpukit/include/rtems/score/schedulersimple.h
index 155027f..63310e9 100644
--- a/cpukit/include/rtems/score/schedulersimple.h
+++ b/cpukit/include/rtems/score/schedulersimple.h
@@ -58,7 +58,7 @@ extern "C" {
     _Scheduler_default_Cancel_job,        /* cancel period of task */ \
     _Scheduler_default_Tick,              /* tick entry point */ \
     _Scheduler_default_Start_idle         /* start idle entry point */ \
-    SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+    SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
   }
 
 /**
diff --git a/cpukit/include/rtems/score/schedulersimplesmp.h b/cpukit/include/rtems/score/schedulersimplesmp.h
index 6b7e111..158bea7 100644
--- a/cpukit/include/rtems/score/schedulersimplesmp.h
+++ b/cpukit/include/rtems/score/schedulersimplesmp.h
@@ -85,7 +85,7 @@ typedef struct {
     _Scheduler_default_Cancel_job, \
     _Scheduler_default_Tick, \
     _Scheduler_SMP_Start_idle \
-    SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY \
+    SCHEDULER_DEFAULT_SET_AFFINITY_OPERATION \
   }
 
 /**



More information about the vc mailing list