aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-03-21 18:54:19 -0400
committerGlenn Elliott <gelliott@cs.unc.edu>2013-03-21 18:54:19 -0400
commit6d5c9b4a6c56bd109b0563cecae447d6480aec66 (patch)
treeecb9f005355f9cb53b7f968cc79e2d4f4edd6353 /src
parent020dc974933f4e9459f699625a138c33811eadf6 (diff)
Change create_rt_task() to task rt_task parameter.
This updates create_rt_task() to take an rt_task parameter instead of a number of task parameters. This probably should have been a part of patches recent patches that revised the sproadic_*() macros.
Diffstat (limited to 'src')
-rw-r--r--src/task.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/src/task.c b/src/task.c
index ef4bf79..c3a9109 100644
--- a/src/task.c
+++ b/src/task.c
@@ -40,29 +40,16 @@ int __launch_rt_task(rt_fn_t rt_prog, void *rt_arg, rt_setup_fn_t setup,
40 return rt_task; 40 return rt_task;
41} 41}
42 42
43int __create_rt_task(rt_fn_t rt_prog, void *arg, int cluster, int cluster_size, 43int create_rt_task(rt_fn_t rt_prog, void *arg, struct rt_task* param)
44 lt_t wcet, lt_t period, unsigned int priority, task_class_t cls)
45{ 44{
46 struct rt_task params; 45 if (param->budget_policy == NO_ENFORCEMENT) {
47 init_rt_task_param(&params); 46 /* This is only safe if the task to be launched does not peg the CPU.
48 params.cpu = cluster_to_first_cpu(cluster, cluster_size); 47 That is, it must block frequently for I/O or call sleep_next_period()
49 params.period = period; 48 at the end of each job. Otherwise, the task may peg the CPU. */
50 params.exec_cost = wcet; 49 //printf("Warning: running budget enforcement used.\n");
51 params.cls = cls; 50 }
52 params.phase = 0;
53 params.priority = priority;
54 /* enforce budget for tasks that might not use sleep_next_period() */
55 params.budget_policy = QUANTUM_ENFORCEMENT;
56
57 return __launch_rt_task(rt_prog, arg,
58 (rt_setup_fn_t) set_rt_task_param, &params);
59}
60 51
61int create_rt_task(rt_fn_t rt_prog, void *arg, int cluster, int cluster_size, 52 return __launch_rt_task(rt_prog, arg, (rt_setup_fn_t) set_rt_task_param, param);
62 lt_t wcet, lt_t period, unsigned int prio)
63{
64 return __create_rt_task(rt_prog, arg, cluster, cluster_size, wcet, period,
65 prio, RT_CLASS_HARD);
66} 53}
67 54
68 55