diff options
author | Jeremy Erickson <jerickso@cs.unc.edu> | 2013-05-04 12:38:33 -0400 |
---|---|---|
committer | Jeremy Erickson <jerickso@cs.unc.edu> | 2013-05-04 12:38:33 -0400 |
commit | fa7932bf8c8881f2c8484d54db3ebac7b6832500 (patch) | |
tree | ded6fa80faaa72a12e92e3b1c278cd8175328479 /bin | |
parent | f9436915a157da898b4015637b66a559dc71223b (diff) |
Properly assign cpuwip-edf-os
Diffstat (limited to 'bin')
-rw-r--r-- | bin/rt_launch_edfos.c | 25 | ||||
-rw-r--r-- | bin/rtspin_edfos.c | 29 |
2 files changed, 25 insertions, 29 deletions
diff --git a/bin/rt_launch_edfos.c b/bin/rt_launch_edfos.c index 43ebee5..2b26fb2 100644 --- a/bin/rt_launch_edfos.c +++ b/bin/rt_launch_edfos.c | |||
@@ -50,9 +50,8 @@ int main(int argc, char** argv) | |||
50 | lt_t wcet; | 50 | lt_t wcet; |
51 | lt_t period; | 51 | lt_t period; |
52 | /* [num,den] */ | 52 | /* [num,den] */ |
53 | lt_t fracs[NR_CPUS][2]; | 53 | lt_t fracs[NR_CPUS_EDF_OS][2]; |
54 | int migrate = 0; | 54 | int cpu = -1; |
55 | int cpu = 0; | ||
56 | int opt; | 55 | int opt; |
57 | int verbose = 0; | 56 | int verbose = 0; |
58 | int wait = 0; | 57 | int wait = 0; |
@@ -60,7 +59,7 @@ int main(int argc, char** argv) | |||
60 | startup_info_t info; | 59 | startup_info_t info; |
61 | task_class_t class = RT_CLASS_HARD; | 60 | task_class_t class = RT_CLASS_HARD; |
62 | 61 | ||
63 | for (i = 0; i < NR_CPUS; i++) { | 62 | for (i = 0; i < NR_CPUS_EDF_OS; i++) { |
64 | fracs[i][0] = 0; | 63 | fracs[i][0] = 0; |
65 | fracs[i][1] = 0; | 64 | fracs[i][1] = 0; |
66 | } | 65 | } |
@@ -77,7 +76,6 @@ int main(int argc, char** argv) | |||
77 | cpu = atoi(optarg); | 76 | cpu = atoi(optarg); |
78 | fracs[cpu][0] = 1; | 77 | fracs[cpu][0] = 1; |
79 | fracs[cpu][1] = 1; | 78 | fracs[cpu][1] = 1; |
80 | migrate = 1; | ||
81 | break; | 79 | break; |
82 | case 'c': | 80 | case 'c': |
83 | class = str2class(optarg); | 81 | class = str2class(optarg); |
@@ -106,9 +104,11 @@ int main(int argc, char** argv) | |||
106 | fracs[cpu][0] = atoi(argv[i]); | 104 | fracs[cpu][0] = atoi(argv[i]); |
107 | fracs[cpu][1] = atoi(argv[i+1]); | 105 | fracs[cpu][1] = atoi(argv[i+1]); |
108 | } | 106 | } |
107 | if (cpu == -1) | ||
108 | cpu = compute_initial_cpu_edfos(fracs); | ||
109 | if (wcet <= 0) | 109 | if (wcet <= 0) |
110 | usage("The worst-case execution time must be a " | 110 | usage("The worst-case execution time must be a " |
111 | "positive number."); | 111 | "positive number."); |
112 | if (period <= 0) | 112 | if (period <= 0) |
113 | usage("The period must be a positive number."); | 113 | usage("The period must be a positive number."); |
114 | if (wcet > period) { | 114 | if (wcet > period) { |
@@ -118,17 +118,14 @@ int main(int argc, char** argv) | |||
118 | info.exec_path = argv[optind + 8]; | 118 | info.exec_path = argv[optind + 8]; |
119 | info.argv = argv + optind + 8; | 119 | info.argv = argv + optind + 8; |
120 | info.wait = wait; | 120 | info.wait = wait; |
121 | if (migrate) { | 121 | ret = be_migrate_to(cpu); |
122 | ret = be_migrate_to(cpu); | 122 | if (ret < 0) |
123 | if (ret < 0) | 123 | bail_out("could not migrate to target partition"); |
124 | bail_out("could not migrate to target partition"); | ||
125 | } | ||
126 | /* create in src/task.c a new wrapper for the __launch_rt_task | 124 | /* create in src/task.c a new wrapper for the __launch_rt_task |
127 | * which takes the fraction and the cpus */ | 125 | * which takes the fraction and the cpus */ |
128 | ret = __create_rt_task_edfos(launch, &info, wcet, period, fracs, | 126 | ret = __create_rt_task_edfos(launch, &info, cpu, wcet, period, fracs, |
129 | class); | 127 | class); |
130 | 128 | ||
131 | |||
132 | if (ret < 0) | 129 | if (ret < 0) |
133 | bail_out("could not create rt child process"); | 130 | bail_out("could not create rt child process"); |
134 | else if (verbose) | 131 | else if (verbose) |
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) |