Xenomai  3.0.8
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_resources;
26 struct cobalt_process;
27 
28 struct cobalt_sched_group {
29 #ifdef CONFIG_XENO_OPT_SCHED_QUOTA
30  struct xnsched_quota_group quota;
31 #endif
32  struct cobalt_resources *scope;
33  int pshared;
34  struct list_head next;
35 };
36 
37 int __cobalt_sched_weightprio(int policy,
38  const struct sched_param_ex *param_ex);
39 
40 int __cobalt_sched_setconfig_np(int cpu, int policy,
41  void __user *u_config,
42  size_t len,
43  union sched_config *(*fetch_config)
44  (int policy, const void __user *u_config,
45  size_t *len),
46  int (*ack_config)(int policy,
47  const union sched_config *config,
48  void __user *u_config));
49 
50 ssize_t __cobalt_sched_getconfig_np(int cpu, int policy,
51  void __user *u_config,
52  size_t len,
53  union sched_config *(*fetch_config)
54  (int policy, const void __user *u_config,
55  size_t *len),
56  ssize_t (*put_config)(int policy,
57  void __user *u_config, size_t u_len,
58  const union sched_config *config,
59  size_t len));
60 int cobalt_sched_setscheduler_ex(pid_t pid,
61  int policy,
62  const struct sched_param_ex *param_ex,
63  __u32 __user *u_winoff,
64  int __user *u_promoted);
65 
66 int cobalt_sched_getscheduler_ex(pid_t pid,
67  int *policy_r,
68  struct sched_param_ex *param_ex);
69 
70 struct xnsched_class *
71 cobalt_sched_policy_param(union xnsched_policy_param *param,
72  int u_policy, const struct sched_param_ex *param_ex,
73  xnticks_t *tslice_r);
74 
75 COBALT_SYSCALL_DECL(sched_yield, (void));
76 
77 COBALT_SYSCALL_DECL(sched_weightprio,
78  (int policy, const struct sched_param_ex __user *u_param));
79 
80 COBALT_SYSCALL_DECL(sched_minprio, (int policy));
81 
82 COBALT_SYSCALL_DECL(sched_maxprio, (int policy));
83 
84 COBALT_SYSCALL_DECL(sched_setconfig_np,
85  (int cpu,
86  int policy,
87  union sched_config __user *u_config,
88  size_t len));
89 
90 COBALT_SYSCALL_DECL(sched_getconfig_np,
91  (int cpu, int policy,
92  union sched_config __user *u_config,
93  size_t len));
94 
95 COBALT_SYSCALL_DECL(sched_setscheduler_ex,
96  (pid_t pid,
97  int policy,
98  const struct sched_param_ex __user *u_param,
99  __u32 __user *u_winoff,
100  int __user *u_promoted));
101 
102 COBALT_SYSCALL_DECL(sched_getscheduler_ex,
103  (pid_t pid,
104  int __user *u_policy,
105  struct sched_param_ex __user *u_param));
106 
107 void cobalt_sched_reclaim(struct cobalt_process *process);
108 
109 #endif /* !_COBALT_POSIX_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:598
int sched_yield(void)
Yield the processor.
Definition: sched.c:58
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:279
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:382
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:541