1186557Skmacy/******************************************************************************
2186557Skmacy * evtchn.h
3186557Skmacy *
4255040Sgibbs * Interface to /dev/xen/evtchn.
5186557Skmacy *
6255040Sgibbs * Copyright (c) 2003-2005, K A Fraser
7255040Sgibbs *
8255040Sgibbs * This file may be distributed separately from the Linux kernel, or
9255040Sgibbs * incorporated into other software packages, subject to the following license:
10255040Sgibbs *
11255040Sgibbs * Permission is hereby granted, free of charge, to any person obtaining a copy
12255040Sgibbs * of this source file (the "Software"), to deal in the Software without
13255040Sgibbs * restriction, including without limitation the rights to use, copy, modify,
14255040Sgibbs * merge, publish, distribute, sublicense, and/or sell copies of the Software,
15255040Sgibbs * and to permit persons to whom the Software is furnished to do so, subject to
16255040Sgibbs * the following conditions:
17255040Sgibbs *
18255040Sgibbs * The above copyright notice and this permission notice shall be included in
19255040Sgibbs * all copies or substantial portions of the Software.
20255040Sgibbs *
21255040Sgibbs * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22255040Sgibbs * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23255040Sgibbs * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24255040Sgibbs * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25255040Sgibbs * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26255040Sgibbs * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27255040Sgibbs * IN THE SOFTWARE.
28186557Skmacy *
29186557Skmacy * $FreeBSD$
30186557Skmacy */
31186557Skmacy
32255040Sgibbs#ifndef __XEN_EVTCHN_H__
33255040Sgibbs#define __XEN_EVTCHN_H__
34186557Skmacy
35186557Skmacy/*
36255040Sgibbs * Bind a fresh port to VIRQ @virq.
37186557Skmacy */
38255040Sgibbs#define IOCTL_EVTCHN_BIND_VIRQ				\
39255040Sgibbs	_IOWR('E', 4, struct ioctl_evtchn_bind_virq)
40255040Sgibbsstruct ioctl_evtchn_bind_virq {
41255040Sgibbs	unsigned int virq;
42255040Sgibbs	unsigned int port;
43255040Sgibbs};
44186557Skmacy
45186557Skmacy/*
46255040Sgibbs * Bind a fresh port to remote <@remote_domain, @remote_port>.
47186557Skmacy */
48255040Sgibbs#define IOCTL_EVTCHN_BIND_INTERDOMAIN			\
49255040Sgibbs	_IOWR('E', 5, struct ioctl_evtchn_bind_interdomain)
50255040Sgibbsstruct ioctl_evtchn_bind_interdomain {
51255040Sgibbs	unsigned int remote_domain, remote_port;
52255040Sgibbs	unsigned int port;
53255040Sgibbs};
54186557Skmacy
55255040Sgibbs/*
56255040Sgibbs * Allocate a fresh port for binding to @remote_domain.
57255040Sgibbs */
58255040Sgibbs#define IOCTL_EVTCHN_BIND_UNBOUND_PORT			\
59255040Sgibbs	_IOWR('E', 6, struct ioctl_evtchn_bind_unbound_port)
60255040Sgibbsstruct ioctl_evtchn_bind_unbound_port {
61255040Sgibbs	unsigned int remote_domain;
62255040Sgibbs	unsigned int port;
63255040Sgibbs};
64186557Skmacy
65186557Skmacy/*
66255040Sgibbs * Unbind previously allocated @port.
67186557Skmacy */
68255040Sgibbs#define IOCTL_EVTCHN_UNBIND				\
69255040Sgibbs	_IOW('E', 7, struct ioctl_evtchn_unbind)
70255040Sgibbsstruct ioctl_evtchn_unbind {
71255040Sgibbs	unsigned int port;
72255040Sgibbs};
73186557Skmacy
74186557Skmacy/*
75255040Sgibbs * Send event to previously allocated @port.
76186557Skmacy */
77255040Sgibbs#define IOCTL_EVTCHN_NOTIFY				\
78255040Sgibbs	_IOW('E', 8, struct ioctl_evtchn_notify)
79255040Sgibbsstruct ioctl_evtchn_notify {
80255040Sgibbs	unsigned int port;
81255040Sgibbs};
82186557Skmacy
83255040Sgibbs/* Clear and reinitialise the event buffer. Clear error condition. */
84255040Sgibbs#define IOCTL_EVTCHN_RESET				\
85255040Sgibbs	_IO('E', 9)
86186557Skmacy
87255040Sgibbs#endif /* __XEN_EVTCHN_H__ */
88