Xenomai 3.3.2
Loading...
Searching...
No Matches
sched.h
1/*
2 * Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library 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 GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17 */
18#ifndef _COBALT_UAPI_SCHED_H
19#define _COBALT_UAPI_SCHED_H
20
21#include <cobalt/uapi/kernel/types.h>
22
23#define SCHED_COBALT 42
24#define SCHED_WEAK 43
25
26#ifndef SCHED_SPORADIC
27#define SCHED_SPORADIC 10
28#define sched_ss_low_priority sched_u.ss.__sched_low_priority
29#define sched_ss_repl_period sched_u.ss.__sched_repl_period
30#define sched_ss_init_budget sched_u.ss.__sched_init_budget
31#define sched_ss_max_repl sched_u.ss.__sched_max_repl
32#endif /* !SCHED_SPORADIC */
33
34struct __sched_ss_param {
35 __s32 __sched_low_priority;
36 int: 32;
37 struct xn_ts64 __sched_repl_period;
38 struct xn_ts64 __sched_init_budget;
39 __s32 __sched_max_repl;
40 int: 32;
41};
42
43#define sched_rr_quantum sched_u.rr.__sched_rr_quantum
44
45struct __sched_rr_param {
46 struct xn_ts64 __sched_rr_quantum;
47};
48
49#ifndef SCHED_TP
50#define SCHED_TP 11
51#define sched_tp_partition sched_u.tp.__sched_partition
52#endif /* !SCHED_TP */
53
54struct __sched_tp_param {
55 __s32 __sched_partition;
56};
57
58struct sched_tp_window {
59 struct xn_ts64 offset;
60 struct xn_ts64 duration;
61 __s32 ptid;
62 int: 32;
63};
64
65enum {
66 sched_tp_install,
67 sched_tp_uninstall,
68 sched_tp_start,
69 sched_tp_stop,
70};
71
72struct __sched_config_tp {
73 __s32 op;
74 __s32 nr_windows;
75 struct sched_tp_window windows[0];
76};
77
78#define sched_tp_confsz(nr_win) \
79 (sizeof(struct __sched_config_tp) + nr_win * sizeof(struct sched_tp_window))
80
81#ifndef SCHED_QUOTA
82#define SCHED_QUOTA 12
83#define sched_quota_group sched_u.quota.__sched_group
84#endif /* !SCHED_QUOTA */
85
86struct __sched_quota_param {
87 __s32 __sched_group;
88};
89
90enum {
91 sched_quota_add,
92 sched_quota_remove,
93 sched_quota_force_remove,
94 sched_quota_set,
95 sched_quota_get,
96};
97
98struct __sched_config_quota {
99 __s32 op;
100 union {
101 struct {
102 __s32 pshared;
103 } add;
104 struct {
105 __s32 tgid;
106 } remove;
107 struct {
108 __s32 tgid;
109 __s32 quota;
110 __s32 quota_peak;
111 } set;
112 struct {
113 __s32 tgid;
114 } get;
115 };
116 struct __sched_quota_info {
117 __s32 tgid;
118 __s32 quota;
119 __s32 quota_peak;
120 __s32 quota_sum;
121 } info;
122};
123
124#define sched_quota_confsz() sizeof(struct __sched_config_quota)
125
126struct sched_param_ex {
127 __s32 sched_priority;
128 int: 32;
129 union {
130 struct __sched_ss_param ss;
131 struct __sched_rr_param rr;
132 struct __sched_tp_param tp;
133 struct __sched_quota_param quota;
134 } sched_u;
135};
136
137union sched_config {
138 struct __sched_config_tp tp;
139 struct __sched_config_quota quota;
140};
141
142#endif /* !_COBALT_UAPI_SCHED_H */