aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2007-05-15 02:16:42 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2007-05-15 02:16:42 -0400
commit08df72e1ec41f031d5416a8012b71d1035403de1 (patch)
tree53038c9e8e6f34b0bb596e333fd86d7baf7090ff /kernel
parentc5d7c7737436d225789270f6024b4ce086fe09fd (diff)
Move edf_set_hp_task() to litmus_sem.c as it needs to have knowledge of
what is stored in the wait queue's ->private field.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/edf_common.c22
-rw-r--r--kernel/litmus_sem.c23
2 files changed, 23 insertions, 22 deletions
diff --git a/kernel/edf_common.c b/kernel/edf_common.c
index d221d54527..fa83450fe0 100644
--- a/kernel/edf_common.c
+++ b/kernel/edf_common.c
@@ -297,25 +297,3 @@ long edf_sleep_next_period(void)
297 return 0; 297 return 0;
298} 298}
299 299
300
301/* caller is responsible for locking */
302int edf_set_hp_task(struct pi_semaphore *sem)
303{
304 struct list_head *tmp, *next;
305 struct task_struct *queued;
306 int ret = 0;
307
308 sem->hp_sem_task = NULL;
309 list_for_each_safe(tmp, next, &sem->wait.task_list) {
310 queued = (struct task_struct*)
311 list_entry(tmp, wait_queue_t,
312 task_list)->private;
313
314 /* Compare task prios, find high prio task. */
315 if (edf_higher_prio(queued, sem->hp_sem_task)) {
316 sem->hp_sem_task = queued;
317 ret = 1;
318 }
319 }
320 return ret;
321}
diff --git a/kernel/litmus_sem.c b/kernel/litmus_sem.c
index c62b49bad2..fd26936475 100644
--- a/kernel/litmus_sem.c
+++ b/kernel/litmus_sem.c
@@ -280,6 +280,29 @@ static fastcall void rt_pi_down(struct pi_semaphore * sem)
280} 280}
281 281
282 282
283/* caller is responsible for locking */
284int edf_set_hp_task(struct pi_semaphore *sem)
285{
286 struct list_head *tmp, *next;
287 struct task_struct *queued;
288 int ret = 0;
289
290 sem->hp_sem_task = NULL;
291 list_for_each_safe(tmp, next, &sem->wait.task_list) {
292 queued = ((struct wq_pair*)
293 list_entry(tmp, wait_queue_t,
294 task_list)->private)->tsk;
295
296 /* Compare task prios, find high prio task. */
297 if (edf_higher_prio(queued, sem->hp_sem_task)) {
298 sem->hp_sem_task = queued;
299 ret = 1;
300 }
301 }
302 return ret;
303}
304
305
283/* Initialize PI semaphores at boot time. */ 306/* Initialize PI semaphores at boot time. */
284static int __init pi_sema_boot_init(void) 307static int __init pi_sema_boot_init(void)
285{ 308{