diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-02-19 15:48:59 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-02-19 15:48:59 -0500 |
commit | 8cea6a4d179628e96d8d012f7a7f18d112fdb060 (patch) | |
tree | edbec8b5f4c91775f089c72a345096066fe8e5d6 | |
parent | 2c1f329215e57a6f070cab21236b132b22ef80c2 (diff) |
adapt to new ABI
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | include/litmus.h | 10 | ||||
-rw-r--r-- | src/litmus.c | 3 | ||||
-rw-r--r-- | src/syscalls.c | 10 | ||||
-rw-r--r-- | src/task.c | 7 |
5 files changed, 25 insertions, 9 deletions
@@ -1,4 +1,4 @@ | |||
1 | KERNEL_DIR = ../q08 | 1 | KERNEL_DIR = ../litmus2008 |
2 | 2 | ||
3 | INC=-Iinclude/ -I${KERNEL_DIR}/include/ | 3 | INC=-Iinclude/ -I${KERNEL_DIR}/include/ |
4 | 4 | ||
@@ -47,4 +47,4 @@ liblitmus.a: ${LIB_OBJ} litmus.h | |||
47 | ${AR} rcs liblitmus.a ${LIB_OBJ} | 47 | ${AR} rcs liblitmus.a ${LIB_OBJ} |
48 | 48 | ||
49 | check: | 49 | check: |
50 | sparse ${CFLAGS} src/*.c bin/*.c \ No newline at end of file | 50 | sparse ${CFLAGS} src/*.c bin/*.c |
diff --git a/include/litmus.h b/include/litmus.h index 6699213..ef39262 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -14,13 +14,13 @@ int get_rt_task_param(pid_t pid, struct rt_task* param); | |||
14 | 14 | ||
15 | /* setup helper */ | 15 | /* setup helper */ |
16 | /* times are givin in ms */ | 16 | /* times are givin in ms */ |
17 | int sporadic_task(unsigned long exec_cost, unsigned long period, | 17 | int sporadic_task(lt_t e, lt_t p, lt_t phase, |
18 | int partition, task_class_t cls); | 18 | int partition, task_class_t cls); |
19 | 19 | ||
20 | #define sporadic_global(e, p) \ | 20 | #define sporadic_global(e, p) \ |
21 | sporadic_task(e, p, 0, RT_CLASS_SOFT) | 21 | sporadic_task(e, p, 0, 0, RT_CLASS_SOFT) |
22 | #define sporadic_partitioned(e, p, cpu) \ | 22 | #define sporadic_partitioned(e, p, cpu) \ |
23 | sporadic_task(e, p, cpu, RT_CLASS_SOFT) | 23 | sporadic_task(e, p, 0, cpu, RT_CLASS_SOFT) |
24 | 24 | ||
25 | /* file descriptor attached shared objects support */ | 25 | /* file descriptor attached shared objects support */ |
26 | typedef enum { | 26 | typedef enum { |
@@ -74,4 +74,8 @@ task_class_t str2class(const char* str); | |||
74 | void enter_np(void); | 74 | void enter_np(void); |
75 | void exit_np(void); | 75 | void exit_np(void); |
76 | 76 | ||
77 | /* task system support */ | ||
78 | int wait_for_ts_release(void); | ||
79 | int release_ts(lt_t *delay); | ||
80 | |||
77 | #endif | 81 | #endif |
diff --git a/src/litmus.c b/src/litmus.c index 4666471..4fe6572 100644 --- a/src/litmus.c +++ b/src/litmus.c | |||
@@ -29,7 +29,7 @@ task_class_t str2class(const char* str) | |||
29 | 29 | ||
30 | #define NS_PER_MS 1000000 | 30 | #define NS_PER_MS 1000000 |
31 | 31 | ||
32 | int sporadic_task(unsigned long e, unsigned long p, | 32 | int sporadic_task(lt_t e, lt_t p, lt_t phase, |
33 | int cpu, task_class_t cls) | 33 | int cpu, task_class_t cls) |
34 | { | 34 | { |
35 | struct rt_task param; | 35 | struct rt_task param; |
@@ -37,6 +37,7 @@ int sporadic_task(unsigned long e, unsigned long p, | |||
37 | param.period = p * NS_PER_MS; | 37 | param.period = p * NS_PER_MS; |
38 | param.cpu = cpu; | 38 | param.cpu = cpu; |
39 | param.cls = cls; | 39 | param.cls = cls; |
40 | param.phase = phase; | ||
40 | return set_rt_task_param(gettid(), ¶m); | 41 | return set_rt_task_param(gettid(), ¶m); |
41 | } | 42 | } |
42 | 43 | ||
diff --git a/src/syscalls.c b/src/syscalls.c index 1ad709b..625d8b6 100644 --- a/src/syscalls.c +++ b/src/syscalls.c | |||
@@ -96,3 +96,13 @@ int sched_getscheduler(pid_t pid) | |||
96 | { | 96 | { |
97 | return syscall(__NR_sched_getscheduler, pid); | 97 | return syscall(__NR_sched_getscheduler, pid); |
98 | } | 98 | } |
99 | |||
100 | int wait_for_ts_release(void) | ||
101 | { | ||
102 | return syscall(__NR_wait_for_ts_release); | ||
103 | } | ||
104 | |||
105 | int release_ts(lt_t *delay) | ||
106 | { | ||
107 | return syscall(__NR_release_ts, delay); | ||
108 | } | ||
@@ -42,10 +42,11 @@ int __create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period, | |||
42 | task_class_t class) | 42 | task_class_t class) |
43 | { | 43 | { |
44 | struct rt_task params; | 44 | struct rt_task params; |
45 | params.cpu = cpu; | 45 | params.cpu = cpu; |
46 | params.period = period; | 46 | params.period = period; |
47 | params.exec_cost = wcet; | 47 | params.exec_cost = wcet; |
48 | params.cls = class; | 48 | params.cls = class; |
49 | params.phase = 0; | ||
49 | return __launch_rt_task(rt_prog, arg, | 50 | return __launch_rt_task(rt_prog, arg, |
50 | (rt_setup_fn_t) set_rt_task_param, ¶ms); | 51 | (rt_setup_fn_t) set_rt_task_param, ¶ms); |
51 | } | 52 | } |