bfin: remove inline keyword
[xenomai-head.git] / include / posix / sched.h
blob71403d5535ef6c480d2687666f93a0bc61cd1c08
1 /*
2 * Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
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 for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 #ifndef _XENO_POSIX_SCHED_H
20 #define _XENO_POSIX_SCHED_H
22 #if defined(__KERNEL__) || defined(__XENO_SIM__)
24 #include <nucleus/xenomai.h>
26 #ifdef __KERNEL__
27 #include <linux/sched.h>
28 #endif /* __KERNEL__ */
30 #ifdef __XENO_SIM__
31 #include <posix_overrides.h>
32 #define SCHED_FIFO 1
33 #define SCHED_RR 2
34 #endif /* __XENO_SIM__ */
36 #define SCHED_OTHER 0
38 struct timespec;
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
44 int sched_yield(void);
46 int sched_get_priority_min(int policy);
48 int sched_get_priority_max(int policy);
50 int sched_rr_get_interval(int pid, struct timespec *interval);
52 #ifdef __cplusplus
54 #endif
56 #else /* !(__KERNEL__ || __XENO_SIM__) */
58 #pragma GCC system_header
60 #include_next <sched.h>
62 int __real_sched_yield(void);
64 #endif /* !(__KERNEL__ || __XENO_SIM__) */
66 #ifndef __sched_extensions_defined
67 #define __sched_extensions_defined
69 #ifndef SCHED_SPORADIC
70 #define SCHED_SPORADIC 10
71 #define sched_ss_low_priority sched_u.ss.__sched_low_priority
72 #define sched_ss_repl_period sched_u.ss.__sched_repl_period
73 #define sched_ss_init_budget sched_u.ss.__sched_init_budget
74 #define sched_ss_max_repl sched_u.ss.__sched_max_repl
75 #endif /* !SCHED_SPORADIC */
77 struct __sched_ss_param {
78 int __sched_low_priority;
79 struct timespec __sched_repl_period;
80 struct timespec __sched_init_budget;
81 int __sched_max_repl;
84 #ifndef SCHED_TP
85 #define SCHED_TP 11
86 #define sched_tp_partition sched_u.tp.__sched_partition
87 #endif /* !SCHED_TP */
89 struct __sched_tp_param {
90 int __sched_partition;
93 struct sched_param_ex {
94 int sched_priority;
95 union {
96 struct __sched_ss_param ss;
97 struct __sched_tp_param tp;
98 } sched_u;
101 struct sched_tp_window {
102 struct timespec offset;
103 struct timespec duration;
104 int ptid;
107 struct __sched_config_tp {
108 int nr_windows;
109 struct sched_tp_window windows[];
112 union sched_config {
113 struct __sched_config_tp tp;
116 #define sched_tp_confsz(nr_win) \
117 (sizeof(struct __sched_config_tp) + nr_win * sizeof(struct sched_tp_window))
119 #ifdef __cplusplus
120 extern "C" {
121 #endif
123 int sched_setconfig_np(int cpu, int policy,
124 union sched_config *config, size_t len);
126 #ifdef __cplusplus
128 #endif
130 #endif /* __sched_extensions_defined */
132 #endif /* SCHED_H */