aboutsummaryrefslogtreecommitdiffstats
path: root/src/syscalls.c
blob: a42fc627621447fc7f08679609a5beb47d24c72b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* To get syscall() we need to define _GNU_SOURCE 
 * in modern glibc versions.
 */
#define _GNU_SOURCE
#include <unistd.h>

#include "litmus.h"

#include "syscalls.h"

struct np_flag;

/*	Litmus syscalls definitions */
#define __NR_sched_setpolicy 	320
#define __NR_sched_getpolicy 	321
#define __NR_set_rt_mode	322
#define __NR_set_rt_task_param	323
#define __NR_get_rt_task_param	324
#define __NR_sleep_next_period  326
#define __NR_scheduler_setup	327
#define __NR_register_np_flag   328
#define __NR_signal_exit_np     329
#define __NR_od_openx		330
#define __NR_od_close		331
#define __NR_pi_down		332
#define __NR_pi_up		333
#define __NR_srp_down		334
#define __NR_srp_up		335
#define __NR_reg_task_srp_sem	336
#define __NR_get_job_no		337
#define __NR_wait_for_job_release 	338
#define __NR_set_service_levels 	339
#define __NR_get_cur_service_level 	340
#define __NR_reg_ics_cb			341
#define __NR_start_wcs			342
#define __NR_task_mode		 	343

/*	Syscall stub for setting RT mode and scheduling options */
_syscall0(spolicy, sched_getpolicy);
_syscall1(int,     set_rt_mode,       int,         arg1);
_syscall2(int,     set_rt_task_param, pid_t,       pid,    rt_param_t*, arg1);
_syscall2(int,     get_rt_task_param, pid_t,       pid,    rt_param_t*, arg1);
_syscall0(int,     sleep_next_period);
_syscall2(int,     scheduler_setup,   int,         cmd,    void*,       param);
_syscall1(int,     register_np_flag, struct np_flag*, flag);
_syscall0(int,     signal_exit_np);

_syscall4(int,     od_openx,           int,  fd, obj_type_t, type, int, obj_id,
	  void*,   config);
_syscall1(int,     od_close,          int,  od);
_syscall1(int,     pi_down,           int,  od);
_syscall1(int,     pi_up,             int,  od);
_syscall1(int,     srp_down,          int,  od);
_syscall1(int,     srp_up,            int,  od);
_syscall1(int,     reg_task_srp_sem,  int,  od);

_syscall1(int,     get_job_no,      unsigned int*, job_no);
_syscall1(int,     wait_for_job_release, unsigned int, job_no);

_syscall1(int,     start_wcs,         int,  od);
_syscall1(int,     reg_ics_cb,        struct ics_cb*, ics_cb);
_syscall1(int,     task_mode, int, target_mode);