VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/XenBusDxe/EventChannel.c@ 106129

Last change on this file since 106129 was 99404, checked in by vboxsync, 20 months ago

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1/** @file
2 Event Channel function implementation.
3
4 Event channel are use to notify of an event that happened in a shared
5 structure for example.
6
7 Copyright (C) 2014, Citrix Ltd.
8
9 SPDX-License-Identifier: BSD-2-Clause-Patent
10
11**/
12#include "EventChannel.h"
13
14#include <Library/XenHypercallLib.h>
15
16UINT32
17XenEventChannelNotify (
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
32XenBusEventChannelAllocate (
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
58XenBusEventChannelNotify (
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
71XenBusEventChannelClose (
72 IN XENBUS_PROTOCOL *This,
73 IN evtchn_port_t Port
74 )
75{
76 evtchn_close_t Close;
77
78 Close.port = Port;
79 return (UINT32)XenHypercallEventChannelOp (EVTCHNOP_close, &Close);
80}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette