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/rt_launch_edfos.c | |
| parent | f9436915a157da898b4015637b66a559dc71223b (diff) | |
Properly assign cpuwip-edf-os
Diffstat (limited to 'bin/rt_launch_edfos.c')
| -rw-r--r-- | bin/rt_launch_edfos.c | 25 |
1 files changed, 11 insertions, 14 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) |
