[PATCH 2/5] score: SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Sep 17 07:02:56 UTC 2021


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 +-
 .../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 25b6723efd..6cb07c4ff1 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 396dfc17be..4b7efc8340 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 54b1cd71bc..9e643b93eb 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 45a312ffaf..e0991f5e31 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 d6ab6f6fdd..80979a36ba 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 155027f3d3..63310e9796 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 6b7e111208..158bea74db 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 \
   }
 
 /**
-- 
2.31.1



More information about the devel mailing list