diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/litmus/domain.h | 26 | ||||
-rw-r--r-- | include/litmus/litmus.h | 1 | ||||
-rw-r--r-- | include/litmus/preempt.h | 4 | ||||
-rw-r--r-- | include/litmus/rt_domain.h | 6 | ||||
-rw-r--r-- | include/litmus/rt_param.h | 4 | ||||
-rw-r--r-- | include/litmus/sched_mc.h | 4 |
6 files changed, 35 insertions, 10 deletions
diff --git a/include/litmus/domain.h b/include/litmus/domain.h index eeef068d9ce2..6bcd558c7c32 100644 --- a/include/litmus/domain.h +++ b/include/litmus/domain.h | |||
@@ -2,6 +2,7 @@ | |||
2 | * --Todo-- | 2 | * --Todo-- |
3 | * Naming: this should become rt_domain while the old rt_domain should be | 3 | * Naming: this should become rt_domain while the old rt_domain should be |
4 | * changed to sd_domain (sporadic) or pd_domain (periodic). | 4 | * changed to sd_domain (sporadic) or pd_domain (periodic). |
5 | * task_new: need to add and use this method | ||
5 | */ | 6 | */ |
6 | #ifndef _LITMUS_DOMAIN_H_ | 7 | #ifndef _LITMUS_DOMAIN_H_ |
7 | #define _LITMUS_DOMAIN_H_ | 8 | #define _LITMUS_DOMAIN_H_ |
@@ -12,11 +13,13 @@ typedef void (*requeue_t)(struct domain*, struct task_struct*); | |||
12 | typedef struct task_struct* (*peek_ready_t)(struct domain*); | 13 | typedef struct task_struct* (*peek_ready_t)(struct domain*); |
13 | typedef struct task_struct* (*take_ready_t)(struct domain*); | 14 | typedef struct task_struct* (*take_ready_t)(struct domain*); |
14 | typedef int (*preempt_needed_t)(struct domain*, struct task_struct*); | 15 | typedef int (*preempt_needed_t)(struct domain*, struct task_struct*); |
16 | typedef int (*task_prio_t)(struct task_struct*, struct task_struct*); | ||
15 | 17 | ||
16 | typedef struct domain { | 18 | typedef struct domain { |
17 | raw_spinlock_t* lock; /* for coarse serialization */ | 19 | raw_spinlock_t* lock; /* for coarse serialization */ |
18 | struct list_head list; /* list membership */ | 20 | struct list_head list; /* list membership */ |
19 | void* data; /* implementation-specific data */ | 21 | void* data; /* implementation-specific data */ |
22 | char* name; /* for debugging */ | ||
20 | 23 | ||
21 | /* add a task to the domain */ | 24 | /* add a task to the domain */ |
22 | requeue_t requeue; | 25 | requeue_t requeue; |
@@ -24,14 +27,23 @@ typedef struct domain { | |||
24 | peek_ready_t peek_ready; | 27 | peek_ready_t peek_ready; |
25 | /* remove and return next ready task */ | 28 | /* remove and return next ready task */ |
26 | take_ready_t take_ready; | 29 | take_ready_t take_ready; |
27 | /* return true if the domain has a higher priority ready task */ | 30 | /* return true if the domain has a task which should preempt the |
31 | * task given | ||
32 | */ | ||
28 | preempt_needed_t preempt_needed; | 33 | preempt_needed_t preempt_needed; |
34 | /* for tasks within this domain, returns true if the first has | ||
35 | * has a higher priority than the second | ||
36 | */ | ||
37 | task_prio_t higher_prio; | ||
38 | |||
39 | /* task_new_t add; */ | ||
29 | } domain_t; | 40 | } domain_t; |
30 | 41 | ||
31 | void domain_init(domain_t *dom, raw_spinlock_t *lock, | 42 | void domain_init(domain_t *dom, |
43 | raw_spinlock_t *lock, | ||
32 | requeue_t requeue, | 44 | requeue_t requeue, |
33 | peek_ready_t peek_ready, | 45 | peek_ready_t peek_ready, |
34 | take_ready_t take_ready, | 46 | take_ready_t take_ready, |
35 | preempt_needed_t preempt_needed); | 47 | preempt_needed_t preempt_needed, |
36 | 48 | task_prio_t priority); | |
37 | #endif | 49 | #endif |
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h index 94086e2b38db..2112eecd1dc8 100644 --- a/include/litmus/litmus.h +++ b/include/litmus/litmus.h | |||
@@ -55,6 +55,7 @@ void litmus_exit_task(struct task_struct *tsk); | |||
55 | #define get_deadline(t) (tsk_rt(t)->job_params.deadline) | 55 | #define get_deadline(t) (tsk_rt(t)->job_params.deadline) |
56 | #define get_release(t) (tsk_rt(t)->job_params.release) | 56 | #define get_release(t) (tsk_rt(t)->job_params.release) |
57 | #define get_class(t) (tsk_rt(t)->task_params.cls) | 57 | #define get_class(t) (tsk_rt(t)->task_params.cls) |
58 | #define get_task_domain(t) (tsk_rt(t)->_domain) | ||
58 | 59 | ||
59 | #define is_priority_boosted(t) (tsk_rt(t)->priority_boosted) | 60 | #define is_priority_boosted(t) (tsk_rt(t)->priority_boosted) |
60 | #define get_boost_start(t) (tsk_rt(t)->boost_start_time) | 61 | #define get_boost_start(t) (tsk_rt(t)->boost_start_time) |
diff --git a/include/litmus/preempt.h b/include/litmus/preempt.h index 260c6fe17986..29bf9bc47daf 100644 --- a/include/litmus/preempt.h +++ b/include/litmus/preempt.h | |||
@@ -8,11 +8,13 @@ | |||
8 | 8 | ||
9 | #include <litmus/debug_trace.h> | 9 | #include <litmus/debug_trace.h> |
10 | 10 | ||
11 | |||
11 | extern DEFINE_PER_CPU_SHARED_ALIGNED(atomic_t, resched_state); | 12 | extern DEFINE_PER_CPU_SHARED_ALIGNED(atomic_t, resched_state); |
12 | 13 | ||
13 | #ifdef CONFIG_DEBUG_KERNEL | 14 | #ifdef CONFIG_DEBUG_KERNEL |
14 | const char* sched_state_name(int s); | 15 | const char* sched_state_name(int s); |
15 | #define TRACE_STATE(fmt, args...) TRACE("SCHED_STATE " fmt, args) | 16 | //#define TRACE_STATE(fmt, args...) TRACE("SCHED_STATE " fmt, args) |
17 | #define TRACE_STATE(fmt, args...) /* ignore */ | ||
16 | #else | 18 | #else |
17 | #define TRACE_STATE(fmt, args...) /* ignore */ | 19 | #define TRACE_STATE(fmt, args...) /* ignore */ |
18 | #endif | 20 | #endif |
diff --git a/include/litmus/rt_domain.h b/include/litmus/rt_domain.h index cba1979744ca..b5cf95ffd488 100644 --- a/include/litmus/rt_domain.h +++ b/include/litmus/rt_domain.h | |||
@@ -79,10 +79,12 @@ void rt_domain_init(rt_domain_t *rt, bheap_prio_t order, | |||
79 | check_resched_needed_t check, | 79 | check_resched_needed_t check, |
80 | release_jobs_t release); | 80 | release_jobs_t release); |
81 | 81 | ||
82 | void pd_domain_init(domain_t *dom, bheap_prio_t order, | 82 | void pd_domain_init(domain_t *dom, |
83 | bheap_prio_t order, | ||
83 | check_resched_needed_t check, | 84 | check_resched_needed_t check, |
84 | release_jobs_t release, | 85 | release_jobs_t release, |
85 | preempt_needed_t preempt_needed); | 86 | preempt_needed_t preempt_needed, |
87 | task_prio_t priority); | ||
86 | 88 | ||
87 | void pd_domain_free(domain_t *dom); | 89 | void pd_domain_free(domain_t *dom); |
88 | 90 | ||
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 4ded23d658d0..e247fb515e8c 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -72,6 +72,7 @@ struct control_page { | |||
72 | struct _rt_domain; | 72 | struct _rt_domain; |
73 | struct bheap_node; | 73 | struct bheap_node; |
74 | struct release_heap; | 74 | struct release_heap; |
75 | struct domain; | ||
75 | 76 | ||
76 | struct rt_job { | 77 | struct rt_job { |
77 | /* Time instant the the job was or will be released. */ | 78 | /* Time instant the the job was or will be released. */ |
@@ -177,6 +178,9 @@ struct rt_param { | |||
177 | int old_policy; | 178 | int old_policy; |
178 | int old_prio; | 179 | int old_prio; |
179 | 180 | ||
181 | /* TODO: rename */ | ||
182 | struct domain *_domain; | ||
183 | |||
180 | /* ready queue for this task */ | 184 | /* ready queue for this task */ |
181 | struct _rt_domain* domain; | 185 | struct _rt_domain* domain; |
182 | 186 | ||
diff --git a/include/litmus/sched_mc.h b/include/litmus/sched_mc.h index 66910773f430..3ca5576f7662 100644 --- a/include/litmus/sched_mc.h +++ b/include/litmus/sched_mc.h | |||
@@ -30,6 +30,10 @@ struct mc_data { | |||
30 | struct mc_job mc_job; | 30 | struct mc_job mc_job; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | #define tsk_mc_data(t) (tsk_rt(t)->mc_data) | ||
34 | #define tsk_mc_crit(t) (tsk_mc_data(t)->mc_task.crit) | ||
35 | #define is_ghost(t) (tsk_mc_data(t)->mc_job.is_ghost) | ||
36 | |||
33 | #endif /* __KERNEL__ */ | 37 | #endif /* __KERNEL__ */ |
34 | 38 | ||
35 | #endif | 39 | #endif |