1
/*
2
 * Libdl
3
 *  (C) Dario Faggioli <raistlin@linux.it>, 2009, 2010
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation version 2 of the License.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License (COPYING file) for more details.
13
 *
14
 */
15
16
#ifndef __DL_SYSCALLS__
17
#define __DL_SYSCALLS__
18
19
#include <linux/kernel.h>
20
#include <linux/unistd.h>
21
#include <linux/types.h>
22
#include <time.h>
23
24
#define SCHED_DEADLINE	6
25
26
/* XXX use the proper syscall numbers */
27
#ifdef __x86_64__
28
#define __NR_sched_setscheduler_ex	303
29
#define __NR_sched_setparam_ex		304
30
#define __NR_sched_getparam_ex		305
31
#define __NR_sched_wait_interval	306
32
#endif
33
34
#ifdef __i386__
35
#define __NR_sched_setscheduler_ex	341
36
#define __NR_sched_setparam_ex		342
37
#define __NR_sched_getparam_ex		343
38
#define __NR_sched_wait_interval	344
39
#endif
40
41
#ifdef __arm__
42
#define __NR_sched_setscheduler_ex	370
43
#define __NR_sched_setparam_ex		371
44
#define __NR_sched_getparam_ex		372
45
#define __NR_sched_wait_interval	373
46
#endif
47
48
#define SF_SIG_RORUN		2
49
#define SF_SIG_DMISS		4
50
#define SF_BWRECL_DL		8
51
#define SF_BWRECL_RT		16
52
#define SF_BWRECL_OTH		32
53
54
#define RLIMIT_DLDLINE		16
55
#define RLIMIT_DLRTIME		17
56
57
struct sched_param_ex {
58
	int sched_priority;
59
	struct timespec sched_runtime;
60
	struct timespec sched_deadline;
61
	struct timespec sched_period;
62
	unsigned int sched_flags;
63
	struct timespec curr_runtime;
64
	struct timespec used_runtime;
65
	struct timespec curr_deadline;
66
};
67
68
int sched_setscheduler_ex(pid_t pid, int policy, unsigned int len,
69
			  const struct sched_param_ex *param);
70
71
int sched_setparam_ex(pid_t pid, unsigned len,
72
		      const struct sched_param_ex *param);
73
74
int sched_getparam_ex(pid_t pid, unsigned len, struct sched_param_ex *param);
75
76
int sched_wait_interval(const struct timespec *rqtp, struct timespec *rmtp);
77
78
#endif /* __DL_SYSCALLS__ */