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