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