diff options
Diffstat (limited to 'litmus/jobs.c')
-rw-r--r-- | litmus/jobs.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/litmus/jobs.c b/litmus/jobs.c index 44dd133a295a..bc8246572e54 100644 --- a/litmus/jobs.c +++ b/litmus/jobs.c | |||
@@ -6,15 +6,13 @@ | |||
6 | #include <litmus/litmus.h> | 6 | #include <litmus/litmus.h> |
7 | #include <litmus/jobs.h> | 7 | #include <litmus/jobs.h> |
8 | 8 | ||
9 | 9 | static inline void setup_release(struct task_struct *t, lt_t release) | |
10 | void prepare_for_next_period(struct task_struct *t) | ||
11 | { | 10 | { |
12 | BUG_ON(!t); | ||
13 | /* prepare next release */ | 11 | /* prepare next release */ |
14 | t->rt_param.job_params.release += get_rt_period(t); | 12 | t->rt_param.job_params.release = release; |
15 | t->rt_param.job_params.deadline = t->rt_param.job_params.release | 13 | t->rt_param.job_params.deadline = release + get_rt_relative_deadline(t); |
16 | + get_rt_rdeadline(t); | ||
17 | t->rt_param.job_params.exec_time = 0; | 14 | t->rt_param.job_params.exec_time = 0; |
15 | |||
18 | /* update job sequence number */ | 16 | /* update job sequence number */ |
19 | t->rt_param.job_params.job_no++; | 17 | t->rt_param.job_params.job_no++; |
20 | 18 | ||
@@ -22,21 +20,16 @@ void prepare_for_next_period(struct task_struct *t) | |||
22 | t->rt.time_slice = 1; | 20 | t->rt.time_slice = 1; |
23 | } | 21 | } |
24 | 22 | ||
25 | void release_at(struct task_struct *t, lt_t start) | 23 | void prepare_for_next_period(struct task_struct *t) |
26 | { | 24 | { |
27 | BUG_ON(!t); | 25 | BUG_ON(!t); |
26 | setup_release(t, get_release(t) + get_rt_period(t)); | ||
27 | } | ||
28 | 28 | ||
29 | /* prepare next release */ | 29 | void release_at(struct task_struct *t, lt_t start) |
30 | t->rt_param.job_params.release = start; | 30 | { |
31 | t->rt_param.job_params.deadline = start + get_rt_rdeadline(t); | 31 | BUG_ON(!t); |
32 | t->rt_param.job_params.exec_time = 0; | 32 | setup_release(t, start); |
33 | |||
34 | /* update job sequence number */ | ||
35 | t->rt_param.job_params.job_no++; | ||
36 | |||
37 | /* don't confuse Linux */ | ||
38 | t->rt.time_slice = 1; | ||
39 | |||
40 | set_rt_flags(t, RT_F_RUNNING); | 33 | set_rt_flags(t, RT_F_RUNNING); |
41 | } | 34 | } |
42 | 35 | ||