Xenomai  3.0-rc3
sched.h
1 /*
2  * Copyright (C) 2009 Philippe Gerum <rpm@xenomai.org>.
3  *
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.
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 for more details.
13  *
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.
17  */
18 #ifndef _COBALT_POSIX_SCHED_H
19 #define _COBALT_POSIX_SCHED_H
20 
21 #include <linux/list.h>
22 #include <cobalt/kernel/sched.h>
23 #include <xenomai/posix/syscall.h>
24 
25 struct cobalt_kqueues;
26 
27 struct cobalt_sched_group {
28 #ifdef CONFIG_XENO_OPT_SCHED_QUOTA
29  struct xnsched_quota_group quota;
30 #endif
31  struct cobalt_kqueues *kq;
32  int pshared;
33  struct list_head next;
34 };
35 
36 int __cobalt_sched_weightprio(int policy,
37  const struct sched_param_ex *param_ex);
38 
39 int __cobalt_sched_setconfig_np(int cpu, int policy,
40  void __user *u_config,
41  size_t len,
42  union sched_config *(*fetch_config)
43  (int policy, const void __user *u_config,
44  size_t *len),
45  int (*ack_config)(int policy,
46  const union sched_config *config,
47  void __user *u_config));
48 
49 ssize_t __cobalt_sched_getconfig_np(int cpu, int policy,
50  void __user *u_config,
51  size_t len,
52  union sched_config *(*fetch_config)
53  (int policy, const void __user *u_config,
54  size_t *len),
55  ssize_t (*put_config)(int policy,
56  void __user *u_config, size_t u_len,
57  const union sched_config *config,
58  size_t len));
59 struct xnsched_class *
60 cobalt_sched_policy_param(union xnsched_policy_param *param,
61  int u_policy, const struct sched_param_ex *param_ex,
62  xnticks_t *tslice_r);
63 
64 COBALT_SYSCALL_DECL(sched_yield, (void));
65 
66 COBALT_SYSCALL_DECL(sched_weightprio,
67  (int policy, const struct sched_param_ex __user *u_param));
68 
69 COBALT_SYSCALL_DECL(sched_minprio, (int policy));
70 
71 COBALT_SYSCALL_DECL(sched_maxprio, (int policy));
72 
73 COBALT_SYSCALL_DECL(sched_setconfig_np,
74  (int cpu,
75  int policy,
76  union sched_config __user *u_config,
77  size_t len));
78 
79 COBALT_SYSCALL_DECL(sched_getconfig_np,
80  (int cpu, int policy,
81  union sched_config __user *u_config,
82  size_t len));
83 
84 void cobalt_sched_cleanup(struct cobalt_kqueues *q);
85 
86 void cobalt_sched_pkg_init(void);
87 
88 void cobalt_sched_pkg_cleanup(void);
89 
90 #endif /* !_COBALT_POSIX_SCHED_H */
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