aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus/litmus.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/litmus/litmus.h')
-rw-r--r--include/litmus/litmus.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h
index 674528eece14..ba6c5381e151 100644
--- a/include/litmus/litmus.h
+++ b/include/litmus/litmus.h
@@ -85,6 +85,14 @@ inline static int budget_exhausted(struct task_struct* t)
85 return get_exec_time(t) >= get_exec_cost(t); 85 return get_exec_time(t) >= get_exec_cost(t);
86} 86}
87 87
88inline static lt_t budget_remaining(struct task_struct* t)
89{
90 /* This overflows if called when there is no budget remaining. */
91 BUG_ON(budget_exhausted(t));
92
93 return get_exec_cost(t) - get_exec_time(t);
94}
95
88#define budget_enforced(t) (tsk_rt(t)->task_params.budget_policy != NO_ENFORCEMENT) 96#define budget_enforced(t) (tsk_rt(t)->task_params.budget_policy != NO_ENFORCEMENT)
89 97
90 98