diff options
Diffstat (limited to 'src/task.c')
-rw-r--r-- | src/task.c | 25 |
1 files changed, 4 insertions, 21 deletions
@@ -37,33 +37,16 @@ int __launch_rt_task(rt_fn_t rt_prog, void *rt_arg, rt_setup_fn_t setup, | |||
37 | return rt_task; | 37 | return rt_task; |
38 | } | 38 | } |
39 | 39 | ||
40 | struct create_rt_param { | ||
41 | int cpu; | ||
42 | int wcet; | ||
43 | int period; | ||
44 | task_class_t class; | ||
45 | }; | ||
46 | |||
47 | int setup_create_rt(int pid, struct create_rt_param* arg) | ||
48 | { | ||
49 | rt_param_t params; | ||
50 | params.period = arg->period; | ||
51 | params.exec_cost = arg->wcet; | ||
52 | params.cpu = arg->cpu; | ||
53 | params.cls = arg->class; | ||
54 | return set_rt_task_param(pid, ¶ms); | ||
55 | } | ||
56 | |||
57 | int __create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period, | 40 | int __create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period, |
58 | task_class_t class) | 41 | task_class_t class) |
59 | { | 42 | { |
60 | struct create_rt_param params; | 43 | struct rt_task params; |
61 | params.cpu = cpu; | 44 | params.cpu = cpu; |
62 | params.period = period; | 45 | params.period = period; |
63 | params.wcet = wcet; | 46 | params.exec_cost = wcet; |
64 | params.class = class; | 47 | params.cls = class; |
65 | return __launch_rt_task(rt_prog, arg, | 48 | return __launch_rt_task(rt_prog, arg, |
66 | (rt_setup_fn_t) setup_create_rt, ¶ms); | 49 | (rt_setup_fn_t) set_rt_task_param, ¶ms); |
67 | } | 50 | } |
68 | 51 | ||
69 | int create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period) { | 52 | int create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period) { |