diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-11-15 21:32:09 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2007-11-15 21:32:09 -0500 |
commit | 0ba99fc3d11337493d81828357f70ec24da9443e (patch) | |
tree | bd21ae48b9f47e0ff9633db79dc2985e28d7d7a2 /src | |
parent | 99d81fbfc86fae7f5709e66a6c213195017f5627 (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.c | 72 |
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) \ | ||
41 | type 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 | ||