Xenomai 3.3.2
Loading...
Searching...
No Matches
cond.h
1/*
2 * Written by Gilles Chanteperdrix <gilles.chanteperdrix@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_COND_H
19#define _COBALT_POSIX_COND_H
20
21#include <linux/types.h>
22#include <linux/time.h>
23#include <linux/list.h>
24#include <cobalt/kernel/synch.h>
25#include <cobalt/uapi/thread.h>
26#include <cobalt/uapi/cond.h>
27#include <xenomai/posix/syscall.h>
28#include <xenomai/posix/process.h>
29
30struct cobalt_mutex;
31
32struct cobalt_cond {
33 unsigned int magic;
34 struct xnsynch synchbase;
35 struct list_head mutex_link;
36 struct cobalt_cond_state *state;
37 struct cobalt_condattr attr;
38 struct cobalt_mutex *mutex;
39 struct cobalt_resnode resnode;
40};
41
42int __cobalt_cond_wait_prologue(struct cobalt_cond_shadow __user *u_cnd,
43 struct cobalt_mutex_shadow __user *u_mx,
44 int __user *u_err,
45 void __user *u_ts,
46 int (*fetch_timeout)(struct timespec64 *ts,
47 const void __user *u_ts));
48
49COBALT_SYSCALL_DECL(cond_init,
50 (struct cobalt_cond_shadow __user *u_cnd,
51 const struct cobalt_condattr __user *u_attr));
52
53COBALT_SYSCALL_DECL(cond_destroy,
54 (struct cobalt_cond_shadow __user *u_cnd));
55
56COBALT_SYSCALL_DECL(cond_wait_prologue,
57 (struct cobalt_cond_shadow __user *u_cnd,
58 struct cobalt_mutex_shadow __user *u_mx,
59 int __user *u_err,
60 unsigned int timed,
61 struct __kernel_old_timespec __user *u_ts));
62
63COBALT_SYSCALL_DECL(cond_wait_prologue64,
64 (struct cobalt_cond_shadow __user *u_cnd,
65 struct cobalt_mutex_shadow __user *u_mx,
66 int __user *u_err,
67 unsigned int timed,
68 struct __kernel_timespec __user *u_ts));
69
70COBALT_SYSCALL_DECL(cond_wait_epilogue,
71 (struct cobalt_cond_shadow __user *u_cnd,
72 struct cobalt_mutex_shadow __user *u_mx));
73
74int cobalt_cond_deferred_signals(struct cobalt_cond *cond);
75
76void cobalt_cond_reclaim(struct cobalt_resnode *node,
77 spl_t s);
78
79#endif /* !_COBALT_POSIX_COND_H */