TianoCore EDK2 master
Loading...
Searching...
No Matches
EventChannel.c
Go to the documentation of this file.
1
12#include "EventChannel.h"
13
15
16UINT32
18 IN XENBUS_DEVICE *Dev,
19 IN evtchn_port_t Port
20 )
21{
22 INTN ReturnCode;
23 evtchn_send_t Send;
24
25 Send.port = Port;
26 ReturnCode = XenHypercallEventChannelOp (EVTCHNOP_send, &Send);
27 return (UINT32)ReturnCode;
28}
29
30UINT32
31EFIAPI
33 IN XENBUS_PROTOCOL *This,
34 IN domid_t DomainId,
35 OUT evtchn_port_t *Port
36 )
37{
38 evtchn_alloc_unbound_t Parameter;
39 UINT32 ReturnCode;
40
41 Parameter.dom = DOMID_SELF;
42 Parameter.remote_dom = DomainId;
43 ReturnCode = (UINT32)XenHypercallEventChannelOp (
44 EVTCHNOP_alloc_unbound,
45 &Parameter
46 );
47 if (ReturnCode != 0) {
48 DEBUG ((DEBUG_ERROR, "ERROR: alloc_unbound failed with rc=%d", ReturnCode));
49 return ReturnCode;
50 }
51
52 *Port = Parameter.port;
53 return ReturnCode;
54}
55
56UINT32
57EFIAPI
59 IN XENBUS_PROTOCOL *This,
60 IN evtchn_port_t Port
61 )
62{
63 XENBUS_PRIVATE_DATA *Private;
64
65 Private = XENBUS_PRIVATE_DATA_FROM_THIS (This);
66 return XenEventChannelNotify (Private->Dev, Port);
67}
68
69UINT32
70EFIAPI
72 IN XENBUS_PROTOCOL *This,
73 IN evtchn_port_t Port
74 )
75{
77
78 Close.port = Port;
79 return (UINT32)XenHypercallEventChannelOp (EVTCHNOP_close, &Close);
80}
INT64 INTN
EFI_STATUS EFIAPI Close(IN EFI_ACPI_HANDLE Handle)
Definition: AcpiSdt.c:628
UINT32 XenEventChannelNotify(IN XENBUS_DEVICE *Dev, IN evtchn_port_t Port)
Definition: EventChannel.c:17
UINT32 EFIAPI XenBusEventChannelNotify(IN XENBUS_PROTOCOL *This, IN evtchn_port_t Port)
Definition: EventChannel.c:58
UINT32 EFIAPI XenBusEventChannelClose(IN XENBUS_PROTOCOL *This, IN evtchn_port_t Port)
Definition: EventChannel.c:71
UINT32 EFIAPI XenBusEventChannelAllocate(IN XENBUS_PROTOCOL *This, IN domid_t DomainId, OUT evtchn_port_t *Port)
Definition: EventChannel.c:32
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define DEBUG(Expression)
Definition: DebugLib.h:434
INTN EFIAPI XenHypercallEventChannelOp(IN INTN Operation, IN OUT VOID *Arguments)
Definition: XenHypercall.c:79