Xenomai  3.1
syscall32.h
1 /*
2  * Copyright (C) 2014 Philippe Gerum <rpm@xenomai.org>
3  *
4  * Xenomai is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * Xenomai is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * 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_SYSCALL32_H
19 #define _COBALT_POSIX_SYSCALL32_H
20 
21 #include <cobalt/kernel/compat.h>
22 
23 struct cobalt_mutex_shadow;
24 struct cobalt_event_shadow;
25 struct cobalt_cond_shadow;
26 struct cobalt_sem_shadow;
27 struct cobalt_monitor_shadow;
28 
29 COBALT_SYSCALL32emu_DECL(thread_create,
30  (compat_ulong_t pth,
31  int policy,
32  const struct compat_sched_param_ex __user *u_param_ex,
33  int xid,
34  __u32 __user *u_winoff));
35 
36 COBALT_SYSCALL32emu_DECL(thread_setschedparam_ex,
37  (compat_ulong_t pth,
38  int policy,
39  const struct compat_sched_param_ex __user *u_param,
40  __u32 __user *u_winoff,
41  int __user *u_promoted));
42 
43 COBALT_SYSCALL32emu_DECL(thread_getschedparam_ex,
44  (compat_ulong_t pth,
45  int __user *u_policy,
46  struct compat_sched_param_ex __user *u_param));
47 
48 COBALT_SYSCALL32emu_DECL(thread_setschedprio,
49  (compat_ulong_t pth,
50  int prio,
51  __u32 __user *u_winoff,
52  int __user *u_promoted));
53 
54 COBALT_SYSCALL32emu_DECL(clock_getres,
55  (clockid_t clock_id,
56  struct compat_timespec __user *u_ts));
57 
58 COBALT_SYSCALL32emu_DECL(clock_gettime,
59  (clockid_t clock_id,
60  struct compat_timespec __user *u_ts));
61 
62 COBALT_SYSCALL32emu_DECL(clock_settime,
63  (clockid_t clock_id,
64  const struct compat_timespec __user *u_ts));
65 
66 COBALT_SYSCALL32emu_DECL(clock_adjtime,
67  (clockid_t clock_id,
68  struct compat_timex __user *u_tx));
69 
70 COBALT_SYSCALL32emu_DECL(clock_nanosleep,
71  (clockid_t clock_id, int flags,
72  const struct compat_timespec __user *u_rqt,
73  struct compat_timespec __user *u_rmt));
74 
75 COBALT_SYSCALL32emu_DECL(mutex_timedlock,
76  (struct cobalt_mutex_shadow __user *u_mx,
77  const struct compat_timespec __user *u_ts));
78 
79 COBALT_SYSCALL32emu_DECL(cond_wait_prologue,
80  (struct cobalt_cond_shadow __user *u_cnd,
81  struct cobalt_mutex_shadow __user *u_mx,
82  int *u_err,
83  unsigned int timed,
84  struct compat_timespec __user *u_ts));
85 
86 COBALT_SYSCALL32emu_DECL(mq_open,
87  (const char __user *u_name, int oflags,
88  mode_t mode, struct compat_mq_attr __user *u_attr));
89 
90 COBALT_SYSCALL32emu_DECL(mq_getattr,
91  (mqd_t uqd, struct compat_mq_attr __user *u_attr));
92 
93 COBALT_SYSCALL32emu_DECL(mq_timedsend,
94  (mqd_t uqd, const void __user *u_buf, size_t len,
95  unsigned int prio,
96  const struct compat_timespec __user *u_ts));
97 
98 COBALT_SYSCALL32emu_DECL(mq_timedreceive,
99  (mqd_t uqd, void __user *u_buf,
100  compat_ssize_t __user *u_len,
101  unsigned int __user *u_prio,
102  const struct compat_timespec __user *u_ts));
103 
104 COBALT_SYSCALL32x_DECL(mq_timedreceive,
105  (mqd_t uqd, void __user *u_buf,
106  compat_ssize_t __user *u_len,
107  unsigned int __user *u_prio,
108  const struct timespec __user *u_ts));
109 
110 COBALT_SYSCALL32emu_DECL(mq_notify,
111  (mqd_t fd, const struct compat_sigevent *__user u_cev));
112 
113 COBALT_SYSCALL32emu_DECL(sched_weightprio,
114  (int policy,
115  const struct compat_sched_param_ex __user *u_param));
116 
117 COBALT_SYSCALL32emu_DECL(sched_setconfig_np,
118  (int cpu, int policy,
119  union compat_sched_config __user *u_config,
120  size_t len));
121 
122 COBALT_SYSCALL32emu_DECL(sched_getconfig_np,
123  (int cpu, int policy,
124  union compat_sched_config __user *u_config,
125  size_t len));
126 
127 COBALT_SYSCALL32emu_DECL(sched_setscheduler_ex,
128  (compat_pid_t pid,
129  int policy,
130  const struct compat_sched_param_ex __user *u_param,
131  __u32 __user *u_winoff,
132  int __user *u_promoted));
133 
134 COBALT_SYSCALL32emu_DECL(sched_getscheduler_ex,
135  (compat_pid_t pid,
136  int __user *u_policy,
137  struct compat_sched_param_ex __user *u_param));
138 
139 COBALT_SYSCALL32emu_DECL(timer_create,
140  (clockid_t clock,
141  const struct compat_sigevent __user *u_sev,
142  timer_t __user *u_tm));
143 
144 COBALT_SYSCALL32emu_DECL(timer_settime,
145  (timer_t tm, int flags,
146  const struct compat_itimerspec __user *u_newval,
147  struct compat_itimerspec __user *u_oldval));
148 
149 COBALT_SYSCALL32emu_DECL(timer_gettime,
150  (timer_t tm,
151  struct compat_itimerspec __user *u_val));
152 
153 COBALT_SYSCALL32emu_DECL(timerfd_settime,
154  (int fd, int flags,
155  const struct compat_itimerspec __user *new_value,
156  struct compat_itimerspec __user *old_value));
157 
158 COBALT_SYSCALL32emu_DECL(timerfd_gettime,
159  (int fd, struct compat_itimerspec __user *value));
160 
161 COBALT_SYSCALL32emu_DECL(sigwait,
162  (const compat_sigset_t __user *u_set,
163  int __user *u_sig));
164 
165 COBALT_SYSCALL32emu_DECL(sigtimedwait,
166  (const compat_sigset_t __user *u_set,
167  struct compat_siginfo __user *u_si,
168  const struct compat_timespec __user *u_timeout));
169 
170 COBALT_SYSCALL32emu_DECL(sigwaitinfo,
171  (const compat_sigset_t __user *u_set,
172  struct compat_siginfo __user *u_si));
173 
174 COBALT_SYSCALL32emu_DECL(sigpending,
175  (compat_old_sigset_t __user *u_set));
176 
177 COBALT_SYSCALL32emu_DECL(sigqueue,
178  (pid_t pid, int sig,
179  const union compat_sigval __user *u_value));
180 
181 COBALT_SYSCALL32emu_DECL(monitor_wait,
182  (struct cobalt_monitor_shadow __user *u_mon,
183  int event, const struct compat_timespec __user *u_ts,
184  int __user *u_ret));
185 
186 COBALT_SYSCALL32emu_DECL(event_wait,
187  (struct cobalt_event_shadow __user *u_event,
188  unsigned int bits,
189  unsigned int __user *u_bits_r,
190  int mode, const struct compat_timespec __user *u_ts));
191 
192 COBALT_SYSCALL32emu_DECL(select,
193  (int nfds,
194  compat_fd_set __user *u_rfds,
195  compat_fd_set __user *u_wfds,
196  compat_fd_set __user *u_xfds,
197  struct compat_timeval __user *u_tv));
198 
199 COBALT_SYSCALL32emu_DECL(recvmsg,
200  (int fd, struct compat_msghdr __user *umsg,
201  int flags));
202 
203 COBALT_SYSCALL32emu_DECL(recvmmsg,
204  (int fd, struct compat_mmsghdr __user *u_msgvec,
205  unsigned int vlen,
206  unsigned int flags, struct compat_timespec *u_timeout));
207 
208 COBALT_SYSCALL32emu_DECL(sendmsg,
209  (int fd, struct compat_msghdr __user *umsg,
210  int flags));
211 
212 COBALT_SYSCALL32emu_DECL(sendmmsg,
213  (int fd, struct compat_mmsghdr __user *u_msgvec, unsigned int vlen,
214  unsigned int flags));
215 
216 COBALT_SYSCALL32emu_DECL(mmap,
217  (int fd,
218  struct compat_rtdm_mmap_request __user *u_rma,
219  compat_uptr_t __user *u_addrp));
220 
221 COBALT_SYSCALL32emu_DECL(backtrace,
222  (int nr, compat_ulong_t __user *u_backtrace,
223  int reason));
224 
225 COBALT_SYSCALL32emu_DECL(sem_open,
226  (compat_uptr_t __user *u_addrp,
227  const char __user *u_name,
228  int oflags, mode_t mode, unsigned int value));
229 
230 COBALT_SYSCALL32emu_DECL(sem_timedwait,
231  (struct cobalt_sem_shadow __user *u_sem,
232  struct compat_timespec __user *u_ts));
233 
234 #endif /* !_COBALT_POSIX_SYSCALL32_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 timer_create(clockid_t clockid, const struct sigevent *__restrict__ evp, timer_t *__restrict__ timerid)
Create a timer
Definition: timer.c:75
int clock_getres(clockid_t clock_id, struct timespec *tp)
Get the resolution of the specified clock.
Definition: clock.c:101
int mq_getattr(mqd_t qd, struct mq_attr *attr)
Get message queue attributes
Definition: mq.c:226
int timer_gettime(timer_t timerid, struct itimerspec *value)
Get timer next expiration date and reload value.
Definition: timer.c:212
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 timer_settime(timer_t timerid, int flags, const struct itimerspec *__restrict__ value, struct itimerspec *__restrict__ ovalue)
Start or stop a timer
Definition: timer.c:168
int mq_notify(mqd_t q, const struct sigevent *evp)
Enable notification on message arrival
Definition: mq.c:576
int clock_settime(clockid_t clock_id, const struct timespec *tp)
Set the specified clock.
Definition: clock.c:239
int mq_timedsend(mqd_t q, const char *buffer, size_t len, unsigned prio, const struct timespec *timeout)
Attempt, during a bounded time, to send a message to a message queue.
Definition: mq.c:393
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
mqd_t mq_open(const char *name, int oflags,...)
Open a message queue
Definition: mq.c:105
ssize_t mq_timedreceive(mqd_t q, char *__restrict__ buffer, size_t len, unsigned *__restrict__ prio, const struct timespec *__restrict__ timeout)
Attempt, during a bounded time, to receive a message from a message queue.
Definition: mq.c:518
int clock_gettime(clockid_t clock_id, struct timespec *tp)
Read the specified clock.
Definition: clock.c:183
int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp)
Sleep some amount of time.
Definition: clock.c:311
int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout)
Attempt to decrement a semaphore with a time limit
Definition: semaphore.c:371
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