aboutsummaryrefslogtreecommitdiffstats
path: root/bin/rtspin_edfos.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/rtspin_edfos.c')
-rw-r--r--bin/rtspin_edfos.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/bin/rtspin_edfos.c b/bin/rtspin_edfos.c
index e39a8c0..3ea41c7 100644
--- a/bin/rtspin_edfos.c
+++ b/bin/rtspin_edfos.c
@@ -141,10 +141,10 @@ int main(int argc, char** argv)
141 lt_t wcet; 141 lt_t wcet;
142 lt_t period; 142 lt_t period;
143 /* [num,den] */ 143 /* [num,den] */
144 lt_t fracs[NR_CPUS][2]; 144 lt_t fracs[NR_CPUS_EDF_OS][2];
145 double wcet_ms, period_ms; 145 double wcet_ms, period_ms;
146 int migrate = 0; 146 int cpu = -1;
147 int cpu = 0; 147 int ccpu;
148 int opt; 148 int opt;
149 int wait = 0; 149 int wait = 0;
150 int test_loop = 0; 150 int test_loop = 0;
@@ -156,9 +156,9 @@ int main(int argc, char** argv)
156 156
157 progname = argv[0]; 157 progname = argv[0];
158 158
159 for (i = 0; i < NR_CPUS; i++) { 159 for (i = 0; i < NR_CPUS_EDF_OS; i++) {
160 fracs[i][0] = 0; 160 fracs[i][0] = 0;
161 fracs[i][1] = 1; 161 fracs[i][1] = 0;
162 } 162 }
163 163
164 while ((opt = getopt(argc, argv, OPTSTR)) != -1) { 164 while ((opt = getopt(argc, argv, OPTSTR)) != -1) {
@@ -170,7 +170,6 @@ int main(int argc, char** argv)
170 cpu = atoi(optarg); 170 cpu = atoi(optarg);
171 fracs[cpu][0] = 1; 171 fracs[cpu][0] = 1;
172 fracs[cpu][1] = 1; 172 fracs[cpu][1] = 1;
173 migrate = 1;
174 break; 173 break;
175 case 'c': 174 case 'c':
176 class = str2class(optarg); 175 class = str2class(optarg);
@@ -215,10 +214,12 @@ int main(int argc, char** argv)
215 duration = atof(argv[optind + 2]); 214 duration = atof(argv[optind + 2]);
216 /* frac num, den = 0 means fixed task */ 215 /* frac num, den = 0 means fixed task */
217 for (i = optind + 3; i < argc; i += 3) { 216 for (i = optind + 3; i < argc; i += 3) {
218 cpu = atof(argv[i]); 217 ccpu = atof(argv[i]);
219 fracs[cpu][0] = argv[i+1]; 218 fracs[ccpu][0] = argv[i+1];
220 fracs[cpu][1] = argv[i+2]; 219 fracs[ccpu][1] = argv[i+2];
221 } 220 }
221 if (cpu == -1)
222 cpu = compute_initial_cpu_edfos(fracs);
222 wcet = wcet_ms * __NS_PER_MS; 223 wcet = wcet_ms * __NS_PER_MS;
223 period = period_ms * __NS_PER_MS; 224 period = period_ms * __NS_PER_MS;
224 if (wcet <= 0) 225 if (wcet <= 0)
@@ -231,13 +232,11 @@ int main(int argc, char** argv)
231 "exceed the period."); 232 "exceed the period.");
232 } 233 }
233 234
234 if (migrate) { 235 ret = be_migrate_to(cpu);
235 ret = be_migrate_to(cpu); 236 if (ret < 0)
236 if (ret < 0) 237 bail_out("could not migrate to target partition");
237 bail_out("could not migrate to target partition");
238 }
239 238
240 ret = sporadic_task_ns_edfos(wcet, period, 0, fracs, class, 239 ret = sporadic_task_ns_edfos(wcet, period, 0, cpu, fracs, class,
241 NO_ENFORCEMENT); 240 NO_ENFORCEMENT);
242 241
243 if (ret < 0) 242 if (ret < 0)