aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@koruna.cs.unc.edu>2010-05-20 14:17:58 -0400
committerGlenn Elliott <gelliott@koruna.cs.unc.edu>2010-05-20 14:17:58 -0400
commite9c900fae35e4e4730469e189ff17bf30518346a (patch)
tree73d399b98f831fae4a7251a7d3d143ac044d6684 /include/litmus.h
parent09740315d4b914203c25c56e8f8909b4fae7b32d (diff)
Support budget enforcement policies. Allows tasks to specify
how their execution budgets should be enforced: NO_ENFORCEMENT, QUANTUM_ENFORCEMENT, and PRECISE_ENFORCEMENT (unsupported). NOTE: Users of NO_ENFORCEMENT must call sleep_next_period() at the end of every job to signal to the kernel that its job is complete.
Diffstat (limited to 'include/litmus.h')
-rw-r--r--include/litmus.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/include/litmus.h b/include/litmus.h
index e0f16d3..b798c92 100644
--- a/include/litmus.h
+++ b/include/litmus.h
@@ -27,18 +27,24 @@ int set_rt_task_param(pid_t pid, struct rt_task* param);
27int get_rt_task_param(pid_t pid, struct rt_task* param); 27int get_rt_task_param(pid_t pid, struct rt_task* param);
28 28
29/* setup helper */ 29/* setup helper */
30
30/* times are given in ms */ 31/* times are given in ms */
31int sporadic_task(lt_t e, lt_t p, lt_t phase, 32int sporadic_task(
32 int partition, task_class_t cls, int set_cpu_set); 33 lt_t e, lt_t p, lt_t phase,
34 int partition, task_class_t cls,
35 budget_policy_t budget_policy, int set_cpu_set);
33 36
34/* times are given in ns */ 37/* times are given in ns */
35int sporadic_task_ns(lt_t e, lt_t p, lt_t phase, 38int sporadic_task_ns(
36 int cpu, task_class_t cls, int set_cpu_set); 39 lt_t e, lt_t p, lt_t phase,
40 int cpu, task_class_t cls,
41 budget_policy_t budget_policy, int set_cpu_set);
37 42
43/* budget enforcement off by default in these macros */
38#define sporadic_global(e, p) \ 44#define sporadic_global(e, p) \
39 sporadic_task(e, p, 0, 0, RT_CLASS_SOFT, 0) 45 sporadic_task(e, p, 0, 0, RT_CLASS_SOFT, NO_ENFORCEMENT, 0)
40#define sporadic_partitioned(e, p, cpu) \ 46#define sporadic_partitioned(e, p, cpu) \
41 sporadic_task(e, p, 0, cpu, RT_CLASS_SOFT, 1) 47 sporadic_task(e, p, 0, cpu, RT_CLASS_SOFT, NO_ENFORCEMENT, 1)
42 48
43/* file descriptor attached shared objects support */ 49/* file descriptor attached shared objects support */
44typedef enum { 50typedef enum {
@@ -75,6 +81,7 @@ void exit_litmus(void);
75/* A real-time program. */ 81/* A real-time program. */
76typedef int (*rt_fn_t)(void*); 82typedef int (*rt_fn_t)(void*);
77 83
84/* These two functions configure the RT task to use enforced exe budgets */
78int create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period); 85int create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period);
79int __create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, 86int __create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet,
80 int period, task_class_t cls); 87 int period, task_class_t cls);