diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-10-05 12:41:53 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-10-05 12:41:53 -0400 |
commit | 9de8f0850ce4b34a849384d119fc9e5a6f3f8d17 (patch) | |
tree | 236622c3b41231bb74507cd5e3b7f29d61170c43 /include | |
parent | 7ddb0d79edf783b5cf45af8052195df198788b07 (diff) |
Implement user space adaptive task launching interface.
Diffstat (limited to 'include')
-rw-r--r-- | include/adaptive.h | 23 | ||||
-rw-r--r-- | include/litmus.h | 8 |
2 files changed, 31 insertions, 0 deletions
diff --git a/include/adaptive.h b/include/adaptive.h new file mode 100644 index 0000000..a67c540 --- /dev/null +++ b/include/adaptive.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef ADAPTIVE_H | ||
2 | #define ADAPTIVE_H | ||
3 | |||
4 | #define MAX_SERVICE_LEVELS 10 | ||
5 | |||
6 | typedef struct { | ||
7 | unsigned long exec_cost; | ||
8 | unsigned long period; | ||
9 | /* fixed point */ | ||
10 | unsigned long utility; | ||
11 | } service_level_t; | ||
12 | |||
13 | int set_service_levels(pid_t pid, | ||
14 | unsigned int nr_levels, | ||
15 | service_level_t* levels); | ||
16 | |||
17 | int get_cur_service_level(void); | ||
18 | |||
19 | int create_adaptive_rt_task(rt_fn_t rt_prog, void *arg, | ||
20 | unsigned int no_levels, service_level_t* levels); | ||
21 | |||
22 | |||
23 | #endif | ||
diff --git a/include/litmus.h b/include/litmus.h index 3595919..01503aa 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #define CLONE_REALTIME 0x10000000 | 8 | #define CLONE_REALTIME 0x10000000 |
9 | 9 | ||
10 | typedef int (*rt_fn_t)(void*); | 10 | typedef int (*rt_fn_t)(void*); |
11 | typedef int (*rt_setup_fn_t)(int pid, void* arg); | ||
11 | 12 | ||
12 | /* Litmus scheduling policies */ | 13 | /* Litmus scheduling policies */ |
13 | typedef enum { | 14 | typedef enum { |
@@ -99,6 +100,7 @@ void init_litmus(void); | |||
99 | #define exit_litmus() {} | 100 | #define exit_litmus() {} |
100 | 101 | ||
101 | 102 | ||
103 | |||
102 | int create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period); | 104 | int create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period); |
103 | int __create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, | 105 | int __create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, |
104 | int period, task_class_t cls); | 106 | int period, task_class_t cls); |
@@ -111,4 +113,10 @@ void exit_np(void); | |||
111 | 113 | ||
112 | int litmus_task_active(); | 114 | int litmus_task_active(); |
113 | 115 | ||
116 | |||
117 | /* low level operations, not intended for API use */ | ||
118 | int fork_rt(void); | ||
119 | int __launch_rt_task(rt_fn_t rt_prog, void *rt_arg, | ||
120 | rt_setup_fn_t setup, void* setup_arg); | ||
121 | |||
114 | #endif | 122 | #endif |