xref: /titanic_41/usr/src/uts/common/xen/sys/evtchn.h (revision 843e19887f64dde75055cf8842fc4db2171eff45)
1*843e1988Sjohnlev /******************************************************************************
2*843e1988Sjohnlev  * evtchn.h
3*843e1988Sjohnlev  *
4*843e1988Sjohnlev  * Interface to /dev/xen/evtchn.
5*843e1988Sjohnlev  *
6*843e1988Sjohnlev  * Copyright (c) 2003-2005, K A Fraser
7*843e1988Sjohnlev  *
8*843e1988Sjohnlev  * This file may be distributed separately from the Linux kernel, or
9*843e1988Sjohnlev  * incorporated into other software packages, subject to the following license:
10*843e1988Sjohnlev  *
11*843e1988Sjohnlev  * Permission is hereby granted, free of charge, to any person obtaining a copy
12*843e1988Sjohnlev  * of this source file (the "Software"), to deal in the Software without
13*843e1988Sjohnlev  * restriction, including without limitation the rights to use, copy, modify,
14*843e1988Sjohnlev  * merge, publish, distribute, sublicense, and/or sell copies of the Software,
15*843e1988Sjohnlev  * and to permit persons to whom the Software is furnished to do so, subject to
16*843e1988Sjohnlev  * the following conditions:
17*843e1988Sjohnlev  *
18*843e1988Sjohnlev  * The above copyright notice and this permission notice shall be included in
19*843e1988Sjohnlev  * all copies or substantial portions of the Software.
20*843e1988Sjohnlev  *
21*843e1988Sjohnlev  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22*843e1988Sjohnlev  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23*843e1988Sjohnlev  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24*843e1988Sjohnlev  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25*843e1988Sjohnlev  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26*843e1988Sjohnlev  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27*843e1988Sjohnlev  * IN THE SOFTWARE.
28*843e1988Sjohnlev  */
29*843e1988Sjohnlev 
30*843e1988Sjohnlev /*
31*843e1988Sjohnlev  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
32*843e1988Sjohnlev  * Use is subject to license terms.
33*843e1988Sjohnlev  */
34*843e1988Sjohnlev 
35*843e1988Sjohnlev #ifndef _XEN_SYS_EVTCHN_H
36*843e1988Sjohnlev #define _XEN_SYS_EVTCHN_H
37*843e1988Sjohnlev 
38*843e1988Sjohnlev #pragma ident	"%Z%%M%	%I%	%E% SMI"
39*843e1988Sjohnlev 
40*843e1988Sjohnlev #define	_IOC_NONE	0
41*843e1988Sjohnlev #define	_IOC(flag, letter, inum, size)	((letter) << 8 | (inum))
42*843e1988Sjohnlev 
43*843e1988Sjohnlev /*
44*843e1988Sjohnlev  * Bind a fresh port to VIRQ @virq.
45*843e1988Sjohnlev  * Return allocated port.
46*843e1988Sjohnlev  */
47*843e1988Sjohnlev #define IOCTL_EVTCHN_BIND_VIRQ				\
48*843e1988Sjohnlev 	_IOC(_IOC_NONE, 'E', 0, sizeof(struct ioctl_evtchn_bind_virq))
49*843e1988Sjohnlev struct ioctl_evtchn_bind_virq {
50*843e1988Sjohnlev 	unsigned int virq;
51*843e1988Sjohnlev };
52*843e1988Sjohnlev 
53*843e1988Sjohnlev /*
54*843e1988Sjohnlev  * Bind a fresh port to remote <@remote_domain, @remote_port>.
55*843e1988Sjohnlev  * Return allocated port.
56*843e1988Sjohnlev  */
57*843e1988Sjohnlev #define IOCTL_EVTCHN_BIND_INTERDOMAIN			\
58*843e1988Sjohnlev 	_IOC(_IOC_NONE, 'E', 1, sizeof(struct ioctl_evtchn_bind_interdomain))
59*843e1988Sjohnlev struct ioctl_evtchn_bind_interdomain {
60*843e1988Sjohnlev 	unsigned int remote_domain, remote_port;
61*843e1988Sjohnlev };
62*843e1988Sjohnlev 
63*843e1988Sjohnlev /*
64*843e1988Sjohnlev  * Allocate a fresh port for binding to @remote_domain.
65*843e1988Sjohnlev  * Return allocated port.
66*843e1988Sjohnlev  */
67*843e1988Sjohnlev #define IOCTL_EVTCHN_BIND_UNBOUND_PORT                  \
68*843e1988Sjohnlev         _IOC(_IOC_NONE, 'E', 2, sizeof(struct ioctl_evtchn_bind_unbound_port))
69*843e1988Sjohnlev struct ioctl_evtchn_bind_unbound_port {
70*843e1988Sjohnlev         unsigned int remote_domain;
71*843e1988Sjohnlev };
72*843e1988Sjohnlev 
73*843e1988Sjohnlev /*
74*843e1988Sjohnlev  * Unbind previously allocated @port.
75*843e1988Sjohnlev  */
76*843e1988Sjohnlev #define IOCTL_EVTCHN_UNBIND				\
77*843e1988Sjohnlev 	_IOC(_IOC_NONE, 'E', 3, sizeof(struct ioctl_evtchn_unbind))
78*843e1988Sjohnlev struct ioctl_evtchn_unbind {
79*843e1988Sjohnlev 	unsigned int port;
80*843e1988Sjohnlev };
81*843e1988Sjohnlev 
82*843e1988Sjohnlev /*
83*843e1988Sjohnlev  * Notify the given @port.
84*843e1988Sjohnlev  */
85*843e1988Sjohnlev #define IOCTL_EVTCHN_NOTIFY				\
86*843e1988Sjohnlev 	_IOC(_IOC_NONE, 'E', 4, sizeof(struct ioctl_evtchn_notify))
87*843e1988Sjohnlev struct ioctl_evtchn_notify {
88*843e1988Sjohnlev 	unsigned int port;
89*843e1988Sjohnlev };
90*843e1988Sjohnlev 
91*843e1988Sjohnlev #endif /* _XEN_SYS_EVTCHN_H */
92*843e1988Sjohnlev 
93*843e1988Sjohnlev /*
94*843e1988Sjohnlev  * Local variables:
95*843e1988Sjohnlev  *  c-file-style: "solaris"
96*843e1988Sjohnlev  *  indent-tabs-mode: t
97*843e1988Sjohnlev  *  c-indent-level: 8
98*843e1988Sjohnlev  *  c-basic-offset: 8
99*843e1988Sjohnlev  *  tab-width: 8
100*843e1988Sjohnlev  * End:
101*843e1988Sjohnlev  */
102