event.h 2.54 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * Copyright (C) 2012 Philippe Gerum <rpm@xenomai.org>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

19
20
#ifndef _COBALT_POSIX_EVENT_H
#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
28
struct cobalt_resources;
struct cobalt_process;
29
30
31

struct cobalt_event {
	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
40
41
int __cobalt_event_wait(struct cobalt_event_shadow __user *u_event,
			unsigned int bits,
			unsigned int __user *u_bits_r,
42
			int mode, const struct timespec64 *ts);
43

44
45
46
47
48
int __cobalt_event_wait64(struct cobalt_event_shadow __user *u_event,
			  unsigned int bits, unsigned int __user *u_bits_r,
			  int mode,
			  const struct __kernel_timespec __user *u_ts);

49
COBALT_SYSCALL_DECL(event_init,
50
51
52
		    (struct cobalt_event_shadow __user *u_evtsh,
		     unsigned int value,
		     int flags));
53

54
COBALT_SYSCALL_DECL(event_wait,
55
56
57
58
		    (struct cobalt_event_shadow __user *u_evtsh,
		     unsigned int bits,
		     unsigned int __user *u_bits_r,
		     int mode,
59
		     const struct __user_old_timespec __user *u_ts));
60

61
62
63
64
65
66
67
COBALT_SYSCALL_DECL(event_wait64,
		    (struct cobalt_event_shadow __user *u_evtsh,
		     unsigned int bits,
		     unsigned int __user *u_bits_r,
		     int mode,
		     const struct __kernel_timespec __user *u_ts));

68
COBALT_SYSCALL_DECL(event_sync,
69
		    (struct cobalt_event_shadow __user *u_evtsh));
70

71
COBALT_SYSCALL_DECL(event_destroy,
72
		    (struct cobalt_event_shadow __user *u_evtsh));
73

74
COBALT_SYSCALL_DECL(event_inquire,
75
76
77
78
		    (struct cobalt_event_shadow __user *u_event,
		     struct cobalt_event_info __user *u_info,
		     pid_t __user *u_waitlist,
		     size_t waitsz));
79

80
81
void cobalt_event_reclaim(struct cobalt_resnode *node,
			  spl_t s);
82

83
#endif /* !_COBALT_POSIX_EVENT_H */