aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/rt_launch.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/bin/rt_launch.c b/bin/rt_launch.c
index 3863031..16d6ed7 100644
--- a/bin/rt_launch.c
+++ b/bin/rt_launch.c
@@ -29,7 +29,7 @@ int launch(void *task_info_p) {
29} 29}
30 30
31void usage(char *error) { 31void usage(char *error) {
32 fprintf(stderr, "%s\nUsage: rt_launch [-w][-v][-p cpu][-c hrt | srt | be] wcet period program [arg1 arg2 ...]\n" 32 fprintf(stderr, "%s\nUsage: rt_launch [-w][-v][-p cpu][-q prio][-c hrt | srt | be] wcet period program [arg1 arg2 ...]\n"
33 "\t-w\tSynchronous release\n" 33 "\t-w\tSynchronous release\n"
34 "\t-v\tVerbose\n" 34 "\t-v\tVerbose\n"
35 "\t-p\tcpu (or initial cpu)\n" 35 "\t-p\tcpu (or initial cpu)\n"
@@ -41,7 +41,7 @@ void usage(char *error) {
41} 41}
42 42
43 43
44#define OPTSTR "p:c:vw" 44#define OPTSTR "p:c:vwq:"
45 45
46int main(int argc, char** argv) 46int main(int argc, char** argv)
47{ 47{
@@ -55,6 +55,7 @@ int main(int argc, char** argv)
55 int wait = 0; 55 int wait = 0;
56 startup_info_t info; 56 startup_info_t info;
57 task_class_t class = RT_CLASS_HARD; 57 task_class_t class = RT_CLASS_HARD;
58 unsigned int priority = LITMUS_LOWEST_PRIORITY;
58 59
59 while ((opt = getopt(argc, argv, OPTSTR)) != -1) { 60 while ((opt = getopt(argc, argv, OPTSTR)) != -1) {
60 switch (opt) { 61 switch (opt) {
@@ -68,6 +69,11 @@ int main(int argc, char** argv)
68 cpu = atoi(optarg); 69 cpu = atoi(optarg);
69 migrate = 1; 70 migrate = 1;
70 break; 71 break;
72 case 'q':
73 priority = atoi(optarg);
74 if (!litmus_is_valid_fixed_prio(priority))
75 usage("Invalid priority.");
76 break;
71 case 'c': 77 case 'c':
72 class = str2class(optarg); 78 class = str2class(optarg);
73 if (class == -1) 79 if (class == -1)
@@ -87,7 +93,7 @@ int main(int argc, char** argv)
87 signal(SIGUSR1, SIG_IGN); 93 signal(SIGUSR1, SIG_IGN);
88 94
89 if (argc - optind < 3) 95 if (argc - optind < 3)
90 usage("Arguments missing."); 96 usage("Arguments missing.");
91 wcet = ms2lt(atoi(argv[optind + 0])); 97 wcet = ms2lt(atoi(argv[optind + 0]));
92 period = ms2lt(atoi(argv[optind + 1])); 98 period = ms2lt(atoi(argv[optind + 1]));
93 if (wcet <= 0) 99 if (wcet <= 0)
@@ -107,13 +113,13 @@ int main(int argc, char** argv)
107 if (ret < 0) 113 if (ret < 0)
108 bail_out("could not migrate to target partition"); 114 bail_out("could not migrate to target partition");
109 } 115 }
110 ret = __create_rt_task(launch, &info, cpu, wcet, period, class); 116 ret = __create_rt_task(launch, &info, cpu, wcet, period, priority, class);
117
111 118
112
113 if (ret < 0) 119 if (ret < 0)
114 bail_out("could not create rt child process"); 120 bail_out("could not create rt child process");
115 else if (verbose) 121 else if (verbose)
116 printf("%d\n", ret); 122 printf("%d\n", ret);
117 123
118 return 0; 124 return 0;
119} 125}