diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-02-03 01:09:48 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2008-02-03 01:09:48 -0500 |
commit | 2d507260ee723f8302c5c97a9bda1cf00f30ec99 (patch) | |
tree | 033231fa56c53c67916cbc1f1a05d9560ef1d4ab /include | |
parent | 526afdfb333ca29170fd210b08860ac2a4c141ed (diff) |
many changes
- use declarations from kernel
- get rid of stuipd system call macros
Diffstat (limited to 'include')
-rw-r--r-- | include/litmus.h | 36 | ||||
-rw-r--r-- | include/syscalls.h | 38 |
2 files changed, 7 insertions, 67 deletions
diff --git a/include/litmus.h b/include/litmus.h index 8918ae9..cf39f80 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -1,41 +1,16 @@ | |||
1 | #ifndef LITMUS_H | 1 | #ifndef LITMUS_H |
2 | #define LITMUS_H | 2 | #define LITMUS_H |
3 | 3 | ||
4 | #include <linux/rt_param.h> | ||
4 | #include <sys/types.h> | 5 | #include <sys/types.h> |
5 | 6 | ||
6 | /* A real-time program. */ | ||
7 | typedef int (*rt_fn_t)(void*); | ||
8 | |||
9 | /* different types of clients */ | ||
10 | typedef enum { | ||
11 | RT_CLASS_HARD, | ||
12 | RT_CLASS_SOFT, | ||
13 | RT_CLASS_BEST_EFFORT | ||
14 | } task_class_t; | ||
15 | |||
16 | /* Task RT params for schedulers */ | ||
17 | /* RT task parameters for scheduling extensions | ||
18 | * These parameters are inherited during clone and therefore must | ||
19 | * be explicitly set up before the task set is launched. | ||
20 | */ | ||
21 | typedef struct rt_param { | ||
22 | /* Execution cost */ | ||
23 | unsigned long exec_cost; | ||
24 | /* Period */ | ||
25 | unsigned long period; | ||
26 | /* Partition */ | ||
27 | unsigned int cpu; | ||
28 | /* type of task */ | ||
29 | task_class_t cls; | ||
30 | } rt_param_t; | ||
31 | |||
32 | typedef int pid_t; /* PID of a task */ | 7 | typedef int pid_t; /* PID of a task */ |
33 | 8 | ||
34 | /* obtain the PID of a thread */ | 9 | /* obtain the PID of a thread */ |
35 | pid_t gettid(void); | 10 | pid_t gettid(void); |
36 | 11 | ||
37 | int set_rt_task_param(pid_t pid, rt_param_t* param); | 12 | int set_rt_task_param(pid_t pid, struct rt_task* param); |
38 | int get_rt_task_param(pid_t pid, rt_param_t* param); | 13 | int get_rt_task_param(pid_t pid, struct rt_task* param); |
39 | 14 | ||
40 | /* setup helper */ | 15 | /* setup helper */ |
41 | int sporadic_task(unsigned long exec_cost, unsigned long period, | 16 | int sporadic_task(unsigned long exec_cost, unsigned long period, |
@@ -77,6 +52,9 @@ int init_litmus(void); | |||
77 | int init_rt_thread(void); | 52 | int init_rt_thread(void); |
78 | void exit_litmus(void); | 53 | void exit_litmus(void); |
79 | 54 | ||
55 | /* A real-time program. */ | ||
56 | typedef int (*rt_fn_t)(void*); | ||
57 | |||
80 | int create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period); | 58 | int create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period); |
81 | int __create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, | 59 | int __create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, |
82 | int period, task_class_t cls); | 60 | int period, task_class_t cls); |
@@ -88,7 +66,7 @@ enum rt_task_mode_t { | |||
88 | }; | 66 | }; |
89 | int task_mode(int target_mode); | 67 | int task_mode(int target_mode); |
90 | 68 | ||
91 | void show_rt_param(rt_param_t* tp); | 69 | void show_rt_param(struct rt_task* tp); |
92 | task_class_t str2class(const char* str); | 70 | task_class_t str2class(const char* str); |
93 | 71 | ||
94 | /* non-preemptive section support */ | 72 | /* non-preemptive section support */ |
diff --git a/include/syscalls.h b/include/syscalls.h deleted file mode 100644 index 28f1a39..0000000 --- a/include/syscalls.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | #ifndef SYSCALLS_H | ||
2 | #define SYSCALLS_H | ||
3 | |||
4 | /* this is missing in newer linux/unistd.h versions */ | ||
5 | |||
6 | #define _syscall0(type,name) \ | ||
7 | type name(void) \ | ||
8 | {\ | ||
9 | return syscall(__NR_##name);\ | ||
10 | } | ||
11 | |||
12 | #define _syscall1(type,name,type1,arg1) \ | ||
13 | type name(type1 arg1) \ | ||
14 | {\ | ||
15 | return syscall(__NR_##name, arg1);\ | ||
16 | } | ||
17 | |||
18 | |||
19 | #define _syscall2(type,name,type1,arg1,type2,arg2) \ | ||
20 | type name(type1 arg1,type2 arg2) \ | ||
21 | {\ | ||
22 | return syscall(__NR_##name, arg1, arg2);\ | ||
23 | } | ||
24 | |||
25 | #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ | ||
26 | type name(type1 arg1,type2 arg2, type3 arg3) \ | ||
27 | {\ | ||
28 | return syscall(__NR_##name, arg1, arg2, arg3); \ | ||
29 | } | ||
30 | |||
31 | #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4)\ | ||
32 | type name(type1 arg1,type2 arg2, type3 arg3, type4 arg4) \ | ||
33 | {\ | ||
34 | return syscall(__NR_##name, arg1, arg2, arg3, arg4); \ | ||
35 | } | ||
36 | |||
37 | |||
38 | #endif | ||