aboutsummaryrefslogtreecommitdiffstats
path: root/bin/rtspin.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/rtspin.c')
-rw-r--r--bin/rtspin.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/bin/rtspin.c b/bin/rtspin.c
index c680529..a19637c 100644
--- a/bin/rtspin.c
+++ b/bin/rtspin.c
@@ -10,9 +10,6 @@
10 10
11#include "litmus.h" 11#include "litmus.h"
12#include "common.h" 12#include "common.h"
13/* #include "color.h" */
14
15#include <litmus/sched_mc.h>
16 13
17static void usage(char *error) { 14static void usage(char *error) {
18 fprintf(stderr, "Error: %s\n", error); 15 fprintf(stderr, "Error: %s\n", error);
@@ -23,7 +20,6 @@ static void usage(char *error) {
23 " rt_spin -l\n" 20 " rt_spin -l\n"
24 "\n" 21 "\n"
25 "COMMON-OPTS = [-w] [-p PARTITION] [-c CLASS] [-s SCALE]\n" 22 "COMMON-OPTS = [-w] [-p PARTITION] [-c CLASS] [-s SCALE]\n"
26 " [-r CRITICALITY = [a|b|c|d]] [-i MC-LVL-A-ID]\n"
27 " [-h NUM-COLORS,AVG-WAYS]\n" 23 " [-h NUM-COLORS,AVG-WAYS]\n"
28 "\n" 24 "\n"
29 "WCET and PERIOD are milliseconds, DURATION is seconds.\n"); 25 "WCET and PERIOD are milliseconds, DURATION is seconds.\n");
@@ -165,19 +161,7 @@ static int job(double exec_time, double program_end)
165 } 161 }
166} 162}
167 163
168enum crit_level str2crit(const char* str) 164#define OPTSTR "p:c:wlveo:f:s:h:"
169{
170 if (0 == strncasecmp("a", str, 1))
171 return CRIT_LEVEL_A;
172 else if (0 == strncasecmp("b", str, 1))
173 return CRIT_LEVEL_B;
174 else if (0 == strncasecmp("c", str, 1))
175 return CRIT_LEVEL_C;
176 /* failure */
177 return NUM_CRIT_LEVELS;
178}
179
180#define OPTSTR "p:c:wlveo:f:s:r:i:h:"
181 165
182int main(int argc, char** argv) 166int main(int argc, char** argv)
183{ 167{
@@ -200,7 +184,6 @@ int main(int argc, char** argv)
200 int cur_job, num_jobs; 184 int cur_job, num_jobs;
201 int task_colors = 0; 185 int task_colors = 0;
202 int avg_ways = 0; 186 int avg_ways = 0;
203 struct mc_task mc_task = { .crit = NUM_CRIT_LEVELS, .lvl_a_id = -1 };
204 187
205 progname = argv[0]; 188 progname = argv[0];
206 189
@@ -233,14 +216,6 @@ int main(int argc, char** argv)
233 case 's': 216 case 's':
234 scale = atof(optarg); 217 scale = atof(optarg);
235 break; 218 break;
236 case 'r':
237 mc_task.crit = str2crit(optarg);
238 if (NUM_CRIT_LEVELS == mc_task.crit)
239 usage("Bad crit level.");
240 break;
241 case 'i':
242 mc_task.lvl_a_id = atoi(optarg);
243 break;
244 case 'h': 219 case 'h':
245 sscanf(optarg, "%d,%d", &task_colors, &avg_ways); 220 sscanf(optarg, "%d,%d", &task_colors, &avg_ways);
246 break; 221 break;
@@ -311,12 +286,6 @@ int main(int argc, char** argv)
311 if (ret < 0) 286 if (ret < 0)
312 bail_out("could not setup rt task params"); 287 bail_out("could not setup rt task params");
313 288
314 if (NUM_CRIT_LEVELS != mc_task.crit) {
315 ret = set_rt_task_mc_param(gettid(), &mc_task);
316 if (ret < 0)
317 bail_out("could not setup rt mixed criticality params");
318 }
319
320 init_litmus(); 289 init_litmus();
321 290
322 request_resources(task_colors, avg_ways); 291 request_resources(task_colors, avg_ways);