aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2007-11-19 19:49:49 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2007-11-19 19:49:49 -0500
commitcdac0068df6b97c30aec8ab6314465bbf80c3fa7 (patch)
tree5f9feeeaaacd632f674e0853638f148ee3597e17
parentd5e648be51bbcab442199c64fadd35c935c81620 (diff)
ICS/FDSO: new FDSO ABI and ICS ABI
update system call interface
-rw-r--r--include/litmus.h16
-rw-r--r--src/litmus.c15
2 files changed, 28 insertions, 3 deletions
diff --git a/include/litmus.h b/include/litmus.h
index 2aac46f..3a03a18 100644
--- a/include/litmus.h
+++ b/include/litmus.h
@@ -81,9 +81,14 @@ typedef enum {
81 SRP_SEM = 1, 81 SRP_SEM = 1,
82 ICS_ID = 2, 82 ICS_ID = 2,
83} obj_type_t; 83} obj_type_t;
84int od_open(int fd, obj_type_t type, int obj_id); 84int od_openx(int fd, obj_type_t type, int obj_id, void* config);
85int od_close(int od); 85int od_close(int od);
86 86
87static inline int od_open(int fd, obj_type_t type, int obj_id)
88{
89 return od_openx(fd, type, obj_id, 0);
90}
91
87/* FMLP support */ 92/* FMLP support */
88int pi_down(int od); 93int pi_down(int od);
89int pi_up(int od); 94int pi_up(int od);
@@ -97,6 +102,15 @@ int wait_for_job_release(unsigned int job_no);
97int sleep_next_period(void); 102int sleep_next_period(void);
98 103
99 104
105/* interruptible critical section support */
106#define MAX_ICS_NESTING 16
107#define ICS_END_OF_STACK (-2)
108
109/* ICS control block */
110struct ics_cb {
111 void* rollback_addr;
112 int ics_stack[MAX_ICS_NESTING];
113};
100 114
101 115
102 116
diff --git a/src/litmus.c b/src/litmus.c
index fe01e0e..15f7e55 100644
--- a/src/litmus.c
+++ b/src/litmus.c
@@ -43,6 +43,12 @@ type name(type1 arg1,type2 arg2, type3 arg3) \
43 return syscall(__NR_##name, arg1, arg2, arg3); \ 43 return syscall(__NR_##name, arg1, arg2, arg3); \
44} 44}
45 45
46#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4)\
47type name(type1 arg1,type2 arg2, type3 arg3, type4 arg4) \
48{\
49 return syscall(__NR_##name, arg1, arg2, arg3, arg4); \
50}
51
46 52
47/* clear the TID in the child */ 53/* clear the TID in the child */
48#define CLONE_CHILD_CLEARTID 0x00200000 54#define CLONE_CHILD_CLEARTID 0x00200000
@@ -302,7 +308,7 @@ void init_litmus(void)
302#define __NR_scheduler_setup 327 308#define __NR_scheduler_setup 327
303#define __NR_register_np_flag 328 309#define __NR_register_np_flag 328
304#define __NR_signal_exit_np 329 310#define __NR_signal_exit_np 329
305#define __NR_od_open 330 311#define __NR_od_openx 330
306#define __NR_od_close 331 312#define __NR_od_close 331
307#define __NR_pi_down 332 313#define __NR_pi_down 332
308#define __NR_pi_up 333 314#define __NR_pi_up 333
@@ -313,6 +319,8 @@ void init_litmus(void)
313#define __NR_wait_for_job_release 338 319#define __NR_wait_for_job_release 338
314#define __NR_set_service_levels 339 320#define __NR_set_service_levels 339
315#define __NR_get_cur_service_level 340 321#define __NR_get_cur_service_level 340
322#define __NR_reg_ics_cb 341
323#define __NR_start_wcs 342
316 324
317 325
318/* Syscall stub for setting RT mode and scheduling options */ 326/* Syscall stub for setting RT mode and scheduling options */
@@ -326,7 +334,8 @@ _syscall2(int, scheduler_setup, int, cmd, void*, param);
326_syscall1(int, register_np_flag, struct np_flag*, flag); 334_syscall1(int, register_np_flag, struct np_flag*, flag);
327_syscall0(int, signal_exit_np); 335_syscall0(int, signal_exit_np);
328 336
329_syscall3(int, od_open, int, fd, obj_type_t, type, int, obj_id); 337_syscall4(int, od_openx, int, fd, obj_type_t, type, int, obj_id,
338 void*, config);
330_syscall1(int, od_close, int, od); 339_syscall1(int, od_close, int, od);
331_syscall1(int, pi_down, int, od); 340_syscall1(int, pi_down, int, od);
332_syscall1(int, pi_up, int, od); 341_syscall1(int, pi_up, int, od);
@@ -337,3 +346,5 @@ _syscall1(int, reg_task_srp_sem, int, od);
337_syscall1(int, get_job_no, unsigned int*, job_no); 346_syscall1(int, get_job_no, unsigned int*, job_no);
338_syscall1(int, wait_for_job_release, unsigned int, job_no); 347_syscall1(int, wait_for_job_release, unsigned int, job_no);
339 348
349_syscall1(int, start_wcs, int, od);
350_syscall1(int, reg_ics_cb, struct ics_cb*, ics_cb);