]>
Commit | Line | Data |
---|---|---|
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 | |
47 | #define EVTCHNOP_close 3\r | |
48 | #define EVTCHNOP_send 4\r | |
49 | #define EVTCHNOP_alloc_unbound 6\r | |
50 | /* ` } */\r | |
51 | \r | |
52 | typedef UINT32 evtchn_port_t;\r | |
53 | DEFINE_XEN_GUEST_HANDLE(evtchn_port_t);\r | |
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 | |
63 | struct evtchn_alloc_unbound {\r | |
64 | /* IN parameters */\r | |
65 | domid_t dom, remote_dom;\r | |
66 | /* OUT parameters */\r | |
67 | evtchn_port_t port;\r | |
68 | };\r | |
69 | typedef struct evtchn_alloc_unbound evtchn_alloc_unbound_t;\r | |
70 | \r | |
71 | /*\r | |
72 | * EVTCHNOP_close: Close a local event channel <port>. If the channel is\r | |
73 | * interdomain then the remote end is placed in the unbound state\r | |
74 | * (EVTCHNSTAT_unbound), awaiting a new connection.\r | |
75 | */\r | |
76 | struct evtchn_close {\r | |
77 | /* IN parameters. */\r | |
78 | evtchn_port_t port;\r | |
79 | };\r | |
80 | typedef struct evtchn_close evtchn_close_t;\r | |
81 | \r | |
82 | /*\r | |
83 | * EVTCHNOP_send: Send an event to the remote end of the channel whose local\r | |
84 | * endpoint is <port>.\r | |
85 | */\r | |
86 | struct evtchn_send {\r | |
87 | /* IN parameters. */\r | |
88 | evtchn_port_t port;\r | |
89 | };\r | |
90 | typedef struct evtchn_send evtchn_send_t;\r | |
91 | \r | |
92 | #endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */\r | |
93 | \r | |
94 | /*\r | |
95 | * Local variables:\r | |
96 | * mode: C\r | |
97 | * c-file-style: "BSD"\r | |
98 | * c-basic-offset: 4\r | |
99 | * tab-width: 4\r | |
100 | * indent-tabs-mode: nil\r | |
101 | * End:\r | |
102 | */\r |