aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2007-11-15 21:32:09 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2007-11-15 21:32:09 -0500
commit0ba99fc3d11337493d81828357f70ec24da9443e (patch)
treebd21ae48b9f47e0ff9633db79dc2985e28d7d7a2 /src
parent99d81fbfc86fae7f5709e66a6c213195017f5627 (diff)
ABI Change: adapt to new LITMUS syscall interface and incorporate FDSO calls
This will break libso.
Diffstat (limited to 'src')
-rw-r--r--src/litmus.c72
1 files changed, 42 insertions, 30 deletions
diff --git a/src/litmus.c b/src/litmus.c
index 89f08cd..01acf73 100644
--- a/src/litmus.c
+++ b/src/litmus.c
@@ -1,13 +1,18 @@
1/* To get syscall() we need to define _GNU_SOURCE
2 * in modern glibc versions.
3 */
4#define _GNU_SOURCE
5#include <unistd.h>
1#include <stdlib.h> 6#include <stdlib.h>
2#include <stdio.h> 7#include <stdio.h>
3#include <string.h> 8#include <string.h>
4#include <sys/types.h> 9#include <sys/types.h>
5#include <unistd.h>
6#include <errno.h> 10#include <errno.h>
7#include <signal.h> 11#include <signal.h>
8#include <sys/mman.h> 12#include <sys/mman.h>
9 13
10 14
15
11#include "litmus.h" 16#include "litmus.h"
12 17
13 18
@@ -32,6 +37,12 @@ type name(type1 arg1,type2 arg2) \
32 return syscall(__NR_##name, arg1, arg2);\ 37 return syscall(__NR_##name, arg1, arg2);\
33} 38}
34 39
40#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
41type name(type1 arg1,type2 arg2, type3 arg3) \
42{\
43 return syscall(__NR_##name, arg1, arg2, arg3); \
44}
45
35 46
36/* clear the TID in the child */ 47/* clear the TID in the child */
37#define CLONE_CHILD_CLEARTID 0x00200000 48#define CLONE_CHILD_CLEARTID 0x00200000
@@ -281,26 +292,27 @@ void init_litmus(void)
281 292
282 293
283/* Litmus syscalls definitions */ 294/* Litmus syscalls definitions */
284#define __NR_sched_getpolicy 321 295#define __NR_sched_setpolicy 320
285#define __NR_set_rt_mode 322 296#define __NR_sched_getpolicy 321
286#define __NR_set_rt_task_param 323 297#define __NR_set_rt_mode 322
287#define __NR_get_rt_task_param 324 298#define __NR_set_rt_task_param 323
288#define __NR_prepare_rt_task 325 299#define __NR_get_rt_task_param 324
289#define __NR_sleep_next_period 327 300#define __NR_prepare_rt_task 325
290#define __NR_scheduler_setup 328 301#define __NR_sleep_next_period 326
291#define __NR_register_np_flag 329 302#define __NR_scheduler_setup 327
292#define __NR_signal_exit_np 330 303#define __NR_register_np_flag 328
293#define __NR_pi_sema_init 331 304#define __NR_signal_exit_np 329
294#define __NR_pi_down 332 305#define __NR_od_open 330
295#define __NR_pi_up 333 306#define __NR_od_close 331
296#define __NR_pi_sema_free 334 307#define __NR_pi_down 332
297#define __NR_srp_sema_init 339 308#define __NR_pi_up 333
298#define __NR_srp_down 340 309#define __NR_srp_down 334
299#define __NR_srp_up 341 310#define __NR_srp_up 335
300#define __NR_reg_task_srp_sem 342 311#define __NR_reg_task_srp_sem 336
301#define __NR_srp_sema_free 343 312#define __NR_get_job_no 337
302#define __NR_get_job_no 344 313#define __NR_wait_for_job_release 338
303#define __NR_wait_for_job_release 345 314#define __NR_set_service_levels 339
315#define __NR_get_cur_service_level 340
304 316
305 317
306/* Syscall stub for setting RT mode and scheduling options */ 318/* Syscall stub for setting RT mode and scheduling options */
@@ -313,15 +325,15 @@ _syscall0(int, sleep_next_period);
313_syscall2(int, scheduler_setup, int, cmd, void*, param); 325_syscall2(int, scheduler_setup, int, cmd, void*, param);
314_syscall1(int, register_np_flag, struct np_flag*, flag); 326_syscall1(int, register_np_flag, struct np_flag*, flag);
315_syscall0(int, signal_exit_np); 327_syscall0(int, signal_exit_np);
316_syscall0(int, pi_sema_init); 328
317_syscall1(int, pi_down, pi_sema_id, sem_id); 329_syscall3(int, od_open, int, fd, int, type, int, obj_id);
318_syscall1(int, pi_up, pi_sema_id, sem_id); 330_syscall1(int, od_close, int, od);
319_syscall1(int, pi_sema_free, pi_sema_id, sem_id); 331_syscall1(int, pi_down, int, od);
320_syscall0(int, srp_sema_init); 332_syscall1(int, pi_up, int, od);
321_syscall1(int, srp_down, srp_sema_id, sem_id); 333_syscall1(int, srp_down, int, od);
322_syscall1(int, srp_up, srp_sema_id, sem_id); 334_syscall1(int, srp_up, int, od);
323_syscall2(int, reg_task_srp_sem, srp_sema_id, sem_id, pid_t, t_pid); 335_syscall1(int, reg_task_srp_sem, int, od);
324_syscall1(int, srp_sema_free, srp_sema_id, sem_id); 336
325_syscall1(int, get_job_no, unsigned int*, job_no); 337_syscall1(int, get_job_no, unsigned int*, job_no);
326_syscall1(int, wait_for_job_release, unsigned int, job_no); 338_syscall1(int, wait_for_job_release, unsigned int, job_no);
327 339