aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2008-01-22 17:23:49 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2008-01-22 17:23:49 -0500
commite0a05caf790c5493b83ff6a060175a24b3317258 (patch)
tree910921deaba42708f7b57bdfb15349f3394b95be /include
parentbacbb6f22c19f3e3bd41401b0743eabb7f3f2e94 (diff)
core: cleanup header
Diffstat (limited to 'include')
-rw-r--r--include/litmus.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/include/litmus.h b/include/litmus.h
index 1bffd12..794db1a 100644
--- a/include/litmus.h
+++ b/include/litmus.h
@@ -3,12 +3,8 @@
3 3
4#include <sys/types.h> 4#include <sys/types.h>
5 5
6/* This flag is needed to start new RT tasks in STOPPED state */ 6/* A real-time program. */
7/* Task is going to run in realtime mode */
8#define CLONE_REALTIME 0x10000000
9
10typedef int (*rt_fn_t)(void*); 7typedef int (*rt_fn_t)(void*);
11typedef int (*rt_setup_fn_t)(int pid, void* arg);
12 8
13/* Litmus scheduling policies */ 9/* Litmus scheduling policies */
14typedef enum { 10typedef enum {
@@ -59,6 +55,7 @@ int set_rt_task_param(pid_t pid, rt_param_t* param);
59int get_rt_task_param(pid_t pid, rt_param_t* param); 55int get_rt_task_param(pid_t pid, rt_param_t* param);
60int prepare_rt_task(pid_t pid); 56int prepare_rt_task(pid_t pid);
61 57
58/* setup helper */
62int sporadic_task(unsigned long exec_cost, unsigned long period, 59int sporadic_task(unsigned long exec_cost, unsigned long period,
63 int partition, task_class_t cls); 60 int partition, task_class_t cls);
64 61
@@ -68,20 +65,19 @@ int sporadic_task(unsigned long exec_cost, unsigned long period,
68 sporadic_task(e, p, cpu, RT_CLASS_SOFT) 65 sporadic_task(e, p, cpu, RT_CLASS_SOFT)
69 66
70 67
68/* deprecated */
71enum { 69enum {
72 LITMUS_RESERVED_RANGE = 1024, 70 LITMUS_RESERVED_RANGE = 1024,
73} SCHED_SETUP_CMD; 71} SCHED_SETUP_CMD;
74
75int scheduler_setup(int cmd, void* param); 72int scheduler_setup(int cmd, void* param);
76 73
77
78/* file descriptor attached shared objects support */ 74/* file descriptor attached shared objects support */
79
80typedef enum { 75typedef enum {
81 PI_SEM = 0, 76 PI_SEM = 0,
82 SRP_SEM = 1, 77 SRP_SEM = 1,
83 ICS_ID = 2, 78 ICS_ID = 2,
84} obj_type_t; 79} obj_type_t;
80
85int od_openx(int fd, obj_type_t type, int obj_id, void* config); 81int od_openx(int fd, obj_type_t type, int obj_id, void* config);
86int od_close(int od); 82int od_close(int od);
87 83
@@ -102,7 +98,6 @@ int get_job_no(unsigned int* job_no);
102int wait_for_job_release(unsigned int job_no); 98int wait_for_job_release(unsigned int job_no);
103int sleep_next_period(void); 99int sleep_next_period(void);
104 100
105
106/* interruptible critical section support */ 101/* interruptible critical section support */
107#define MAX_ICS_NESTING 16 102#define MAX_ICS_NESTING 16
108#define ICS_STACK_EMPTY (-1) 103#define ICS_STACK_EMPTY (-1)
@@ -131,8 +126,6 @@ struct ics_cb {
131int reg_ics_cb(struct ics_cb* ics_cb); 126int reg_ics_cb(struct ics_cb* ics_cb);
132int start_wcs(int od); 127int start_wcs(int od);
133 128
134
135
136/* library functions */ 129/* library functions */
137void init_litmus(void); 130void init_litmus(void);
138/* exit is currently unused, but was needed for syscall 131/* exit is currently unused, but was needed for syscall
@@ -141,13 +134,10 @@ void init_litmus(void);
141 */ 134 */
142#define exit_litmus() {} 135#define exit_litmus() {}
143 136
144
145
146int create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period); 137int create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, int period);
147int __create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet, 138int __create_rt_task(rt_fn_t rt_prog, void *arg, int cpu, int wcet,
148 int period, task_class_t cls); 139 int period, task_class_t cls);
149 140
150
151/* per-task modes */ 141/* per-task modes */
152enum rt_task_mode_t { 142enum rt_task_mode_t {
153 BACKGROUND_TASK = 0, 143 BACKGROUND_TASK = 0,
@@ -155,19 +145,24 @@ enum rt_task_mode_t {
155}; 145};
156int task_mode(int target_mode); 146int task_mode(int target_mode);
157 147
158
159const char* get_scheduler_name(spolicy scheduler); 148const char* get_scheduler_name(spolicy scheduler);
160void show_rt_param(rt_param_t* tp); 149void show_rt_param(rt_param_t* tp);
161task_class_t str2class(const char* str); 150task_class_t str2class(const char* str);
162 151
152/* non-preemptive section support */
163void enter_np(void); 153void enter_np(void);
164void exit_np(void); 154void exit_np(void);
165 155
156/* Returns 1 if the task is still active.
157 * Use it for main job loop.
158 */
166int litmus_task_active(); 159int litmus_task_active();
167 160
168 161
169/* low level operations, not intended for API use */ 162/* low level operations, not intended for API use */
170int fork_rt(void); 163
164/* prepare a real-time task */
165typedef int (*rt_setup_fn_t)(int pid, void* arg);
171int __launch_rt_task(rt_fn_t rt_prog, void *rt_arg, 166int __launch_rt_task(rt_fn_t rt_prog, void *rt_arg,
172 rt_setup_fn_t setup, void* setup_arg); 167 rt_setup_fn_t setup, void* setup_arg);
173 168