diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-04-17 20:19:32 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-04-17 20:19:32 -0400 |
commit | 2649f2baf0f70f460c7f73a6076c7b4edccc5486 (patch) | |
tree | 4f37a45b51019100b095b7d67a962f21e25a8b40 /include | |
parent | 8058e6e224d96d4e00896c71f18921ce0036a3bd (diff) |
Add unlocked functions to common EDF code.
Allow access to the release and ready queues for GSN-EDF. GSN-EDF doesn't
use the locks embedded in the domain.
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/edf_common.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/include/linux/edf_common.h b/include/linux/edf_common.h index 9c00bb1937..7a222d419c 100644 --- a/include/linux/edf_common.h +++ b/include/linux/edf_common.h | |||
@@ -25,18 +25,41 @@ typedef struct _edf_domain { | |||
25 | (list_entry((edf)->ready_queue.next, struct task_struct, rt_list)) | 25 | (list_entry((edf)->ready_queue.next, struct task_struct, rt_list)) |
26 | 26 | ||
27 | void edf_domain_init(edf_domain_t *edf, edf_check_resched_needed_t f); | 27 | void edf_domain_init(edf_domain_t *edf, edf_check_resched_needed_t f); |
28 | void add_ready(edf_domain_t* edf, struct task_struct *new); | 28 | |
29 | void __add_ready(edf_domain_t* edf, struct task_struct *new); | ||
30 | void __add_release(edf_domain_t* edf, struct task_struct *task); | ||
31 | |||
29 | struct task_struct* __take_ready(edf_domain_t* edf); | 32 | struct task_struct* __take_ready(edf_domain_t* edf); |
30 | void add_release(edf_domain_t* edf, struct task_struct *task); | 33 | |
31 | void try_release_pending(edf_domain_t* edf); | 34 | void try_release_pending(edf_domain_t* edf); |
32 | void __prepare_new_release(struct task_struct *t, jiffie_t start); | 35 | void __prepare_new_release(struct task_struct *t, jiffie_t start); |
33 | #define prepare_new_release(t) __prepare_new_release(t, jiffies) | 36 | #define prepare_new_release(t) __prepare_new_release(t, jiffies) |
34 | void prepare_for_next_period(struct task_struct *t); | 37 | void prepare_for_next_period(struct task_struct *t); |
35 | void prepare_new_releases(edf_domain_t *edf, jiffie_t start); | 38 | void prepare_new_releases(edf_domain_t *edf, jiffie_t start); |
39 | void __prepare_new_releases(edf_domain_t *edf, jiffie_t start); | ||
36 | int preemption_needed(edf_domain_t* edf, struct task_struct *t); | 40 | int preemption_needed(edf_domain_t* edf, struct task_struct *t); |
37 | long edf_sleep_next_period(void); | 41 | long edf_sleep_next_period(void); |
38 | 42 | ||
39 | #define job_completed(t) (!is_be(t) && \ | 43 | #define job_completed(t) (!is_be(t) && \ |
40 | (t)->rt_param.times.exec_time == (t)->rt_param.basic_params.exec_cost) | 44 | (t)->rt_param.times.exec_time == (t)->rt_param.basic_params.exec_cost) |
41 | 45 | ||
46 | static inline void add_ready(edf_domain_t* edf, struct task_struct *new) | ||
47 | { | ||
48 | unsigned long flags; | ||
49 | /* first we need the write lock for edf_ready_queue */ | ||
50 | write_lock_irqsave(&edf->ready_lock, flags); | ||
51 | __add_ready(edf, new); | ||
52 | write_unlock_irqrestore(&edf->ready_lock, flags); | ||
53 | } | ||
54 | |||
55 | static inline void add_release(edf_domain_t* edf, struct task_struct *task) | ||
56 | { | ||
57 | unsigned long flags; | ||
58 | /* first we need the write lock for edf_ready_queue */ | ||
59 | spin_lock_irqsave(&edf->release_lock, flags); | ||
60 | __add_release(edf, task); | ||
61 | spin_unlock_irqrestore(&edf->release_lock, flags); | ||
62 | } | ||
63 | |||
64 | |||
42 | #endif | 65 | #endif |