diff options
Diffstat (limited to 'include/litmus/litmus.h')
-rw-r--r-- | include/litmus/litmus.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h index 875783e6a67b..2da61fa58bdc 100644 --- a/include/litmus/litmus.h +++ b/include/litmus/litmus.h | |||
@@ -26,16 +26,20 @@ static inline int in_list(struct list_head* list) | |||
26 | ); | 26 | ); |
27 | } | 27 | } |
28 | 28 | ||
29 | |||
29 | struct task_struct* __waitqueue_remove_first(wait_queue_head_t *wq); | 30 | struct task_struct* __waitqueue_remove_first(wait_queue_head_t *wq); |
30 | 31 | ||
31 | #define NO_CPU 0xffffffff | 32 | #define NO_CPU 0xffffffff |
32 | 33 | ||
33 | void litmus_fork(struct task_struct *tsk); | 34 | void litmus_fork(struct task_struct *tsk); |
35 | void litmus_post_fork_thread(struct task_struct *tsk); | ||
34 | void litmus_exec(void); | 36 | void litmus_exec(void); |
35 | /* clean up real-time state of a task */ | 37 | /* clean up real-time state of a task */ |
36 | void exit_litmus(struct task_struct *dead_tsk); | 38 | void exit_litmus(struct task_struct *dead_tsk); |
37 | 39 | ||
38 | long litmus_admit_task(struct task_struct *tsk); | 40 | long litmus_admit_task(struct task_struct *tsk); |
41 | |||
42 | void litmus_pre_exit_task(struct task_struct *tsk); // called before litmus_exit_task, but without run queue locks held | ||
39 | void litmus_exit_task(struct task_struct *tsk); | 43 | void litmus_exit_task(struct task_struct *tsk); |
40 | 44 | ||
41 | #define is_realtime(t) ((t)->policy == SCHED_LITMUS) | 45 | #define is_realtime(t) ((t)->policy == SCHED_LITMUS) |
@@ -43,6 +47,7 @@ void litmus_exit_task(struct task_struct *tsk); | |||
43 | ((t)->rt_param.transition_pending) | 47 | ((t)->rt_param.transition_pending) |
44 | 48 | ||
45 | #define tsk_rt(t) (&(t)->rt_param) | 49 | #define tsk_rt(t) (&(t)->rt_param) |
50 | #define tsk_aux(t) (&(t)->aux_data) | ||
46 | 51 | ||
47 | /* Realtime utility macros */ | 52 | /* Realtime utility macros */ |
48 | #define is_priority_boosted(t) (tsk_rt(t)->priority_boosted) | 53 | #define is_priority_boosted(t) (tsk_rt(t)->priority_boosted) |
@@ -60,9 +65,13 @@ void litmus_exit_task(struct task_struct *tsk); | |||
60 | /* job_param macros */ | 65 | /* job_param macros */ |
61 | #define get_exec_time(t) (tsk_rt(t)->job_params.exec_time) | 66 | #define get_exec_time(t) (tsk_rt(t)->job_params.exec_time) |
62 | #define get_deadline(t) (tsk_rt(t)->job_params.deadline) | 67 | #define get_deadline(t) (tsk_rt(t)->job_params.deadline) |
68 | #define get_period(t) (tsk_rt(t)->task_params.period) | ||
63 | #define get_release(t) (tsk_rt(t)->job_params.release) | 69 | #define get_release(t) (tsk_rt(t)->job_params.release) |
64 | #define get_lateness(t) (tsk_rt(t)->job_params.lateness) | 70 | #define get_lateness(t) (tsk_rt(t)->job_params.lateness) |
65 | 71 | ||
72 | #define effective_priority(t) ((!(tsk_rt(t)->inh_task)) ? t : tsk_rt(t)->inh_task) | ||
73 | #define base_priority(t) (t) | ||
74 | |||
66 | #define is_hrt(t) \ | 75 | #define is_hrt(t) \ |
67 | (tsk_rt(t)->task_params.cls == RT_CLASS_HARD) | 76 | (tsk_rt(t)->task_params.cls == RT_CLASS_HARD) |
68 | #define is_srt(t) \ | 77 | #define is_srt(t) \ |
@@ -99,10 +108,12 @@ static inline lt_t litmus_clock(void) | |||
99 | #define earlier_deadline(a, b) (lt_before(\ | 108 | #define earlier_deadline(a, b) (lt_before(\ |
100 | (a)->rt_param.job_params.deadline,\ | 109 | (a)->rt_param.job_params.deadline,\ |
101 | (b)->rt_param.job_params.deadline)) | 110 | (b)->rt_param.job_params.deadline)) |
111 | #define shorter_period(a, b) (lt_before(\ | ||
112 | (a)->rt_param.task_params.period,\ | ||
113 | (b)->rt_param.task_params.period)) | ||
102 | #define earlier_release(a, b) (lt_before(\ | 114 | #define earlier_release(a, b) (lt_before(\ |
103 | (a)->rt_param.job_params.release,\ | 115 | (a)->rt_param.job_params.release,\ |
104 | (b)->rt_param.job_params.release)) | 116 | (b)->rt_param.job_params.release)) |
105 | |||
106 | void preempt_if_preemptable(struct task_struct* t, int on_cpu); | 117 | void preempt_if_preemptable(struct task_struct* t, int on_cpu); |
107 | 118 | ||
108 | #ifdef CONFIG_LITMUS_LOCKING | 119 | #ifdef CONFIG_LITMUS_LOCKING |
@@ -174,8 +185,10 @@ static inline int request_exit_np_atomic(struct task_struct *t) | |||
174 | * retry loop here since tasks might exploit that to | 185 | * retry loop here since tasks might exploit that to |
175 | * keep the kernel busy indefinitely. */ | 186 | * keep the kernel busy indefinitely. */ |
176 | } | 187 | } |
177 | } else | 188 | } |
189 | else { | ||
178 | return 0; | 190 | return 0; |
191 | } | ||
179 | } | 192 | } |
180 | 193 | ||
181 | #else | 194 | #else |