diff options
| author | Namhoon Kim <namhoonk@cs.unc.edu> | 2015-01-24 04:55:04 -0500 |
|---|---|---|
| committer | Namhoon Kim <namhoonk@cs.unc.edu> | 2015-01-24 04:55:04 -0500 |
| commit | 5be3aecdd4b8b0beb981cc0f7fc84b0d0ded2c47 (patch) | |
| tree | 7df48cce968c60a37b9c11d4b03b852b201f5d67 /include | |
| parent | 6583dcfbda43e420921e3adf7f2e46dc719e8d26 (diff) | |
slack stealing
Diffstat (limited to 'include')
| -rw-r--r-- | include/litmus/mc2_common.h | 2 | ||||
| -rw-r--r-- | include/litmus/reservation.h | 44 | ||||
| -rw-r--r-- | include/litmus/rt_param.h | 4 |
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 | |||
| 24 | long mc2_task_client_init(struct task_client *tc, struct mc2_task *mc2_param, struct task_struct *tsk, | 26 | long 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 | ||
| 131 | void reservation_init(struct reservation *res); | 134 | void reservation_init(struct reservation *res); |
| @@ -185,10 +188,51 @@ struct sup_reservation_environment { | |||
| 185 | void sup_init(struct sup_reservation_environment* sup_env); | 188 | void sup_init(struct sup_reservation_environment* sup_env); |
| 186 | void sup_add_new_reservation(struct sup_reservation_environment* sup_env, | 189 | void sup_add_new_reservation(struct sup_reservation_environment* sup_env, |
| 187 | struct reservation* new_res); | 190 | struct reservation* new_res); |
| 191 | void sup_scheduler_update_after(struct sup_reservation_environment* sup_env, | ||
| 192 | lt_t timeout); | ||
| 188 | void sup_update_time(struct sup_reservation_environment* sup_env, lt_t now); | 193 | void sup_update_time(struct sup_reservation_environment* sup_env, lt_t now); |
| 189 | struct task_struct* sup_dispatch(struct sup_reservation_environment* sup_env); | 194 | struct task_struct* sup_dispatch(struct sup_reservation_environment* sup_env); |
| 190 | 195 | ||
| 191 | struct reservation* sup_find_by_id(struct sup_reservation_environment* sup_env, | 196 | struct 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 | ||
| 201 | struct next_timer_event { | ||
| 202 | lt_t next_update; | ||
| 203 | int timer_armed_on; | ||
| 204 | unsigned int id; | ||
| 205 | struct list_head list; | ||
| 206 | }; | ||
| 207 | |||
| 208 | struct 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 | /* | ||
| 229 | void gmp_init(struct gmp_reservation_environment* gmp_env); | ||
| 230 | void gmp_add_new_reservation(struct gmp_reservation_environment* gmp_env, | ||
| 231 | struct reservation* new_res); | ||
| 232 | void gmp_update_time(struct gmp_reservation_environment* gmp_env, lt_t now); | ||
| 233 | struct task_struct* gmp_dispatch(struct gmp_reservation_environment* gmp_env); | ||
| 234 | |||
| 235 | struct 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 | ||
| 208 | struct pfair_param; | 208 | struct pfair_param; |
| 209 | struct 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 |
