aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2012-06-26 04:45:31 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2012-07-23 05:58:00 -0400
commitc1350f82ee53098f52b712877c3b8e0876952f52 (patch)
treea5b43bfe9f93cad0b70be4e213e9fa66e2fb1c9c
parentc2034d8205674daa954ee314f93270f39b90148f (diff)
P-FP: Clarify meaning of priorities
Add a comment to explain how priorities are interpreted, and provide some useful macros for userspace.
-rw-r--r--include/litmus/rt_param.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h
index 1ce96af51287..c4669a276e6f 100644
--- a/include/litmus/rt_param.h
+++ b/include/litmus/rt_param.h
@@ -33,7 +33,25 @@ typedef enum {
33 PRECISE_ENFORCEMENT /* budgets are enforced with hrtimers */ 33 PRECISE_ENFORCEMENT /* budgets are enforced with hrtimers */
34} budget_policy_t; 34} budget_policy_t;
35 35
36#define LITMUS_MAX_PRIORITY 512 36/* We use the common priority interpretation "lower index == higher priority",
37 * which is commonly used in fixed-priority schedulability analysis papers.
38 * So, a numerically lower priority value implies higher scheduling priority,
39 * with priority 1 being the highest priority. Priority 0 is reserved for
40 * priority boosting. LITMUS_MAX_PRIORITY denotes the maximum priority value
41 * range.
42 */
43
44#define LITMUS_MAX_PRIORITY 512
45#define LITMUS_HIGHEST_PRIORITY 1
46#define LITMUS_LOWEST_PRIORITY (LITMUS_MAX_PRIORITY - 1)
47
48/* Provide generic comparison macros for userspace,
49 * in case that we change this later. */
50#define litmus_higher_fixed_prio(a, b) (a < b)
51#define litmus_lower_fixed_prio(a, b) (a > b)
52#define litmus_is_valid_fixed_prio(p) \
53 ((p) >= LITMUS_HIGHEST_PRIORITY && \
54 (p) <= LITMUS_LOWEST_PRIORITY)
37 55
38struct rt_task { 56struct rt_task {
39 lt_t exec_cost; 57 lt_t exec_cost;