Xenomai 3.3.2
Loading...
Searching...
No Matches
monitor.h
1/*
2 * Copyright (C) 2011 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
19#ifndef _COBALT_POSIX_MONITOR_H
20#define _COBALT_POSIX_MONITOR_H
21
22#include <cobalt/kernel/synch.h>
23#include <cobalt/uapi/monitor.h>
24#include <xenomai/posix/syscall.h>
25#include <xenomai/posix/process.h>
26
27struct cobalt_resources;
28struct cobalt_process;
29
30struct cobalt_monitor {
31 unsigned int magic;
32 struct xnsynch gate;
33 struct xnsynch drain;
34 struct cobalt_monitor_state *state;
35 struct list_head waiters;
36 int flags;
37 xntmode_t tmode;
38 struct cobalt_resnode resnode;
39};
40
41int __cobalt_monitor_wait(struct cobalt_monitor_shadow __user *u_mon,
42 int event, const struct timespec64 *ts,
43 int __user *u_ret);
44
45COBALT_SYSCALL_DECL(monitor_init,
46 (struct cobalt_monitor_shadow __user *u_monsh,
47 clockid_t clk_id,
48 int flags));
49
50COBALT_SYSCALL_DECL(monitor_enter,
51 (struct cobalt_monitor_shadow __user *u_monsh));
52
53COBALT_SYSCALL_DECL(monitor_sync,
54 (struct cobalt_monitor_shadow __user *u_monsh));
55
56COBALT_SYSCALL_DECL(monitor_exit,
57 (struct cobalt_monitor_shadow __user *u_monsh));
58
59COBALT_SYSCALL_DECL(monitor_wait,
60 (struct cobalt_monitor_shadow __user *u_monsh,
61 int event, const struct __kernel_old_timespec __user *u_ts,
62 int __user *u_ret));
63
64COBALT_SYSCALL_DECL(monitor_wait64,
65 (struct cobalt_monitor_shadow __user *u_monsh, int event,
66 const struct __kernel_timespec __user *u_ts,
67 int __user *u_ret));
68
69COBALT_SYSCALL_DECL(monitor_destroy,
70 (struct cobalt_monitor_shadow __user *u_monsh));
71
72void cobalt_monitor_reclaim(struct cobalt_resnode *node,
73 spl_t s);
74
75#endif /* !_COBALT_POSIX_MONITOR_H */