iPXE
xenevent.h
Go to the documentation of this file.
1 #ifndef _IPXE_XENEVENT_H
2 #define _IPXE_XENEVENT_H
3 
4 /** @file
5  *
6  * Xen events
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 FILE_SECBOOT ( PERMITTED );
12 
13 #include <ipxe/xen.h>
14 #include <xen/event_channel.h>
15 
16 /**
17  * Close event channel
18  *
19  * @v xen Xen hypervisor
20  * @v close Event descriptor
21  * @ret xenrc Xen status code
22  */
23 static inline __attribute__ (( always_inline )) int
24 xenevent_close ( struct xen_hypervisor *xen, struct evtchn_close *close ) {
25 
26  return xen_hypercall_2 ( xen, __HYPERVISOR_event_channel_op,
27  EVTCHNOP_close, virt_to_phys ( close ) );
28 }
29 
30 /**
31  * Send event
32  *
33  * @v xen Xen hypervisor
34  * @v send Event descriptor
35  * @ret xenrc Xen status code
36  */
37 static inline __attribute__ (( always_inline )) int
38 xenevent_send ( struct xen_hypervisor *xen, struct evtchn_send *send ) {
39 
40  return xen_hypercall_2 ( xen, __HYPERVISOR_event_channel_op,
41  EVTCHNOP_send, virt_to_phys ( send ) );
42 }
43 
44 /**
45  * Allocate an unbound event channel
46  *
47  * @v xen Xen hypervisor
48  * @v alloc_unbound Event descriptor
49  * @ret xenrc Xen status code
50  */
51 static inline __attribute__ (( always_inline )) int
52 xenevent_alloc_unbound ( struct xen_hypervisor *xen,
54 
55  return xen_hypercall_2 ( xen, __HYPERVISOR_event_channel_op,
57  virt_to_phys ( alloc_unbound ) );
58 }
59 
60 #endif /* _IPXE_XENEVENT_H */
FILE_SECBOOT(PERMITTED)
#define EVTCHNOP_close
Definition: event_channel.h:52
A Xen hypervisor.
Definition: xen.h:51
Xen interface.
static struct evtchn_send * send
Definition: xenevent.h:38
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define __HYPERVISOR_event_channel_op
Definition: xen.h:146
#define EVTCHNOP_send
Definition: event_channel.h:53
static __attribute__((always_inline)) int xenevent_close(struct xen_hypervisor *xen
Close event channel.
static struct evtchn_alloc_unbound * alloc_unbound
Definition: xenevent.h:53
static struct evtchn_close * close
Definition: xenevent.h:24
#define EVTCHNOP_alloc_unbound
Definition: event_channel.h:55
struct xen_hypervisor * xen
Xen hypervisor.
Definition: xenbus.h:23