xref: /netbsd-src/sys/arch/xen/include/xenio3.h (revision ba65fde2d7fefa7d39838fa5fa855e62bd606b5e)
1 /* $NetBSD: xenio3.h,v 1.3 2010/09/03 06:07:24 cegger Exp $ */
2 /******************************************************************************
3  * evtchn.h
4  *
5  * Interface to /dev/xen/evtchn.
6  *
7  * Copyright (c) 2003-2005, K A Fraser
8  *
9  * This file may be distributed separately from the Linux kernel, or
10  * incorporated into other software packages, subject to the following license:
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a copy
13  * of this source file (the "Software"), to deal in the Software without
14  * restriction, including without limitation the rights to use, copy, modify,
15  * merge, publish, distribute, sublicense, and/or sell copies of the Software,
16  * and to permit persons to whom the Software is furnished to do so, subject to
17  * the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be included in
20  * all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
28  * IN THE SOFTWARE.
29  */
30 
31 #ifndef __XEN_XENIO3_H__
32 #define __XEN_XENIO3_H__
33 
34 /*
35  * Bind a fresh port to VIRQ @virq.
36  * Return allocated port.
37  */
38 #define IOCTL_EVTCHN_BIND_VIRQ				\
39 	_IOWR('E', 4, struct ioctl_evtchn_bind_virq)
40 struct ioctl_evtchn_bind_virq {
41 	unsigned int virq;
42 	unsigned int port;
43 };
44 
45 /*
46  * Bind a fresh port to remote <@remote_domain, @remote_port>.
47  * Return allocated port.
48  */
49 #define IOCTL_EVTCHN_BIND_INTERDOMAIN			\
50 	_IOWR('E', 5, struct ioctl_evtchn_bind_interdomain)
51 struct ioctl_evtchn_bind_interdomain {
52 	unsigned int remote_domain, remote_port;
53 	unsigned int port;
54 };
55 
56 /*
57  * Allocate a fresh port for binding to @remote_domain.
58  * Return allocated port.
59  */
60 #define IOCTL_EVTCHN_BIND_UNBOUND_PORT			\
61 	_IOWR('E', 6, struct ioctl_evtchn_bind_unbound_port)
62 struct ioctl_evtchn_bind_unbound_port {
63 	unsigned int remote_domain;
64 	unsigned int port;
65 };
66 
67 /*
68  * Unbind previously allocated @port.
69  */
70 #define IOCTL_EVTCHN_UNBIND				\
71 	_IOW('E', 7, struct ioctl_evtchn_unbind)
72 struct ioctl_evtchn_unbind {
73 	unsigned int port;
74 };
75 
76 /*
77  * Send event to previously allocated @port.
78  */
79 #define IOCTL_EVTCHN_NOTIFY				\
80 	_IOW('E', 8, struct ioctl_evtchn_notify)
81 struct ioctl_evtchn_notify {
82 	unsigned int port;
83 };
84 
85 /* Clear and reinitialise the event buffer. Clear error condition. */
86 #define IOCTL_EVTCHN_RESET				\
87 	_IO('E', 9)
88 
89 #endif /* __XEN_XENIO3_H__ */
90