aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2008-02-19 15:48:59 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2008-02-19 15:48:59 -0500
commit8cea6a4d179628e96d8d012f7a7f18d112fdb060 (patch)
treeedbec8b5f4c91775f089c72a345096066fe8e5d6
parent2c1f329215e57a6f070cab21236b132b22ef80c2 (diff)
adapt to new ABI
-rw-r--r--Makefile4
-rw-r--r--include/litmus.h10
-rw-r--r--src/litmus.c3
-rw-r--r--src/syscalls.c10
-rw-r--r--src/task.c7
5 files changed, 25 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index ae187e0..8ac8f38 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
1KERNEL_DIR = ../q08 1KERNEL_DIR = ../litmus2008
2 2
3INC=-Iinclude/ -I${KERNEL_DIR}/include/ 3INC=-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
49check: 49check:
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 */
17int sporadic_task(unsigned long exec_cost, unsigned long period, 17int 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 */
26typedef enum { 26typedef enum {
@@ -74,4 +74,8 @@ task_class_t str2class(const char* str);
74void enter_np(void); 74void enter_np(void);
75void exit_np(void); 75void exit_np(void);
76 76
77/* task system support */
78int wait_for_ts_release(void);
79int 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
32int sporadic_task(unsigned long e, unsigned long p, 32int 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(), &param); 41 return set_rt_task_param(gettid(), &param);
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
100int wait_for_ts_release(void)
101{
102 return syscall(__NR_wait_for_ts_release);
103}
104
105int release_ts(lt_t *delay)
106{
107 return syscall(__NR_release_ts, delay);
108}
diff --git a/src/task.c b/src/task.c
index 0036efb..df12777 100644
--- a/src/task.c
+++ b/src/task.c
@@ -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, &params); 51 (rt_setup_fn_t) set_rt_task_param, &params);
51} 52}