diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-07-23 11:33:13 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-01-26 18:20:24 -0500 |
commit | 5a648736360fb4038ad2e1c01a5922bda206e297 (patch) | |
tree | 33410e77ee67a9365a10920266d02eebe574601e | |
parent | ca501a7f388e84b3698d96c8068b23ed83283d30 (diff) |
[NPS-F] Adapt to new add_server() API and fix parameters order
- comply with new add_server() API
- fix wrong order in parameters for rt_launch_npsf.c
-rw-r--r-- | bin/npsf_add_server.c | 4 | ||||
-rw-r--r-- | bin/rtspin_npsf.c | 2 | ||||
-rw-r--r-- | include/litmus.h | 8 | ||||
-rw-r--r-- | src/syscalls.c | 4 | ||||
-rw-r--r-- | src/task.c | 2 |
5 files changed, 12 insertions, 8 deletions
diff --git a/bin/npsf_add_server.c b/bin/npsf_add_server.c index 9fa59c0..9f3f92c 100644 --- a/bin/npsf_add_server.c +++ b/bin/npsf_add_server.c | |||
@@ -62,7 +62,7 @@ int main(int argc, char** argv) | |||
62 | /* different notional processor */ | 62 | /* different notional processor */ |
63 | /* add server */ | 63 | /* add server */ |
64 | printf("Adding npsf_id = %d\n", curr_id); | 64 | printf("Adding npsf_id = %d\n", curr_id); |
65 | ret = add_server(&curr_id, budgets); | 65 | ret = add_server(&curr_id, budgets, 0); |
66 | 66 | ||
67 | if (ret < 0) { | 67 | if (ret < 0) { |
68 | fclose(file); | 68 | fclose(file); |
@@ -94,7 +94,7 @@ int main(int argc, char** argv) | |||
94 | } | 94 | } |
95 | 95 | ||
96 | /* save the last entry */ | 96 | /* save the last entry */ |
97 | ret = add_server(&curr_id, budgets); | 97 | ret = add_server(&curr_id, budgets, 1); |
98 | printf("Adding npsf_id = %d\n", curr_id); | 98 | printf("Adding npsf_id = %d\n", curr_id); |
99 | if (ret < 0) { | 99 | if (ret < 0) { |
100 | fclose(file); | 100 | fclose(file); |
diff --git a/bin/rtspin_npsf.c b/bin/rtspin_npsf.c index 87eb52f..d5dff3d 100644 --- a/bin/rtspin_npsf.c +++ b/bin/rtspin_npsf.c | |||
@@ -195,7 +195,7 @@ int main(int argc, char** argv) | |||
195 | return 0; | 195 | return 0; |
196 | } | 196 | } |
197 | 197 | ||
198 | if (argc - optind < 3) | 198 | if (argc - optind < 5) |
199 | usage("Arguments missing."); | 199 | usage("Arguments missing."); |
200 | wcet_ms = atof(argv[optind + 0]); | 200 | wcet_ms = atof(argv[optind + 0]); |
201 | period_ms = atof(argv[optind + 1]); | 201 | period_ms = atof(argv[optind + 1]); |
diff --git a/include/litmus.h b/include/litmus.h index 0ccad9f..7382936 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -99,7 +99,7 @@ int __create_rt_task_edffm(rt_fn_t rt_prog, void *arg, int cpu, int wcet, | |||
99 | int period, lt_t *frac1, lt_t *frac2, | 99 | int period, lt_t *frac1, lt_t *frac2, |
100 | int cpu1, int cpu2, task_class_t class); | 100 | int cpu1, int cpu2, task_class_t class); |
101 | int __create_rt_task_npsf(rt_fn_t rt_prog, void *arg, int cpu, int wcet, | 101 | int __create_rt_task_npsf(rt_fn_t rt_prog, void *arg, int cpu, int wcet, |
102 | int period, task_class_t class, int npsf_id); | 102 | int period, int npsf_id, task_class_t class); |
103 | 103 | ||
104 | /* per-task modes */ | 104 | /* per-task modes */ |
105 | enum rt_task_mode_t { | 105 | enum rt_task_mode_t { |
@@ -155,10 +155,14 @@ struct control_page* get_ctrl_page(void); | |||
155 | * @npsf_id: a "unique" identifier for the notional processor. | 155 | * @npsf_id: a "unique" identifier for the notional processor. |
156 | * @budgets: array of (cpu, budget-ns) that describes this np. | 156 | * @budgets: array of (cpu, budget-ns) that describes this np. |
157 | * on possibly more than one cpu. | 157 | * on possibly more than one cpu. |
158 | * @last: marks the end of servers initialization and trigger | ||
159 | * the switching of servers in the plugin. | ||
160 | * Should be set to 1 only once at the end of the sequence | ||
161 | * of add_server() calls | ||
158 | * | 162 | * |
159 | * Currently implemented on x86_64 only. | 163 | * Currently implemented on x86_64 only. |
160 | */ | 164 | */ |
161 | int add_server(int *npsf_id, struct npsf_budgets *budgets); | 165 | int add_server(int *npsf_id, struct npsf_budgets *budgets, int last); |
162 | 166 | ||
163 | #ifdef __cplusplus | 167 | #ifdef __cplusplus |
164 | } | 168 | } |
diff --git a/src/syscalls.c b/src/syscalls.c index 6df716b..7ac488a 100644 --- a/src/syscalls.c +++ b/src/syscalls.c | |||
@@ -96,7 +96,7 @@ int null_call(cycles_t *timestamp) | |||
96 | return syscall(__NR_null_call, timestamp); | 96 | return syscall(__NR_null_call, timestamp); |
97 | } | 97 | } |
98 | 98 | ||
99 | int add_server(int *npsf_id, struct npsf_budgets *budgets) | 99 | int add_server(int *npsf_id, struct npsf_budgets *budgets, int last) |
100 | { | 100 | { |
101 | return syscall(__NR_add_server, npsf_id, budgets); | 101 | return syscall(__NR_add_server, npsf_id, budgets, last); |
102 | } | 102 | } |
@@ -70,7 +70,7 @@ int __create_rt_task_edffm(rt_fn_t rt_prog, void *arg, int cpu, int wcet, | |||
70 | } | 70 | } |
71 | 71 | ||
72 | int __create_rt_task_npsf(rt_fn_t rt_prog, void *arg, int cpu, int wcet, | 72 | int __create_rt_task_npsf(rt_fn_t rt_prog, void *arg, int cpu, int wcet, |
73 | int period, task_class_t class, int npsf_id) | 73 | int period, int npsf_id, task_class_t class) |
74 | { | 74 | { |
75 | struct rt_task params; | 75 | struct rt_task params; |
76 | params.cpu = cpu; | 76 | params.cpu = cpu; |