diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/litmus/budget.h | 19 | ||||
-rw-r--r-- | include/litmus/litmus.h | 19 |
2 files changed, 19 insertions, 19 deletions
diff --git a/include/litmus/budget.h b/include/litmus/budget.h index 732530e63491..96da960adccc 100644 --- a/include/litmus/budget.h +++ b/include/litmus/budget.h | |||
@@ -5,4 +5,23 @@ | |||
5 | * the next task. */ | 5 | * the next task. */ |
6 | void update_enforcement_timer(struct task_struct* t); | 6 | void update_enforcement_timer(struct task_struct* t); |
7 | 7 | ||
8 | inline static int budget_exhausted(struct task_struct* t) | ||
9 | { | ||
10 | return get_exec_time(t) >= get_exec_cost(t); | ||
11 | } | ||
12 | |||
13 | inline static lt_t budget_remaining(struct task_struct* t) | ||
14 | { | ||
15 | if (!budget_exhausted(t)) | ||
16 | return get_exec_cost(t) - get_exec_time(t); | ||
17 | else | ||
18 | /* avoid overflow */ | ||
19 | return 0; | ||
20 | } | ||
21 | |||
22 | #define budget_enforced(t) (tsk_rt(t)->task_params.budget_policy != NO_ENFORCEMENT) | ||
23 | |||
24 | #define budget_precisely_enforced(t) (tsk_rt(t)->task_params.budget_policy \ | ||
25 | == PRECISE_ENFORCEMENT) | ||
26 | |||
8 | #endif | 27 | #endif |
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h index 0b071fd359f9..160119abfe30 100644 --- a/include/litmus/litmus.h +++ b/include/litmus/litmus.h | |||
@@ -59,25 +59,6 @@ void litmus_exit_task(struct task_struct *tsk); | |||
59 | #define is_priority_boosted(t) (tsk_rt(t)->priority_boosted) | 59 | #define is_priority_boosted(t) (tsk_rt(t)->priority_boosted) |
60 | #define get_boost_start(t) (tsk_rt(t)->boost_start_time) | 60 | #define get_boost_start(t) (tsk_rt(t)->boost_start_time) |
61 | 61 | ||
62 | inline static int budget_exhausted(struct task_struct* t) | ||
63 | { | ||
64 | return get_exec_time(t) >= get_exec_cost(t); | ||
65 | } | ||
66 | |||
67 | inline static lt_t budget_remaining(struct task_struct* t) | ||
68 | { | ||
69 | if (!budget_exhausted(t)) | ||
70 | return get_exec_cost(t) - get_exec_time(t); | ||
71 | else | ||
72 | /* avoid overflow */ | ||
73 | return 0; | ||
74 | } | ||
75 | |||
76 | #define budget_enforced(t) (tsk_rt(t)->task_params.budget_policy != NO_ENFORCEMENT) | ||
77 | |||
78 | #define budget_precisely_enforced(t) (tsk_rt(t)->task_params.budget_policy \ | ||
79 | == PRECISE_ENFORCEMENT) | ||
80 | |||
81 | #define is_hrt(t) \ | 62 | #define is_hrt(t) \ |
82 | (tsk_rt(t)->task_params.cls == RT_CLASS_HARD) | 63 | (tsk_rt(t)->task_params.cls == RT_CLASS_HARD) |
83 | #define is_srt(t) \ | 64 | #define is_srt(t) \ |