1 #ifndef _IPXE_XENEVENT_H
2 #define _IPXE_XENEVENT_H
10 FILE_LICENCE ( GPL2_OR_LATER );
13 #include <xen/event_channel.h>
18 * @v xen Xen hypervisor
19 * @v close Event descriptor
20 * @ret xenrc Xen status code
22 static inline __attribute__ (( always_inline )) int
23 xenevent_close ( struct xen_hypervisor *xen, struct evtchn_close *close ) {
25 return xen_hypercall_2 ( xen, __HYPERVISOR_event_channel_op,
26 EVTCHNOP_close, virt_to_phys ( close ) );
32 * @v xen Xen hypervisor
33 * @v send Event descriptor
34 * @ret xenrc Xen status code
36 static inline __attribute__ (( always_inline )) int
37 xenevent_send ( struct xen_hypervisor *xen, struct evtchn_send *send ) {
39 return xen_hypercall_2 ( xen, __HYPERVISOR_event_channel_op,
40 EVTCHNOP_send, virt_to_phys ( send ) );
44 * Allocate an unbound event channel
46 * @v xen Xen hypervisor
47 * @v alloc_unbound Event descriptor
48 * @ret xenrc Xen status code
50 static inline __attribute__ (( always_inline )) int
51 xenevent_alloc_unbound ( struct xen_hypervisor *xen,
52 struct evtchn_alloc_unbound *alloc_unbound ) {
54 return xen_hypercall_2 ( xen, __HYPERVISOR_event_channel_op,
55 EVTCHNOP_alloc_unbound,
56 virt_to_phys ( alloc_unbound ) );
59 #endif /* _IPXE_XENEVENT_H */