summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2021-10-19 20:30:33 -0400
committerleochanj105 <leochanj@live.unc.edu>2021-10-19 20:30:33 -0400
commit034d6209b6d27a8cf13784a62fd36814e98cadf6 (patch)
treea06d47457b9938e5a7c8fdc57ecdb399ba5bf8c2
parent895707a76ef3711474eb98c4358588a96926739f (diff)
Modifying extra.h to support phasing
-rw-r--r--extra.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/extra.h b/extra.h
index a16c671..1297038 100644
--- a/extra.h
+++ b/extra.h
@@ -78,13 +78,14 @@ char _rt_shm_name[_ID_SZ] = "/_libextra_barrier-";
78 78
79#if LITMUS 79#if LITMUS
80lt_t _rt_period; 80lt_t _rt_period;
81lt_t _rt_phase;
81int _rt_crit; 82int _rt_crit;
82struct control_page *_rt_cp; 83struct control_page *_rt_cp;
83#endif 84#endif
84 85
85static void _rt_load_params_itrl(int argc, char **argv) { 86static void _rt_load_params_itrl(int argc, char **argv) {
86#ifdef PAIRED 87#ifdef PAIRED
87 if (argc != (8 + LITMUS*2) && argc != (9 + LITMUS*2)) { 88 if (argc != (9 + LITMUS*2) && argc != (10 + LITMUS*2)) {
88 fprintf(stderr, "Usage: %s <name> <loops> <my core> <other core> <other name> <runID> <save results?> <pairID>\n", argv[0]); 89 fprintf(stderr, "Usage: %s <name> <loops> <my core> <other core> <other name> <runID> <save results?> <pairID>\n", argv[0]);
89#else 90#else
90 if (argc != (6 + LITMUS*2)) { 91 if (argc != (6 + LITMUS*2)) {
@@ -105,6 +106,7 @@ static void _rt_load_params_itrl(int argc, char **argv) {
105#if LITMUS 106#if LITMUS
106 fprintf(stderr, " <task period> in ms\n"); 107 fprintf(stderr, " <task period> in ms\n");
107 fprintf(stderr, " <task criticality level> 0 for Level-A, 1 for Level-B, 2 for Level-C\n"); 108 fprintf(stderr, " <task criticality level> 0 for Level-A, 1 for Level-B, 2 for Level-C\n");
109 fprintf(stderr, " <task phase> in ms\n");
108#endif /* LITMUS */ 110#endif /* LITMUS */
109 exit(1); 111 exit(1);
110 } 112 }
@@ -206,6 +208,7 @@ static void _rt_load_params_itrl(int argc, char **argv) {
206#if LITMUS 208#if LITMUS
207 _rt_period = ms2ns(strtoul(argv[end], NULL, 10)); 209 _rt_period = ms2ns(strtoul(argv[end], NULL, 10));
208 _rt_crit = atoi(argv[end+1]); 210 _rt_crit = atoi(argv[end+1]);
211 _rt_phase = ms2ns(strtoul(argv[end+2], NULL, 10));
209 unsigned int wait = 1; 212 unsigned int wait = 1;
210 if (be_migrate_to_domain(_rt_core) < 0) { 213 if (be_migrate_to_domain(_rt_core) < 0) {
211 perror("Unable to migrate to specified CPU"); 214 perror("Unable to migrate to specified CPU");
@@ -217,7 +220,7 @@ static void _rt_load_params_itrl(int argc, char **argv) {
217 rt_param.exec_cost = _rt_period; 220 rt_param.exec_cost = _rt_period;
218 rt_param.period = _rt_period; 221 rt_param.period = _rt_period;
219 rt_param.relative_deadline = 0; 222 rt_param.relative_deadline = 0;
220 rt_param.phase = 0; 223 rt_param.phase = _rt_phase;
221 rt_param.priority = LITMUS_LOWEST_PRIORITY; 224 rt_param.priority = LITMUS_LOWEST_PRIORITY;
222 rt_param.cls = _rt_crit; 225 rt_param.cls = _rt_crit;
223 rt_param.budget_policy = NO_ENFORCEMENT; 226 rt_param.budget_policy = NO_ENFORCEMENT;