aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus
diff options
context:
space:
mode:
Diffstat (limited to 'include/litmus')
-rw-r--r--include/litmus/litmus.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h
index 674528eece14..69894f59c8d8 100644
--- a/include/litmus/litmus.h
+++ b/include/litmus/litmus.h
@@ -85,6 +85,15 @@ 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 if (!budget_exhausted(t))
91 return get_exec_time(t) - get_exec_cost(t);
92 else
93 /* avoid overflow */
94 return 0;
95}
96
88#define budget_enforced(t) (tsk_rt(t)->task_params.budget_policy != NO_ENFORCEMENT) 97#define budget_enforced(t) (tsk_rt(t)->task_params.budget_policy != NO_ENFORCEMENT)
89 98
90 99