From 7dfb4b970cbd22cef170b2f45a41f445406a2ce5 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 19 May 2016 11:20:58 +0200 Subject: score: Add per scheduler instance maximum priority The priority values are only valid within a scheduler instance. Thus, the maximum priority value must be defined per scheduler instance. The first scheduler instance defines PRIORITY_MAXIMUM. This implies that RTEMS_MAXIMUM_PRIORITY and POSIX_SCHEDULER_MAXIMUM_PRIORITY are only valid for threads of the first scheduler instance. Further API/implementation changes are necessary to fix this. Update #2556. --- cpukit/score/include/rtems/score/priority.h | 8 -------- cpukit/score/include/rtems/score/scheduler.h | 14 ++++++++++++++ cpukit/score/include/rtems/score/schedulercbs.h | 2 ++ cpukit/score/include/rtems/score/scheduleredf.h | 2 ++ cpukit/score/include/rtems/score/schedulersimple.h | 2 ++ cpukit/score/include/rtems/score/schedulersimplesmp.h | 2 ++ 6 files changed, 22 insertions(+), 8 deletions(-) (limited to 'cpukit/score/include/rtems') diff --git a/cpukit/score/include/rtems/score/priority.h b/cpukit/score/include/rtems/score/priority.h index 0a772f62a2..38f3995e61 100644 --- a/cpukit/score/include/rtems/score/priority.h +++ b/cpukit/score/include/rtems/score/priority.h @@ -72,14 +72,6 @@ typedef uint32_t Priority_Control; #define PRIORITY_DEFAULT_MAXIMUM 255 #endif -/** This defines the lowest (least important) thread priority. */ -#define PRIORITY_MAXIMUM rtems_maximum_priority - -/** - * This variable contains the configured number of priorities - */ -extern uint8_t rtems_maximum_priority; - #ifdef __cplusplus } #endif diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h index 5296644aeb..1e6236fa4d 100644 --- a/cpukit/score/include/rtems/score/scheduler.h +++ b/cpukit/score/include/rtems/score/scheduler.h @@ -200,6 +200,14 @@ struct Scheduler_Control { */ Scheduler_Operations Operations; + /** + * @brief The maximum priority value of this scheduler. + * + * It defines the lowest (least important) thread priority for this + * scheduler. For example the idle threads have this priority. + */ + Priority_Control maximum_priority; + /** * @brief The scheduler name. */ @@ -555,6 +563,12 @@ void _Scheduler_default_Start_idle( #define SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY #endif +/** + * @brief This defines the lowest (least important) thread priority of the + * first scheduler instance. + */ +#define PRIORITY_MAXIMUM ( _Scheduler_Table[ 0 ].maximum_priority ) + /**@}*/ #ifdef __cplusplus diff --git a/cpukit/score/include/rtems/score/schedulercbs.h b/cpukit/score/include/rtems/score/schedulercbs.h index 5558d6e919..e390532343 100644 --- a/cpukit/score/include/rtems/score/schedulercbs.h +++ b/cpukit/score/include/rtems/score/schedulercbs.h @@ -39,6 +39,8 @@ extern "C" { */ /**@{*/ +#define SCHEDULER_CBS_MAXIMUM_PRIORITY SCHEDULER_EDF_MAXIMUM_PRIORITY + /** * Entry points for the Constant Bandwidth Server Scheduler. * diff --git a/cpukit/score/include/rtems/score/scheduleredf.h b/cpukit/score/include/rtems/score/scheduleredf.h index 9b0d1b4099..137ea3abde 100644 --- a/cpukit/score/include/rtems/score/scheduleredf.h +++ b/cpukit/score/include/rtems/score/scheduleredf.h @@ -35,6 +35,8 @@ extern "C" { */ /**@{*/ +#define SCHEDULER_EDF_MAXIMUM_PRIORITY 255 + /** * Entry points for the Earliest Deadline First Scheduler. */ diff --git a/cpukit/score/include/rtems/score/schedulersimple.h b/cpukit/score/include/rtems/score/schedulersimple.h index 201c1b6628..a546ed629f 100644 --- a/cpukit/score/include/rtems/score/schedulersimple.h +++ b/cpukit/score/include/rtems/score/schedulersimple.h @@ -32,6 +32,8 @@ extern "C" { */ /**@{*/ +#define SCHEDULER_SIMPLE_MAXIMUM_PRIORITY 255 + /** * Entry points for Scheduler Simple */ diff --git a/cpukit/score/include/rtems/score/schedulersimplesmp.h b/cpukit/score/include/rtems/score/schedulersimplesmp.h index 11310c6898..342a574174 100644 --- a/cpukit/score/include/rtems/score/schedulersimplesmp.h +++ b/cpukit/score/include/rtems/score/schedulersimplesmp.h @@ -54,6 +54,8 @@ typedef struct { Chain_Control Ready; } Scheduler_simple_SMP_Context; +#define SCHEDULER_SIMPLE_SMP_MAXIMUM_PRIORITY 255 + /** * @brief Entry points for the Simple SMP Scheduler. */ -- cgit v1.2.3