Xenomai  3.1
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 #pragma GCC system_header
19 #include_next <sched.h>
20 
21 #ifndef _COBALT_SCHED_H
22 #define _COBALT_SCHED_H
23 
24 #include <sys/types.h>
25 #include <cobalt/wrappers.h>
26 #include <cobalt/uapi/sched.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 COBALT_DECL(int, sched_yield(void));
33 
34 COBALT_DECL(int, sched_get_priority_min(int policy));
35 
36 COBALT_DECL(int, sched_get_priority_max(int policy));
37 
38 COBALT_DECL(int, sched_setscheduler(pid_t pid, int policy,
39  const struct sched_param *param));
40 
41 COBALT_DECL(int, sched_getscheduler(pid_t pid));
42 
43 int sched_get_priority_min_ex(int policy);
44 
45 int sched_get_priority_max_ex(int policy);
46 
47 int sched_setscheduler_ex(pid_t pid, int policy,
48  const struct sched_param_ex *param_ex);
49 
50 int sched_getscheduler_ex(pid_t pid, int *policy_r,
51  struct sched_param_ex *param_ex);
52 
53 int sched_setconfig_np(int cpu, int policy,
54  const union sched_config *config, size_t len);
55 
56 ssize_t sched_getconfig_np(int cpu, int policy,
57  union sched_config *config, size_t *len_r);
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
63 #endif /* !_COBALT_SCHED_H */
ssize_t sched_getconfig_np(int cpu, int policy, union sched_config *config, size_t *len_r)
Retrieve CPU-specific scheduler settings for a policy
Definition: sched.c:630
int sched_yield(void)
Yield the processor.
Definition: sched.c:58
int sched_get_priority_min(int policy)
Get minimum priority of the specified scheduling policy.
Definition: sched.c:90
int sched_getscheduler(pid_t pid)
Get the scheduling policy of the specified process.
Definition: sched.c:360
int sched_setscheduler_ex(pid_t pid, int policy, const struct sched_param_ex *param_ex)
Set extended scheduling policy of a process
Definition: sched.c:294
int sched_get_priority_max(int policy)
Get maximum priority of the specified scheduling policy.
Definition: sched.c:169
int sched_getscheduler_ex(pid_t pid, int *policy_r, struct sched_param_ex *param_ex)
Get extended scheduling policy of a process
Definition: sched.c:411
int sched_get_priority_max_ex(int policy)
Get extended maximum priority of the specified scheduling policy.
Definition: sched.c:440
int sched_get_priority_min_ex(int policy)
Get extended minimum priority of the specified scheduling policy.
Definition: sched.c:131
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param)
Set the scheduling policy and parameters of the specified process.
Definition: sched.c:231
int sched_setconfig_np(int cpu, int policy, const union sched_config *config, size_t len)
Set CPU-specific scheduler settings for a policy
Definition: sched.c:572