diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/litmus/edf_common.h | 3 | ||||
-rw-r--r-- | include/litmus/litmus.h | 12 | ||||
-rw-r--r-- | include/litmus/rt_domain.h | 7 | ||||
-rw-r--r-- | include/litmus/rt_param.h | 4 |
4 files changed, 23 insertions, 3 deletions
diff --git a/include/litmus/edf_common.h b/include/litmus/edf_common.h index f3c930b137..669900bc4c 100644 --- a/include/litmus/edf_common.h +++ b/include/litmus/edf_common.h | |||
@@ -12,7 +12,8 @@ | |||
12 | #include <litmus/rt_domain.h> | 12 | #include <litmus/rt_domain.h> |
13 | 13 | ||
14 | 14 | ||
15 | void edf_domain_init(rt_domain_t* rt, check_resched_needed_t resched); | 15 | void edf_domain_init(rt_domain_t* rt, check_resched_needed_t resched, |
16 | release_at_t release); | ||
16 | 17 | ||
17 | int edf_higher_prio(struct task_struct* first, | 18 | int edf_higher_prio(struct task_struct* first, |
18 | struct task_struct* second); | 19 | struct task_struct* second); |
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h index 6e99e651d7..7a27c987b6 100644 --- a/include/litmus/litmus.h +++ b/include/litmus/litmus.h | |||
@@ -163,6 +163,18 @@ inline static int budget_exhausted(struct task_struct* t) | |||
163 | 163 | ||
164 | #define get_release(t) ((t)->rt_param.job_params.release) | 164 | #define get_release(t) ((t)->rt_param.job_params.release) |
165 | 165 | ||
166 | /* Our notion of time within LITMUS: kernel monotonic time. */ | ||
167 | static inline lt_t litmus_clock(void) | ||
168 | { | ||
169 | return ktime_to_ns(ktime_get()); | ||
170 | } | ||
171 | |||
172 | /* A macro to convert from nanoseconds to ktime_t. */ | ||
173 | #define ns_to_ktime(t) ktime_add_ns(ktime_set(0, 0), t) | ||
174 | |||
175 | /* The high-resolution release timer for a task. */ | ||
176 | #define release_timer(t) ((t)->rt_param.job_params.release_timer) | ||
177 | |||
166 | /* Honor the flag in the preempt_count variable that is set | 178 | /* Honor the flag in the preempt_count variable that is set |
167 | * when scheduling is in progress. | 179 | * when scheduling is in progress. |
168 | */ | 180 | */ |
diff --git a/include/litmus/rt_domain.h b/include/litmus/rt_domain.h index 79b6034f22..fd3c205bcc 100644 --- a/include/litmus/rt_domain.h +++ b/include/litmus/rt_domain.h | |||
@@ -8,7 +8,7 @@ | |||
8 | struct _rt_domain; | 8 | struct _rt_domain; |
9 | 9 | ||
10 | typedef int (*check_resched_needed_t)(struct _rt_domain *rt); | 10 | typedef int (*check_resched_needed_t)(struct _rt_domain *rt); |
11 | typedef void (*release_at_t)(struct task_struct *t, lt_t start); | 11 | typedef void (*release_at_t)(struct task_struct *t); |
12 | 12 | ||
13 | typedef struct _rt_domain { | 13 | typedef struct _rt_domain { |
14 | /* runnable rt tasks are in here */ | 14 | /* runnable rt tasks are in here */ |
@@ -22,6 +22,9 @@ typedef struct _rt_domain { | |||
22 | /* how do we check if we need to kick another CPU? */ | 22 | /* how do we check if we need to kick another CPU? */ |
23 | check_resched_needed_t check_resched; | 23 | check_resched_needed_t check_resched; |
24 | 24 | ||
25 | /* how do we setup a job release? */ | ||
26 | release_at_t setup_release; | ||
27 | |||
25 | /* how are tasks ordered in the ready queue? */ | 28 | /* how are tasks ordered in the ready queue? */ |
26 | list_cmp_t order; | 29 | list_cmp_t order; |
27 | } rt_domain_t; | 30 | } rt_domain_t; |
@@ -33,7 +36,7 @@ typedef struct _rt_domain { | |||
33 | (!list_empty(&(rt)->ready_queue)) | 36 | (!list_empty(&(rt)->ready_queue)) |
34 | 37 | ||
35 | void rt_domain_init(rt_domain_t *rt, check_resched_needed_t f, | 38 | void rt_domain_init(rt_domain_t *rt, check_resched_needed_t f, |
36 | list_cmp_t order); | 39 | release_at_t g, list_cmp_t order); |
37 | 40 | ||
38 | void __add_ready(rt_domain_t* rt, struct task_struct *new); | 41 | void __add_ready(rt_domain_t* rt, struct task_struct *new); |
39 | void __add_release(rt_domain_t* rt, struct task_struct *task); | 42 | void __add_release(rt_domain_t* rt, struct task_struct *task); |
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 9fb5b19b78..3704924729 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -42,6 +42,10 @@ struct rt_job { | |||
42 | lt_t release; | 42 | lt_t release; |
43 | /* What is the current deadline? */ | 43 | /* What is the current deadline? */ |
44 | lt_t deadline; | 44 | lt_t deadline; |
45 | |||
46 | /* The high-resolution timer used to control its release. */ | ||
47 | struct hrtimer release_timer; | ||
48 | |||
45 | /* How much service has this job received so far? | 49 | /* How much service has this job received so far? |
46 | */ | 50 | */ |
47 | lt_t exec_time; | 51 | lt_t exec_time; |