Xenomai  3.0-rc3
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 COBALT_DECL(int, sched_yield(void));
29 
30 COBALT_DECL(int, sched_get_priority_min(int policy));
31 
32 COBALT_DECL(int, sched_get_priority_max(int policy));
33 
34 #ifndef CPU_COUNT
35 #define CPU_COUNT(__setp) __PROVIDE_CPU_COUNT(__setp)
36 #define __PROVIDE_CPU_COUNT(__setp) __sched_cpucount(sizeof(cpu_set_t), __setp)
37 int __sched_cpucount(size_t __setsize, const cpu_set_t *__setp);
38 #endif /* !CPU_COUNT */
39 
40 #ifndef CPU_FILL
41 #define CPU_FILL(__setp) __PROVIDE_CPU_FILL(__setp)
42 #define __PROVIDE_CPU_FILL(__setp) __sched_cpufill(sizeof(cpu_set_t), __setp)
43 void __sched_cpufill(size_t __setsize, cpu_set_t *__setp);
44 #endif /* !CPU_COUNT */
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 int sched_get_priority_min_ex(int policy);
51 
52 int sched_get_priority_max_ex(int policy);
53 
54 int sched_setconfig_np(int cpu, int policy,
55  const union sched_config *config, size_t len);
56 
57 ssize_t sched_getconfig_np(int cpu, int policy,
58  union sched_config *config, size_t *len_r);
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
64 #endif /* !_COBALT_SCHED_H */
int sched_get_priority_max_ex(int policy)
Get extended maximum priority of the specified scheduling policy.
Definition: thread.c:906
int sched_yield(void)
Yield the processor.
Definition: thread.c:772
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: thread.c:1075
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: thread.c:1020
int sched_get_priority_max(int policy)
Get maximum priority of the specified scheduling policy.
Definition: thread.c:868
int sched_get_priority_min(int policy)
Get minimum priority of the specified scheduling policy.
Definition: thread.c:798
int sched_get_priority_min_ex(int policy)
Get extended minimum priority of the specified scheduling policy.
Definition: thread.c:836