diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-04-10 22:44:32 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2012-04-10 22:44:32 -0400 |
commit | b91f30c8f0e03ea4bf7ec861469819c5435eb2d9 (patch) | |
tree | e1c18d263a01e20b9c3f4651a82ff95ce1332d6a /include/litmus | |
parent | d5b900860ddcfa271fbde9ea6cd9666704696a36 (diff) |
sched_color: Refactored for locking
Diffstat (limited to 'include/litmus')
-rw-r--r-- | include/litmus/litmus.h | 2 | ||||
-rw-r--r-- | include/litmus/rt_param.h | 5 | ||||
-rw-r--r-- | include/litmus/rt_server.h | 39 |
3 files changed, 44 insertions, 2 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h index c587aa4b890c..8398a10171e0 100644 --- a/include/litmus/litmus.h +++ b/include/litmus/litmus.h | |||
@@ -59,7 +59,7 @@ void litmus_exit_task(struct task_struct *tsk); | |||
59 | #define get_release(t) (tsk_rt(t)->job_params.release) | 59 | #define get_release(t) (tsk_rt(t)->job_params.release) |
60 | #define get_class(t) (tsk_rt(t)->task_params.cls) | 60 | #define get_class(t) (tsk_rt(t)->task_params.cls) |
61 | #define get_task_domain(t) (tsk_rt(t)->_domain) | 61 | #define get_task_domain(t) (tsk_rt(t)->_domain) |
62 | #define is_server(t) (tsk_rt(t)->server) | 62 | #define is_server(t) (tsk_rt(t)->is_server) |
63 | 63 | ||
64 | #define is_priority_boosted(t) (tsk_rt(t)->priority_boosted) | 64 | #define is_priority_boosted(t) (tsk_rt(t)->priority_boosted) |
65 | #define get_boost_start(t) (tsk_rt(t)->boost_start_time) | 65 | #define get_boost_start(t) (tsk_rt(t)->boost_start_time) |
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 31e8b8fed2a1..4d3a14992e0c 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -76,6 +76,7 @@ struct _rt_domain; | |||
76 | struct bheap_node; | 76 | struct bheap_node; |
77 | struct release_heap; | 77 | struct release_heap; |
78 | struct domain; | 78 | struct domain; |
79 | struct rt_server; | ||
79 | 80 | ||
80 | struct rt_job { | 81 | struct rt_job { |
81 | /* Time instant the the job was or will be released. */ | 82 | /* Time instant the the job was or will be released. */ |
@@ -119,7 +120,7 @@ struct rt_param { | |||
119 | /* is the task present? (true if it can be scheduled) */ | 120 | /* is the task present? (true if it can be scheduled) */ |
120 | unsigned int present:1; | 121 | unsigned int present:1; |
121 | 122 | ||
122 | unsigned int server:1; | 123 | unsigned int is_server:1; |
123 | 124 | ||
124 | #ifdef CONFIG_LITMUS_LOCKING | 125 | #ifdef CONFIG_LITMUS_LOCKING |
125 | /* Is the task being priority-boosted by a locking protocol? */ | 126 | /* Is the task being priority-boosted by a locking protocol? */ |
@@ -136,6 +137,8 @@ struct rt_param { | |||
136 | struct rt_event *event; | 137 | struct rt_event *event; |
137 | #endif | 138 | #endif |
138 | 139 | ||
140 | struct rt_server *server; | ||
141 | |||
139 | /* user controlled parameters */ | 142 | /* user controlled parameters */ |
140 | struct rt_task task_params; | 143 | struct rt_task task_params; |
141 | 144 | ||
diff --git a/include/litmus/rt_server.h b/include/litmus/rt_server.h new file mode 100644 index 000000000000..17517790a104 --- /dev/null +++ b/include/litmus/rt_server.h | |||
@@ -0,0 +1,39 @@ | |||
1 | #ifndef __RT_SERVER_H | ||
2 | #define __RT_SERVER_H | ||
3 | |||
4 | #include <linux/sched.h> | ||
5 | #include <litmus/litmus.h> | ||
6 | #include <litmus/rt_domain.h> | ||
7 | |||
8 | struct rt_server; | ||
9 | |||
10 | typedef int (*need_preempt_t)(rt_domain_t *rt, struct task_struct *t); | ||
11 | typedef void (*server_update_t)(struct rt_server *srv); | ||
12 | typedef void (*server_requeue_t)(struct rt_server *srv, struct task_struct *t); | ||
13 | typedef struct task_struct* (*server_take_t)(struct rt_server *srv); | ||
14 | |||
15 | struct rt_server { | ||
16 | int sid; | ||
17 | struct task_struct* linked; | ||
18 | rt_domain_t* domain; | ||
19 | int running; | ||
20 | |||
21 | /* Does this server have a higher-priority task */ | ||
22 | need_preempt_t need_preempt; | ||
23 | /* System state has changed, so should server */ | ||
24 | server_update_t update; | ||
25 | /* Requeue task in domain */ | ||
26 | server_requeue_t requeue; | ||
27 | /* Take next task from domain */ | ||
28 | server_take_t take; | ||
29 | }; | ||
30 | |||
31 | void init_rt_server(struct rt_server *server, | ||
32 | int sid, rt_domain_t *domain, | ||
33 | need_preempt_t need_preempt, | ||
34 | server_requeue_t requeue, | ||
35 | server_update_t update, | ||
36 | server_take_t take); | ||
37 | |||
38 | |||
39 | #endif | ||