Xenomai  3.0-rc3
event.h
1 /*
2  * Copyright (C) 2012 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_EVENT_H
20 #define _COBALT_POSIX_EVENT_H
21 
22 #include <cobalt/kernel/synch.h>
23 #include <cobalt/uapi/event.h>
24 #include <xenomai/posix/syscall.h>
25 
26 struct cobalt_kqueues;
27 
28 struct cobalt_event {
29  unsigned int magic;
30  unsigned int value;
31  struct xnsynch synch;
32  struct cobalt_event_state *state;
33  struct cobalt_kqueues *owningq;
34  struct list_head link;
35  int flags;
36  xnhandle_t handle;
37 };
38 
39 int __cobalt_event_wait(struct cobalt_event_shadow __user *u_event,
40  unsigned int bits,
41  unsigned int __user *u_bits_r,
42  int mode, const struct timespec *ts);
43 
44 COBALT_SYSCALL_DECL(event_init,
45  (struct cobalt_event_shadow __user *u_evtsh,
46  unsigned int value,
47  int flags));
48 
49 COBALT_SYSCALL_DECL(event_wait,
50  (struct cobalt_event_shadow __user *u_evtsh,
51  unsigned int bits,
52  unsigned int __user *u_bits_r,
53  int mode,
54  const struct timespec __user *u_ts));
55 
56 COBALT_SYSCALL_DECL(event_sync,
57  (struct cobalt_event_shadow __user *u_evtsh));
58 
59 COBALT_SYSCALL_DECL(event_destroy,
60  (struct cobalt_event_shadow __user *u_evtsh));
61 
62 COBALT_SYSCALL_DECL(event_inquire,
63  (struct cobalt_event_shadow __user *u_event,
64  struct cobalt_event_info __user *u_info,
65  pid_t __user *u_waitlist,
66  size_t waitsz));
67 
68 void cobalt_eventq_cleanup(struct cobalt_kqueues *q);
69 
70 void cobalt_event_pkg_init(void);
71 
72 void cobalt_event_pkg_cleanup(void);
73 
74 #endif /* !_COBALT_POSIX_EVENT_H */