1 /* SPDX-License-Identifier: ((GPL-2.0 WITH Lin << 2 /********************************************* 1 /****************************************************************************** 3 * evtchn.h 2 * evtchn.h 4 * 3 * 5 * Interface to /dev/xen/evtchn. 4 * Interface to /dev/xen/evtchn. 6 * 5 * 7 * Copyright (c) 2003-2005, K A Fraser 6 * Copyright (c) 2003-2005, K A Fraser 8 * 7 * 9 * This program is free software; you can redi 8 * This program is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Genera 9 * modify it under the terms of the GNU General Public License version 2 11 * as published by the Free Software Foundatio 10 * as published by the Free Software Foundation; or, when distributed 12 * separately from the Linux kernel or incorpo 11 * separately from the Linux kernel or incorporated into other 13 * software packages, subject to the following 12 * software packages, subject to the following license: 14 * 13 * 15 * Permission is hereby granted, free of charg 14 * Permission is hereby granted, free of charge, to any person obtaining a copy 16 * of this source file (the "Software"), to de 15 * of this source file (the "Software"), to deal in the Software without 17 * restriction, including without limitation t 16 * restriction, including without limitation the rights to use, copy, modify, 18 * merge, publish, distribute, sublicense, and 17 * merge, publish, distribute, sublicense, and/or sell copies of the Software, 19 * and to permit persons to whom the Software 18 * and to permit persons to whom the Software is furnished to do so, subject to 20 * the following conditions: 19 * the following conditions: 21 * 20 * 22 * The above copyright notice and this permiss 21 * The above copyright notice and this permission notice shall be included in 23 * all copies or substantial portions of the S 22 * all copies or substantial portions of the Software. 24 * 23 * 25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT W 24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE W 25 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINF 26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 27 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT 28 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 30 * FROM, OUT OF OR IN CONNECTION WITH THE SOFT 29 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 31 * IN THE SOFTWARE. 30 * IN THE SOFTWARE. 32 */ 31 */ 33 32 34 #ifndef __LINUX_PUBLIC_EVTCHN_H__ 33 #ifndef __LINUX_PUBLIC_EVTCHN_H__ 35 #define __LINUX_PUBLIC_EVTCHN_H__ 34 #define __LINUX_PUBLIC_EVTCHN_H__ 36 35 37 /* 36 /* 38 * Bind a fresh port to VIRQ @virq. 37 * Bind a fresh port to VIRQ @virq. 39 * Return allocated port. 38 * Return allocated port. 40 */ 39 */ 41 #define IOCTL_EVTCHN_BIND_VIRQ 40 #define IOCTL_EVTCHN_BIND_VIRQ \ 42 _IOC(_IOC_NONE, 'E', 0, sizeof(struct 41 _IOC(_IOC_NONE, 'E', 0, sizeof(struct ioctl_evtchn_bind_virq)) 43 struct ioctl_evtchn_bind_virq { 42 struct ioctl_evtchn_bind_virq { 44 unsigned int virq; 43 unsigned int virq; 45 }; 44 }; 46 45 47 /* 46 /* 48 * Bind a fresh port to remote <@remote_domain 47 * Bind a fresh port to remote <@remote_domain, @remote_port>. 49 * Return allocated port. 48 * Return allocated port. 50 */ 49 */ 51 #define IOCTL_EVTCHN_BIND_INTERDOMAIN 50 #define IOCTL_EVTCHN_BIND_INTERDOMAIN \ 52 _IOC(_IOC_NONE, 'E', 1, sizeof(struct 51 _IOC(_IOC_NONE, 'E', 1, sizeof(struct ioctl_evtchn_bind_interdomain)) 53 struct ioctl_evtchn_bind_interdomain { 52 struct ioctl_evtchn_bind_interdomain { 54 unsigned int remote_domain, remote_por 53 unsigned int remote_domain, remote_port; 55 }; 54 }; 56 55 57 /* 56 /* 58 * Allocate a fresh port for binding to @remot 57 * Allocate a fresh port for binding to @remote_domain. 59 * Return allocated port. 58 * Return allocated port. 60 */ 59 */ 61 #define IOCTL_EVTCHN_BIND_UNBOUND_PORT 60 #define IOCTL_EVTCHN_BIND_UNBOUND_PORT \ 62 _IOC(_IOC_NONE, 'E', 2, sizeof(struct 61 _IOC(_IOC_NONE, 'E', 2, sizeof(struct ioctl_evtchn_bind_unbound_port)) 63 struct ioctl_evtchn_bind_unbound_port { 62 struct ioctl_evtchn_bind_unbound_port { 64 unsigned int remote_domain; 63 unsigned int remote_domain; 65 }; 64 }; 66 65 67 /* 66 /* 68 * Unbind previously allocated @port. 67 * Unbind previously allocated @port. 69 */ 68 */ 70 #define IOCTL_EVTCHN_UNBIND 69 #define IOCTL_EVTCHN_UNBIND \ 71 _IOC(_IOC_NONE, 'E', 3, sizeof(struct 70 _IOC(_IOC_NONE, 'E', 3, sizeof(struct ioctl_evtchn_unbind)) 72 struct ioctl_evtchn_unbind { 71 struct ioctl_evtchn_unbind { 73 unsigned int port; 72 unsigned int port; 74 }; 73 }; 75 74 76 /* 75 /* 77 * Unbind previously allocated @port. 76 * Unbind previously allocated @port. 78 */ 77 */ 79 #define IOCTL_EVTCHN_NOTIFY 78 #define IOCTL_EVTCHN_NOTIFY \ 80 _IOC(_IOC_NONE, 'E', 4, sizeof(struct 79 _IOC(_IOC_NONE, 'E', 4, sizeof(struct ioctl_evtchn_notify)) 81 struct ioctl_evtchn_notify { 80 struct ioctl_evtchn_notify { 82 unsigned int port; 81 unsigned int port; 83 }; 82 }; 84 83 85 /* Clear and reinitialise the event buffer. Cl 84 /* Clear and reinitialise the event buffer. Clear error condition. */ 86 #define IOCTL_EVTCHN_RESET 85 #define IOCTL_EVTCHN_RESET \ 87 _IOC(_IOC_NONE, 'E', 5, 0) 86 _IOC(_IOC_NONE, 'E', 5, 0) 88 87 89 /* 88 /* 90 * Restrict this file descriptor so that it ca 89 * Restrict this file descriptor so that it can only be used to bind 91 * new interdomain events from one domain. 90 * new interdomain events from one domain. 92 * 91 * 93 * Once a file descriptor has been restricted 92 * Once a file descriptor has been restricted it cannot be 94 * de-restricted, and must be closed and re-op 93 * de-restricted, and must be closed and re-opened. Event channels 95 * which were bound before restricting remain 94 * which were bound before restricting remain bound afterwards, and 96 * can be notified as usual. 95 * can be notified as usual. 97 */ 96 */ 98 #define IOCTL_EVTCHN_RESTRICT_DOMID 97 #define IOCTL_EVTCHN_RESTRICT_DOMID \ 99 _IOC(_IOC_NONE, 'E', 6, sizeof(struct 98 _IOC(_IOC_NONE, 'E', 6, sizeof(struct ioctl_evtchn_restrict_domid)) 100 struct ioctl_evtchn_restrict_domid { 99 struct ioctl_evtchn_restrict_domid { 101 domid_t domid; 100 domid_t domid; 102 }; << 103 << 104 /* << 105 * Bind statically allocated @port. << 106 */ << 107 #define IOCTL_EVTCHN_BIND_STATIC << 108 _IOC(_IOC_NONE, 'E', 7, sizeof(struct << 109 struct ioctl_evtchn_bind { << 110 unsigned int port; << 111 }; 101 }; 112 102 113 #endif /* __LINUX_PUBLIC_EVTCHN_H__ */ 103 #endif /* __LINUX_PUBLIC_EVTCHN_H__ */ 114 104
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.