From 41387a245f753e25a81d1fe38aed827856651103 Mon Sep 17 00:00:00 2001 From: Andrea Bastoni Date: Fri, 23 Jul 2010 11:33:13 -0400 Subject: [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 --- bin/npsf_add_server.c | 4 ++-- bin/rtspin_npsf.c | 2 +- include/litmus.h | 8 ++++++-- src/syscalls.c | 4 ++-- 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) /* different notional processor */ /* add server */ printf("Adding npsf_id = %d\n", curr_id); - ret = add_server(&curr_id, budgets); + ret = add_server(&curr_id, budgets, 0); if (ret < 0) { fclose(file); @@ -94,7 +94,7 @@ int main(int argc, char** argv) } /* save the last entry */ - ret = add_server(&curr_id, budgets); + ret = add_server(&curr_id, budgets, 1); printf("Adding npsf_id = %d\n", curr_id); if (ret < 0) { 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) return 0; } - if (argc - optind < 3) + if (argc - optind < 5) usage("Arguments missing."); wcet_ms = atof(argv[optind + 0]); 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, int period, lt_t *frac1, lt_t *frac2, int cpu1, int cpu2, task_class_t class); int __create_rt_task_npsf(rt_fn_t rt_prog, void *arg, int cpu, int wcet, - int period, task_class_t class, int npsf_id); + int period, int npsf_id, task_class_t class); /* per-task modes */ enum rt_task_mode_t { @@ -155,10 +155,14 @@ struct control_page* get_ctrl_page(void); * @npsf_id: a "unique" identifier for the notional processor. * @budgets: array of (cpu, budget-ns) that describes this np. * on possibly more than one cpu. + * @last: marks the end of servers initialization and trigger + * the switching of servers in the plugin. + * Should be set to 1 only once at the end of the sequence + * of add_server() calls * * Currently implemented on x86_64 only. */ -int add_server(int *npsf_id, struct npsf_budgets *budgets); +int add_server(int *npsf_id, struct npsf_budgets *budgets, int last); #ifdef __cplusplus } 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) return syscall(__NR_null_call, timestamp); } -int add_server(int *npsf_id, struct npsf_budgets *budgets) +int add_server(int *npsf_id, struct npsf_budgets *budgets, int last) { - return syscall(__NR_add_server, npsf_id, budgets); + return syscall(__NR_add_server, npsf_id, budgets, last); } diff --git a/src/task.c b/src/task.c index c88c16b..9f6db5e 100644 --- a/src/task.c +++ b/src/task.c @@ -70,7 +70,7 @@ int __create_rt_task_edffm(rt_fn_t rt_prog, void *arg, int cpu, int wcet, } int __create_rt_task_npsf(rt_fn_t rt_prog, void *arg, int cpu, int wcet, - int period, task_class_t class, int npsf_id) + int period, int npsf_id, task_class_t class) { struct rt_task params; params.cpu = cpu; -- cgit v1.2.2