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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
/* To get syscall() we need to define _GNU_SOURCE
* in modern glibc versions.
*/
/* imported from the kernel source tree */
#include "asm/unistd.h"
/* for syscall() */
#include <unistd.h>
//#include <sys/types.h>
#include "litmus.h"
/* Syscall stub for setting RT mode and scheduling options */
pid_t gettid(void)
{
return syscall(__NR_gettid);
}
int set_rt_task_param(pid_t pid, struct rt_task *param)
{
return syscall(__NR_set_rt_task_param, pid, param);
}
int get_rt_task_param(pid_t pid, struct rt_task *param)
{
return syscall(__NR_get_rt_task_param, pid, param);
}
int sleep_next_period(void)
{
return syscall(__NR_complete_job);
}
int od_openx(int fd, obj_type_t type, int obj_id, void *config)
{
return syscall(__NR_od_open, fd, type, obj_id, config);
}
int od_close(int od)
{
return syscall(__NR_od_close, od);
}
int fmlp_down(int od)
{
return syscall(__NR_fmlp_down, od);
}
int fmlp_up(int od)
{
return syscall(__NR_fmlp_up, od);
}
int srp_down(int od)
{
return syscall(__NR_srp_down, od);
}
int srp_up(int od)
{
return syscall(__NR_srp_up, od);
}
int get_job_no(unsigned int *job_no)
{
return syscall(__NR_query_job_no, job_no);
}
int wait_for_job_release(unsigned int job_no)
{
return syscall(__NR_wait_for_job_release, job_no);
}
int sched_setscheduler(pid_t pid, int policy, int* priority)
{
return syscall(__NR_sched_setscheduler, pid, policy, priority);
}
int sched_getscheduler(pid_t pid)
{
return syscall(__NR_sched_getscheduler, pid);
}
int wait_for_ts_release(void)
{
return syscall(__NR_wait_for_ts_release);
}
int release_ts(lt_t *delay)
{
return syscall(__NR_release_ts, delay);
}
int null_call(cycles_t *timestamp)
{
return syscall(__NR_null_call, timestamp);
}
|