ia64/xen-unstable

view xen/include/public/event_channel.h @ 19836:d9890e67d2b7

tools: add SHAREDIR to buildmakevars2file

c/s 19818 dropped SHAREDIR from xen/util/path.py, which broke the "xm
new" command. This patch adds SHAREDIR back to the new
buildmakevars2file-closure function.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:05:10 2009 +0100 (2009-06-25)
parents aaab04808ee7
children
line source
1 /******************************************************************************
2 * event_channel.h
3 *
4 * Event channels between domains.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 * Copyright (c) 2003-2004, K A Fraser.
25 */
27 #ifndef __XEN_PUBLIC_EVENT_CHANNEL_H__
28 #define __XEN_PUBLIC_EVENT_CHANNEL_H__
30 #include "xen.h"
32 /*
33 * Prototype for this hypercall is:
34 * int event_channel_op(int cmd, void *args)
35 * @cmd == EVTCHNOP_??? (event-channel operation).
36 * @args == Operation-specific extra arguments (NULL if none).
37 */
39 typedef uint32_t evtchn_port_t;
40 DEFINE_XEN_GUEST_HANDLE(evtchn_port_t);
42 /*
43 * EVTCHNOP_alloc_unbound: Allocate a port in domain <dom> and mark as
44 * accepting interdomain bindings from domain <remote_dom>. A fresh port
45 * is allocated in <dom> and returned as <port>.
46 * NOTES:
47 * 1. If the caller is unprivileged then <dom> must be DOMID_SELF.
48 * 2. <rdom> may be DOMID_SELF, allowing loopback connections.
49 */
50 #define EVTCHNOP_alloc_unbound 6
51 struct evtchn_alloc_unbound {
52 /* IN parameters */
53 domid_t dom, remote_dom;
54 /* OUT parameters */
55 evtchn_port_t port;
56 };
57 typedef struct evtchn_alloc_unbound evtchn_alloc_unbound_t;
59 /*
60 * EVTCHNOP_bind_interdomain: Construct an interdomain event channel between
61 * the calling domain and <remote_dom>. <remote_dom,remote_port> must identify
62 * a port that is unbound and marked as accepting bindings from the calling
63 * domain. A fresh port is allocated in the calling domain and returned as
64 * <local_port>.
65 * NOTES:
66 * 2. <remote_dom> may be DOMID_SELF, allowing loopback connections.
67 */
68 #define EVTCHNOP_bind_interdomain 0
69 struct evtchn_bind_interdomain {
70 /* IN parameters. */
71 domid_t remote_dom;
72 evtchn_port_t remote_port;
73 /* OUT parameters. */
74 evtchn_port_t local_port;
75 };
76 typedef struct evtchn_bind_interdomain evtchn_bind_interdomain_t;
78 /*
79 * EVTCHNOP_bind_virq: Bind a local event channel to VIRQ <irq> on specified
80 * vcpu.
81 * NOTES:
82 * 1. Virtual IRQs are classified as per-vcpu or global. See the VIRQ list
83 * in xen.h for the classification of each VIRQ.
84 * 2. Global VIRQs must be allocated on VCPU0 but can subsequently be
85 * re-bound via EVTCHNOP_bind_vcpu.
86 * 3. Per-vcpu VIRQs may be bound to at most one event channel per vcpu.
87 * The allocated event channel is bound to the specified vcpu and the
88 * binding cannot be changed.
89 */
90 #define EVTCHNOP_bind_virq 1
91 struct evtchn_bind_virq {
92 /* IN parameters. */
93 uint32_t virq;
94 uint32_t vcpu;
95 /* OUT parameters. */
96 evtchn_port_t port;
97 };
98 typedef struct evtchn_bind_virq evtchn_bind_virq_t;
100 /*
101 * EVTCHNOP_bind_pirq: Bind a local event channel to PIRQ <irq>.
102 * NOTES:
103 * 1. A physical IRQ may be bound to at most one event channel per domain.
104 * 2. Only a sufficiently-privileged domain may bind to a physical IRQ.
105 */
106 #define EVTCHNOP_bind_pirq 2
107 struct evtchn_bind_pirq {
108 /* IN parameters. */
109 uint32_t pirq;
110 #define BIND_PIRQ__WILL_SHARE 1
111 uint32_t flags; /* BIND_PIRQ__* */
112 /* OUT parameters. */
113 evtchn_port_t port;
114 };
115 typedef struct evtchn_bind_pirq evtchn_bind_pirq_t;
117 /*
118 * EVTCHNOP_bind_ipi: Bind a local event channel to receive events.
119 * NOTES:
120 * 1. The allocated event channel is bound to the specified vcpu. The binding
121 * may not be changed.
122 */
123 #define EVTCHNOP_bind_ipi 7
124 struct evtchn_bind_ipi {
125 uint32_t vcpu;
126 /* OUT parameters. */
127 evtchn_port_t port;
128 };
129 typedef struct evtchn_bind_ipi evtchn_bind_ipi_t;
131 /*
132 * EVTCHNOP_close: Close a local event channel <port>. If the channel is
133 * interdomain then the remote end is placed in the unbound state
134 * (EVTCHNSTAT_unbound), awaiting a new connection.
135 */
136 #define EVTCHNOP_close 3
137 struct evtchn_close {
138 /* IN parameters. */
139 evtchn_port_t port;
140 };
141 typedef struct evtchn_close evtchn_close_t;
143 /*
144 * EVTCHNOP_send: Send an event to the remote end of the channel whose local
145 * endpoint is <port>.
146 */
147 #define EVTCHNOP_send 4
148 struct evtchn_send {
149 /* IN parameters. */
150 evtchn_port_t port;
151 };
152 typedef struct evtchn_send evtchn_send_t;
154 /*
155 * EVTCHNOP_status: Get the current status of the communication channel which
156 * has an endpoint at <dom, port>.
157 * NOTES:
158 * 1. <dom> may be specified as DOMID_SELF.
159 * 2. Only a sufficiently-privileged domain may obtain the status of an event
160 * channel for which <dom> is not DOMID_SELF.
161 */
162 #define EVTCHNOP_status 5
163 struct evtchn_status {
164 /* IN parameters */
165 domid_t dom;
166 evtchn_port_t port;
167 /* OUT parameters */
168 #define EVTCHNSTAT_closed 0 /* Channel is not in use. */
169 #define EVTCHNSTAT_unbound 1 /* Channel is waiting interdom connection.*/
170 #define EVTCHNSTAT_interdomain 2 /* Channel is connected to remote domain. */
171 #define EVTCHNSTAT_pirq 3 /* Channel is bound to a phys IRQ line. */
172 #define EVTCHNSTAT_virq 4 /* Channel is bound to a virtual IRQ line */
173 #define EVTCHNSTAT_ipi 5 /* Channel is bound to a virtual IPI line */
174 uint32_t status;
175 uint32_t vcpu; /* VCPU to which this channel is bound. */
176 union {
177 struct {
178 domid_t dom;
179 } unbound; /* EVTCHNSTAT_unbound */
180 struct {
181 domid_t dom;
182 evtchn_port_t port;
183 } interdomain; /* EVTCHNSTAT_interdomain */
184 uint32_t pirq; /* EVTCHNSTAT_pirq */
185 uint32_t virq; /* EVTCHNSTAT_virq */
186 } u;
187 };
188 typedef struct evtchn_status evtchn_status_t;
190 /*
191 * EVTCHNOP_bind_vcpu: Specify which vcpu a channel should notify when an
192 * event is pending.
193 * NOTES:
194 * 1. IPI-bound channels always notify the vcpu specified at bind time.
195 * This binding cannot be changed.
196 * 2. Per-VCPU VIRQ channels always notify the vcpu specified at bind time.
197 * This binding cannot be changed.
198 * 3. All other channels notify vcpu0 by default. This default is set when
199 * the channel is allocated (a port that is freed and subsequently reused
200 * has its binding reset to vcpu0).
201 */
202 #define EVTCHNOP_bind_vcpu 8
203 struct evtchn_bind_vcpu {
204 /* IN parameters. */
205 evtchn_port_t port;
206 uint32_t vcpu;
207 };
208 typedef struct evtchn_bind_vcpu evtchn_bind_vcpu_t;
210 /*
211 * EVTCHNOP_unmask: Unmask the specified local event-channel port and deliver
212 * a notification to the appropriate VCPU if an event is pending.
213 */
214 #define EVTCHNOP_unmask 9
215 struct evtchn_unmask {
216 /* IN parameters. */
217 evtchn_port_t port;
218 };
219 typedef struct evtchn_unmask evtchn_unmask_t;
221 /*
222 * EVTCHNOP_reset: Close all event channels associated with specified domain.
223 * NOTES:
224 * 1. <dom> may be specified as DOMID_SELF.
225 * 2. Only a sufficiently-privileged domain may specify other than DOMID_SELF.
226 */
227 #define EVTCHNOP_reset 10
228 struct evtchn_reset {
229 /* IN parameters. */
230 domid_t dom;
231 };
232 typedef struct evtchn_reset evtchn_reset_t;
234 /*
235 * Argument to event_channel_op_compat() hypercall. Superceded by new
236 * event_channel_op() hypercall since 0x00030202.
237 */
238 struct evtchn_op {
239 uint32_t cmd; /* EVTCHNOP_* */
240 union {
241 struct evtchn_alloc_unbound alloc_unbound;
242 struct evtchn_bind_interdomain bind_interdomain;
243 struct evtchn_bind_virq bind_virq;
244 struct evtchn_bind_pirq bind_pirq;
245 struct evtchn_bind_ipi bind_ipi;
246 struct evtchn_close close;
247 struct evtchn_send send;
248 struct evtchn_status status;
249 struct evtchn_bind_vcpu bind_vcpu;
250 struct evtchn_unmask unmask;
251 } u;
252 };
253 typedef struct evtchn_op evtchn_op_t;
254 DEFINE_XEN_GUEST_HANDLE(evtchn_op_t);
256 #endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */
258 /*
259 * Local variables:
260 * mode: C
261 * c-set-style: "BSD"
262 * c-basic-offset: 4
263 * tab-width: 4
264 * indent-tabs-mode: nil
265 * End:
266 */