2 Event Channel function implementation.
4 Event channel are use to notify of an event that happened in a shared
7 Copyright (C) 2014, Citrix Ltd.
9 This program and the accompanying materials
10 are licensed and made available under the terms and conditions of the BSD License
11 which accompanies this distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #include "EventChannel.h"
20 #include <Library/XenHypercallLib.h>
23 XenEventChannelNotify (
24 IN XENBUS_DEVICE
*Dev
,
32 ReturnCode
= XenHypercallEventChannelOp (EVTCHNOP_send
, &Send
);
33 return (UINT32
)ReturnCode
;
38 XenBusEventChannelAllocate (
39 IN XENBUS_PROTOCOL
*This
,
41 OUT evtchn_port_t
*Port
44 evtchn_alloc_unbound_t Parameter
;
47 Parameter
.dom
= DOMID_SELF
;
48 Parameter
.remote_dom
= DomainId
;
49 ReturnCode
= (UINT32
)XenHypercallEventChannelOp (
50 EVTCHNOP_alloc_unbound
,
52 if (ReturnCode
!= 0) {
53 DEBUG ((EFI_D_ERROR
, "ERROR: alloc_unbound failed with rc=%d", ReturnCode
));
56 *Port
= Parameter
.port
;
62 XenBusEventChannelNotify (
63 IN XENBUS_PROTOCOL
*This
,
67 XENBUS_PRIVATE_DATA
*Private
;
69 Private
= XENBUS_PRIVATE_DATA_FROM_THIS(This
);
70 return XenEventChannelNotify (Private
->Dev
, Port
);
75 XenBusEventChannelClose (
76 IN XENBUS_PROTOCOL
*This
,
83 return (UINT32
)XenHypercallEventChannelOp (EVTCHNOP_close
, &Close
);