aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNamhoon Kim <namhoonk@cs.unc.edu>2015-01-24 04:55:04 -0500
committerNamhoon Kim <namhoonk@cs.unc.edu>2015-01-24 04:55:04 -0500
commit5be3aecdd4b8b0beb981cc0f7fc84b0d0ded2c47 (patch)
tree7df48cce968c60a37b9c11d4b03b852b201f5d67 /include
parent6583dcfbda43e420921e3adf7f2e46dc719e8d26 (diff)
slack stealing
Diffstat (limited to 'include')
-rw-r--r--include/litmus/mc2_common.h2
-rw-r--r--include/litmus/reservation.h44
-rw-r--r--include/litmus/rt_param.h4
3 files changed, 50 insertions, 0 deletions
diff --git a/include/litmus/mc2_common.h b/include/litmus/mc2_common.h
index bdc3a6d82a56..e3c0af28f1b9 100644
--- a/include/litmus/mc2_common.h
+++ b/include/litmus/mc2_common.h
@@ -21,6 +21,8 @@ struct mc2_task {
21 21
22#include <litmus/reservation.h> 22#include <litmus/reservation.h>
23 23
24#define tsk_mc2_data(t) (tsk_rt(t)->mc2_data)
25
24long mc2_task_client_init(struct task_client *tc, struct mc2_task *mc2_param, struct task_struct *tsk, 26long mc2_task_client_init(struct task_client *tc, struct mc2_task *mc2_param, struct task_struct *tsk,
25 struct reservation *res); 27 struct reservation *res);
26 28
diff --git a/include/litmus/reservation.h b/include/litmus/reservation.h
index 4eecd3f088e8..5ccb20055a56 100644
--- a/include/litmus/reservation.h
+++ b/include/litmus/reservation.h
@@ -126,6 +126,9 @@ struct reservation {
126 struct reservation_ops *ops; 126 struct reservation_ops *ops;
127 127
128 struct list_head clients; 128 struct list_head clients;
129
130 /* for global env. */
131 int scheduled_on;
129}; 132};
130 133
131void reservation_init(struct reservation *res); 134void reservation_init(struct reservation *res);
@@ -185,10 +188,51 @@ struct sup_reservation_environment {
185void sup_init(struct sup_reservation_environment* sup_env); 188void sup_init(struct sup_reservation_environment* sup_env);
186void sup_add_new_reservation(struct sup_reservation_environment* sup_env, 189void sup_add_new_reservation(struct sup_reservation_environment* sup_env,
187 struct reservation* new_res); 190 struct reservation* new_res);
191void sup_scheduler_update_after(struct sup_reservation_environment* sup_env,
192 lt_t timeout);
188void sup_update_time(struct sup_reservation_environment* sup_env, lt_t now); 193void sup_update_time(struct sup_reservation_environment* sup_env, lt_t now);
189struct task_struct* sup_dispatch(struct sup_reservation_environment* sup_env); 194struct task_struct* sup_dispatch(struct sup_reservation_environment* sup_env);
190 195
191struct reservation* sup_find_by_id(struct sup_reservation_environment* sup_env, 196struct reservation* sup_find_by_id(struct sup_reservation_environment* sup_env,
192 unsigned int id); 197 unsigned int id);
198
199/* A global multiprocessor reservation environment. */
193 200
201struct next_timer_event {
202 lt_t next_update;
203 int timer_armed_on;
204 unsigned int id;
205 struct list_head list;
206};
207
208struct gmp_reservation_environment {
209 raw_spinlock_t lock;
210 struct reservation_environment env;
211
212 /* ordered by priority */
213 struct list_head active_reservations;
214
215 /* ordered by next_replenishment */
216 struct list_head depleted_reservations;
217
218 /* unordered */
219 struct list_head inactive_reservations;
220
221 /* timer event ordered by next_update */
222 struct list_head next_events;
223 /* (schedule_now == true) means call gmp_dispatch() now */
224 bool schedule_now;
225 /* set to true if a call to gmp_dispatch() is imminent */
226 bool will_schedule;
227};
228/*
229void gmp_init(struct gmp_reservation_environment* gmp_env);
230void gmp_add_new_reservation(struct gmp_reservation_environment* gmp_env,
231 struct reservation* new_res);
232void gmp_update_time(struct gmp_reservation_environment* gmp_env, lt_t now);
233struct task_struct* gmp_dispatch(struct gmp_reservation_environment* gmp_env);
234
235struct reservation* gmp_find_by_id(struct gmp_reservation_environment* gmp_env,
236 unsigned int id);
237*/
194#endif 238#endif
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h
index e626bbbe60d5..284b89e95a51 100644
--- a/include/litmus/rt_param.h
+++ b/include/litmus/rt_param.h
@@ -206,6 +206,7 @@ struct rt_job {
206}; 206};
207 207
208struct pfair_param; 208struct pfair_param;
209struct mc2_task;
209 210
210/* RT task parameters for scheduling extensions 211/* RT task parameters for scheduling extensions
211 * These parameters are inherited during clone and therefore must 212 * These parameters are inherited during clone and therefore must
@@ -322,6 +323,9 @@ struct rt_param {
322 323
323 /* Pointer to the page shared between userspace and kernel. */ 324 /* Pointer to the page shared between userspace and kernel. */
324 struct control_page * ctrl_page; 325 struct control_page * ctrl_page;
326
327 /* Mixed-criticality specific data */
328 struct mc2_task* mc2_data;
325}; 329};
326 330
327#endif 331#endif