diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-08-23 17:56:16 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-08-23 17:56:16 -0400 |
commit | eb235f7391b714910e9f616c99013df0d9d1a1e1 (patch) | |
tree | 452b5be8c9c338e3acd37a3c98e6e4cf24654e58 /include/linux/rt_domain.h | |
parent | 8b6d4e51e23c3c4137c2ab5c0352dc8233dfa3f9 (diff) |
Change fifo_domain_t to rt_domain_t + bug fixes.
Diffstat (limited to 'include/linux/rt_domain.h')
-rw-r--r-- | include/linux/rt_domain.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/rt_domain.h b/include/linux/rt_domain.h index 7157a04ac2..237eac7bb4 100644 --- a/include/linux/rt_domain.h +++ b/include/linux/rt_domain.h | |||
@@ -38,6 +38,7 @@ void rt_domain_init(rt_domain_t *rt, check_resched_needed_t f, | |||
38 | void __add_ready(rt_domain_t* rt, struct task_struct *new); | 38 | void __add_ready(rt_domain_t* rt, struct task_struct *new); |
39 | void __add_release(rt_domain_t* rt, struct task_struct *task); | 39 | void __add_release(rt_domain_t* rt, struct task_struct *task); |
40 | 40 | ||
41 | struct task_struct* __take_ready_rq(rt_domain_t* rt, runqueue_t* rq, int cpu); | ||
41 | struct task_struct* __take_ready(rt_domain_t* rt); | 42 | struct task_struct* __take_ready(rt_domain_t* rt); |
42 | struct task_struct* __peek_ready(rt_domain_t* rt); | 43 | struct task_struct* __peek_ready(rt_domain_t* rt); |
43 | 44 | ||
@@ -56,6 +57,18 @@ static inline void add_ready(rt_domain_t* rt, struct task_struct *new) | |||
56 | write_unlock_irqrestore(&rt->ready_lock, flags); | 57 | write_unlock_irqrestore(&rt->ready_lock, flags); |
57 | } | 58 | } |
58 | 59 | ||
60 | static inline struct task_struct* take_ready(rt_domain_t* rt) | ||
61 | { | ||
62 | unsigned long flags; | ||
63 | struct task_struct* ret; | ||
64 | /* first we need the write lock for rt_ready_queue */ | ||
65 | write_lock_irqsave(&rt->ready_lock, flags); | ||
66 | ret = __take_ready(rt); | ||
67 | write_unlock_irqrestore(&rt->ready_lock, flags); | ||
68 | return ret; | ||
69 | } | ||
70 | |||
71 | |||
59 | static inline void add_release(rt_domain_t* rt, struct task_struct *task) | 72 | static inline void add_release(rt_domain_t* rt, struct task_struct *task) |
60 | { | 73 | { |
61 | unsigned long flags; | 74 | unsigned long flags; |
@@ -65,5 +78,21 @@ static inline void add_release(rt_domain_t* rt, struct task_struct *task) | |||
65 | spin_unlock_irqrestore(&rt->release_lock, flags); | 78 | spin_unlock_irqrestore(&rt->release_lock, flags); |
66 | } | 79 | } |
67 | 80 | ||
81 | static inline int __jobs_pending(rt_domain_t* rt) | ||
82 | { | ||
83 | return !list_empty(&rt->ready_queue); | ||
84 | } | ||
85 | |||
86 | static inline int jobs_pending(rt_domain_t* rt) | ||
87 | { | ||
88 | unsigned long flags; | ||
89 | int ret; | ||
90 | /* first we need the write lock for rt_ready_queue */ | ||
91 | read_lock_irqsave(&rt->ready_lock, flags); | ||
92 | ret = __jobs_pending(rt); | ||
93 | read_unlock_irqrestore(&rt->ready_lock, flags); | ||
94 | return ret; | ||
95 | } | ||
96 | |||
68 | 97 | ||
69 | #endif | 98 | #endif |