diff options
| author | Glenn Elliott <gelliott@koruna.cs.unc.edu> | 2010-05-20 14:17:58 -0400 |
|---|---|---|
| committer | Glenn Elliott <gelliott@koruna.cs.unc.edu> | 2010-05-20 14:17:58 -0400 |
| commit | e9c900fae35e4e4730469e189ff17bf30518346a (patch) | |
| tree | 73d399b98f831fae4a7251a7d3d143ac044d6684 /include/litmus.h | |
| parent | 09740315d4b914203c25c56e8f8909b4fae7b32d (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.h | 19 |
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); | |||
| 27 | int get_rt_task_param(pid_t pid, struct rt_task* param); | 27 | int 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 */ |
| 31 | int sporadic_task(lt_t e, lt_t p, lt_t phase, | 32 | int 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 */ |
| 35 | int sporadic_task_ns(lt_t e, lt_t p, lt_t phase, | 38 | int 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 */ |
| 44 | typedef enum { | 50 | typedef enum { |
| @@ -75,6 +81,7 @@ void exit_litmus(void); | |||
| 75 | /* A real-time program. */ | 81 | /* A real-time program. */ |
| 76 | typedef int (*rt_fn_t)(void*); | 82 | typedef int (*rt_fn_t)(void*); |
| 77 | 83 | ||
| 84 | /* These two functions configure the RT task to use enforced exe budgets */ | ||
| 78 | int create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period); | 85 | int create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period); |
| 79 | int __create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, | 86 | int __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); |
