diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-06-26 04:47:54 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-06-26 04:47:54 -0400 |
| commit | e4b2da0cecd9a43be71430b1f8e2fbbde07ea6ec (patch) | |
| tree | e2432b2f905ea89e8529a6c90a17c79965923b67 | |
| parent | 6e1ceb5ab56005fd343f52bbb8d2879e2c1493bd (diff) | |
Make use of kernel-provided FP macros
Use the kernel's notion of fixed priorities.
Also, add some clarifying comments to the
task setup wrappers.
| -rw-r--r-- | bin/rtspin.c | 4 | ||||
| -rw-r--r-- | include/litmus.h | 18 |
2 files changed, 15 insertions, 7 deletions
diff --git a/bin/rtspin.c b/bin/rtspin.c index 87c178a..f0a477d 100644 --- a/bin/rtspin.c +++ b/bin/rtspin.c | |||
| @@ -169,7 +169,7 @@ int main(int argc, char** argv) | |||
| 169 | lt_t wcet; | 169 | lt_t wcet; |
| 170 | lt_t period; | 170 | lt_t period; |
| 171 | double wcet_ms, period_ms; | 171 | double wcet_ms, period_ms; |
| 172 | unsigned int priority = LITMUS_MIN_PRIORITY; | 172 | unsigned int priority = LITMUS_LOWEST_PRIORITY; |
| 173 | int migrate = 0; | 173 | int migrate = 0; |
| 174 | int cpu = 0; | 174 | int cpu = 0; |
| 175 | int opt; | 175 | int opt; |
| @@ -197,7 +197,7 @@ int main(int argc, char** argv) | |||
| 197 | break; | 197 | break; |
| 198 | case 'q': | 198 | case 'q': |
| 199 | priority = atoi(optarg); | 199 | priority = atoi(optarg); |
| 200 | if (priority == 0 || priority > LITMUS_MAX_PRIORITY) | 200 | if (!litmus_is_valid_fixed_prio(priority)) |
| 201 | usage("Invalid priority."); | 201 | usage("Invalid priority."); |
| 202 | break; | 202 | break; |
| 203 | case 'c': | 203 | case 'c': |
diff --git a/include/litmus.h b/include/litmus.h index 232dcf5..3fa2a57 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
| @@ -29,26 +29,34 @@ int get_rt_task_param(pid_t pid, struct rt_task* param); | |||
| 29 | 29 | ||
| 30 | /* setup helper */ | 30 | /* setup helper */ |
| 31 | 31 | ||
| 32 | /* times are given in ms */ | 32 | /* Times are given in ms. The 'priority' parameter |
| 33 | * is only relevant under fixed-priority scheduling (and | ||
| 34 | * ignored by other plugins). The task_class_t parameter | ||
| 35 | * is ignored by most plugins. | ||
| 36 | */ | ||
| 33 | int sporadic_task( | 37 | int sporadic_task( |
| 34 | lt_t e, lt_t p, lt_t phase, | 38 | lt_t e, lt_t p, lt_t phase, |
| 35 | int partition, unsigned int priority, | 39 | int partition, unsigned int priority, |
| 36 | task_class_t cls, | 40 | task_class_t cls, |
| 37 | budget_policy_t budget_policy, int set_cpu_set); | 41 | budget_policy_t budget_policy, int set_cpu_set); |
| 38 | 42 | ||
| 39 | /* times are given in ns */ | 43 | /* Times are given in ns. The 'priority' parameter |
| 44 | * is only relevant under fixed-priority scheduling (and | ||
| 45 | * ignored by other plugins). The task_class_t parameter | ||
| 46 | * is ignored by most plugins. | ||
| 47 | */ | ||
| 40 | int sporadic_task_ns( | 48 | int sporadic_task_ns( |
| 41 | lt_t e, lt_t p, lt_t phase, | 49 | lt_t e, lt_t p, lt_t phase, |
| 42 | int cpu, unsigned int priority, | 50 | int cpu, unsigned int priority, |
| 43 | task_class_t cls, | 51 | task_class_t cls, |
| 44 | budget_policy_t budget_policy, int set_cpu_set); | 52 | budget_policy_t budget_policy, int set_cpu_set); |
| 45 | 53 | ||
| 46 | /* budget enforcement off by default in these macros */ | 54 | /* Convenience macros. Budget enforcement off by default in these macros. */ |
| 47 | #define sporadic_global(e, p) \ | 55 | #define sporadic_global(e, p) \ |
| 48 | sporadic_task(e, p, 0, 0, LITMUS_MAX_PRIORITY-1, \ | 56 | sporadic_task(e, p, 0, 0, LITMUS_LOWEST_PRIORITY, \ |
| 49 | RT_CLASS_SOFT, NO_ENFORCEMENT, 0) | 57 | RT_CLASS_SOFT, NO_ENFORCEMENT, 0) |
| 50 | #define sporadic_partitioned(e, p, cpu) \ | 58 | #define sporadic_partitioned(e, p, cpu) \ |
| 51 | sporadic_task(e, p, 0, cpu, LITMUS_MAX_PRIORITY-1, \ | 59 | sporadic_task(e, p, 0, cpu, LITMUS_LOWEST_PRIORITY, \ |
| 52 | RT_CLASS_SOFT, NO_ENFORCEMENT, 1) | 60 | RT_CLASS_SOFT, NO_ENFORCEMENT, 1) |
| 53 | 61 | ||
| 54 | /* file descriptor attached shared objects support */ | 62 | /* file descriptor attached shared objects support */ |
