1 /******************************************************************************
4 * Event channels between domains.
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:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
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.
24 * Copyright (c) 2003-2004, K A Fraser.
27 #ifndef __XEN_PUBLIC_EVENT_CHANNEL_H__
28 #define __XEN_PUBLIC_EVENT_CHANNEL_H__
33 * `incontents 150 evtchn Event Channels
35 * Event channels are the basic primitive provided by Xen for event
36 * notifications. An event is the Xen equivalent of a hardware
37 * interrupt. They essentially store one bit of information, the event
38 * of interest is signalled by transitioning this bit from 0 to 1.
40 * Notifications are received by a guest via an upcall from Xen,
41 * indicating when an event arrives (setting the bit). Further
42 * notifications are masked until the bit is cleared again (therefore,
43 * guests must check the value of the bit after re-enabling event
44 * delivery to ensure no missed notifications).
46 * Event notifications can be masked by setting a flag; this is
47 * equivalent to disabling interrupts and can be used to ensure
48 * atomicity of certain operations in the guest kernel.
50 * Event channels are represented by the evtchn_* fields in
51 * struct shared_info and struct vcpu_info.
56 * ` HYPERVISOR_event_channel_op(enum event_channel_op cmd, VOID *args)
58 * @cmd == EVTCHNOP_* (event-channel operation).
59 * @args == struct evtchn_* Operation-specific extra arguments (NULL if none).
62 /* ` enum event_channel_op { // EVTCHNOP_* => struct evtchn_* */
63 #define EVTCHNOP_close 3
64 #define EVTCHNOP_send 4
65 #define EVTCHNOP_alloc_unbound 6
68 typedef UINT32 evtchn_port_t
;
69 DEFINE_XEN_GUEST_HANDLE(evtchn_port_t
);
72 * EVTCHNOP_alloc_unbound: Allocate a port in domain <dom> and mark as
73 * accepting interdomain bindings from domain <remote_dom>. A fresh port
74 * is allocated in <dom> and returned as <port>.
76 * 1. If the caller is unprivileged then <dom> must be DOMID_SELF.
77 * 2. <rdom> may be DOMID_SELF, allowing loopback connections.
79 struct evtchn_alloc_unbound
{
81 domid_t dom
, remote_dom
;
85 typedef struct evtchn_alloc_unbound evtchn_alloc_unbound_t
;
88 * EVTCHNOP_close: Close a local event channel <port>. If the channel is
89 * interdomain then the remote end is placed in the unbound state
90 * (EVTCHNSTAT_unbound), awaiting a new connection.
96 typedef struct evtchn_close evtchn_close_t
;
99 * EVTCHNOP_send: Send an event to the remote end of the channel whose local
100 * endpoint is <port>.
106 typedef struct evtchn_send evtchn_send_t
;
108 #endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */
113 * c-file-style: "BSD"
116 * indent-tabs-mode: nil