VirtualBox

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

Last change on this file since 80924 was 80721, checked in by vboxsync, 5 years ago

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • Property svn:eol-style set to native
File size: 1.6 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 if (ReturnCode != 0) {
47 DEBUG ((EFI_D_ERROR, "ERROR: alloc_unbound failed with rc=%d", ReturnCode));
48 return ReturnCode;
49 }
50 *Port = Parameter.port;
51 return ReturnCode;
52}
53
54UINT32
55EFIAPI
56XenBusEventChannelNotify (
57 IN XENBUS_PROTOCOL *This,
58 IN evtchn_port_t Port
59 )
60{
61 XENBUS_PRIVATE_DATA *Private;
62
63 Private = XENBUS_PRIVATE_DATA_FROM_THIS(This);
64 return XenEventChannelNotify (Private->Dev, Port);
65}
66
67UINT32
68EFIAPI
69XenBusEventChannelClose (
70 IN XENBUS_PROTOCOL *This,
71 IN evtchn_port_t Port
72 )
73{
74 evtchn_close_t Close;
75
76 Close.port = Port;
77 return (UINT32)XenHypercallEventChannelOp (EVTCHNOP_close, &Close);
78}
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