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