aboutsummaryrefslogtreecommitdiffstats
path: root/bin/rtspin.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/rtspin.c')
-rw-r--r--bin/rtspin.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/bin/rtspin.c b/bin/rtspin.c
index f291869..cfd5853 100644
--- a/bin/rtspin.c
+++ b/bin/rtspin.c
@@ -30,7 +30,7 @@ static double wctime()
30void usage(char *error) { 30void usage(char *error) {
31 fprintf(stderr, "Error: %s\n", error); 31 fprintf(stderr, "Error: %s\n", error);
32 fprintf(stderr, 32 fprintf(stderr,
33 "Usage: rt_spin [-w] [-p PARTITION] [-c CLASS] WCET PERIOD DURATION\n" 33 "Usage: rt_spin [-w] [-p PARTITION] [-c CLASS] [-r CRITICALITY] WCET PERIOD DURATION\n"
34 " rt_spin -l\n"); 34 " rt_spin -l\n");
35 exit(1); 35 exit(1);
36} 36}
@@ -133,7 +133,7 @@ static int job(double exec_time)
133 return 0; 133 return 0;
134} 134}
135 135
136#define OPTSTR "p:c:wld:v" 136#define OPTSTR "p:c:r:wld:v"
137 137
138int main(int argc, char** argv) 138int main(int argc, char** argv)
139{ 139{
@@ -143,6 +143,7 @@ int main(int argc, char** argv)
143 double wcet_ms, period_ms; 143 double wcet_ms, period_ms;
144 int migrate = 0; 144 int migrate = 0;
145 int cpu = 0; 145 int cpu = 0;
146 int criticality = 0;
146 int opt; 147 int opt;
147 int wait = 0; 148 int wait = 0;
148 int test_loop = 0; 149 int test_loop = 0;
@@ -167,6 +168,17 @@ int main(int argc, char** argv)
167 if (class == -1) 168 if (class == -1)
168 usage("Unknown task class."); 169 usage("Unknown task class.");
169 break; 170 break;
171 case 'r':
172 criticality = atoi(optarg);
173 if (criticality > 1){
174 if (criticality > 3){
175 class = RT_CLASS_BEST_EFFORT;
176 }
177 else{
178 class = RT_CLASS_SOFT;
179 }
180 }
181 break;
170 case 'l': 182 case 'l':
171 test_loop = 1; 183 test_loop = 1;
172 break; 184 break;
@@ -221,7 +233,7 @@ int main(int argc, char** argv)
221 bail_out("could not migrate to target partition"); 233 bail_out("could not migrate to target partition");
222 } 234 }
223 235
224 ret = sporadic_task_ns(wcet, period, 0, cpu, class, NO_ENFORCEMENT, migrate); 236 ret = sporadic_task_ns(wcet, period, 0, cpu, criticality, class, NO_ENFORCEMENT, migrate);
225 237
226 if (ret < 0) 238 if (ret < 0)
227 bail_out("could not setup rt task params"); 239 bail_out("could not setup rt task params");