Xenomai  3.1
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 #include <xenomai/posix/process.h>
26 
27 struct cobalt_resources;
28 struct cobalt_process;
29 
30 struct cobalt_event {
31  unsigned int magic;
32  unsigned int value;
33  int flags;
34  struct xnsynch synch;
35  struct cobalt_event_state *state;
36  struct cobalt_resnode resnode;
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_event_reclaim(struct cobalt_resnode *node,
69  spl_t s);
70 
71 #endif /* !_COBALT_POSIX_EVENT_H */