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