]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/IndustryStandard/Xen/event_channel.h
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / Xen / event_channel.h
CommitLineData
f1259bba
AP
1/******************************************************************************\r
2 * event_channel.h\r
3 *\r
4 * Event channels between domains.\r
5 *\r
6f21d772 6 * SPDX-License-Identifier: MIT\r
f1259bba
AP
7 *\r
8 * Copyright (c) 2003-2004, K A Fraser.\r
9 */\r
10\r
11#ifndef __XEN_PUBLIC_EVENT_CHANNEL_H__\r
12#define __XEN_PUBLIC_EVENT_CHANNEL_H__\r
13\r
14#include "xen.h"\r
15\r
16/*\r
17 * `incontents 150 evtchn Event Channels\r
18 *\r
19 * Event channels are the basic primitive provided by Xen for event\r
20 * notifications. An event is the Xen equivalent of a hardware\r
21 * interrupt. They essentially store one bit of information, the event\r
22 * of interest is signalled by transitioning this bit from 0 to 1.\r
23 *\r
24 * Notifications are received by a guest via an upcall from Xen,\r
25 * indicating when an event arrives (setting the bit). Further\r
26 * notifications are masked until the bit is cleared again (therefore,\r
27 * guests must check the value of the bit after re-enabling event\r
28 * delivery to ensure no missed notifications).\r
29 *\r
30 * Event notifications can be masked by setting a flag; this is\r
31 * equivalent to disabling interrupts and can be used to ensure\r
32 * atomicity of certain operations in the guest kernel.\r
33 *\r
34 * Event channels are represented by the evtchn_* fields in\r
35 * struct shared_info and struct vcpu_info.\r
36 */\r
37\r
38/*\r
39 * ` enum neg_errnoval\r
40 * ` HYPERVISOR_event_channel_op(enum event_channel_op cmd, VOID *args)\r
41 * `\r
42 * @cmd == EVTCHNOP_* (event-channel operation).\r
43 * @args == struct evtchn_* Operation-specific extra arguments (NULL if none).\r
44 */\r
45\r
46/* ` enum event_channel_op { // EVTCHNOP_* => struct evtchn_* */\r
ac0a286f
MK
47#define EVTCHNOP_close 3\r
48#define EVTCHNOP_send 4\r
49#define EVTCHNOP_alloc_unbound 6\r
f1259bba
AP
50/* ` } */\r
51\r
52typedef UINT32 evtchn_port_t;\r
ac0a286f 53DEFINE_XEN_GUEST_HANDLE (evtchn_port_t);\r
f1259bba
AP
54\r
55/*\r
56 * EVTCHNOP_alloc_unbound: Allocate a port in domain <dom> and mark as\r
57 * accepting interdomain bindings from domain <remote_dom>. A fresh port\r
58 * is allocated in <dom> and returned as <port>.\r
59 * NOTES:\r
60 * 1. If the caller is unprivileged then <dom> must be DOMID_SELF.\r
61 * 2. <rdom> may be DOMID_SELF, allowing loopback connections.\r
62 */\r
63struct evtchn_alloc_unbound {\r
ac0a286f
MK
64 /* IN parameters */\r
65 domid_t dom, remote_dom;\r
66 /* OUT parameters */\r
67 evtchn_port_t port;\r
f1259bba 68};\r
ac0a286f 69\r
f1259bba
AP
70typedef struct evtchn_alloc_unbound evtchn_alloc_unbound_t;\r
71\r
72/*\r
73 * EVTCHNOP_close: Close a local event channel <port>. If the channel is\r
74 * interdomain then the remote end is placed in the unbound state\r
75 * (EVTCHNSTAT_unbound), awaiting a new connection.\r
76 */\r
77struct evtchn_close {\r
ac0a286f
MK
78 /* IN parameters. */\r
79 evtchn_port_t port;\r
f1259bba 80};\r
ac0a286f 81\r
f1259bba
AP
82typedef struct evtchn_close evtchn_close_t;\r
83\r
84/*\r
85 * EVTCHNOP_send: Send an event to the remote end of the channel whose local\r
86 * endpoint is <port>.\r
87 */\r
88struct evtchn_send {\r
ac0a286f
MK
89 /* IN parameters. */\r
90 evtchn_port_t port;\r
f1259bba 91};\r
ac0a286f 92\r
f1259bba
AP
93typedef struct evtchn_send evtchn_send_t;\r
94\r
95#endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */\r
96\r
97/*\r
98 * Local variables:\r
99 * mode: C\r
100 * c-file-style: "BSD"\r
101 * c-basic-offset: 4\r
102 * tab-width: 4\r
103 * indent-tabs-mode: nil\r
104 * End:\r
105 */\r