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
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_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 */
23static inline __attribute__ (( always_inline )) int
24xenevent_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 */
37static inline __attribute__ (( always_inline )) int
38xenevent_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 */
51static inline __attribute__ (( always_inline )) int
52xenevent_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 */
struct arbelprm_send_doorbell send
Definition arbel.h:0
#define EVTCHNOP_close
#define EVTCHNOP_send
#define EVTCHNOP_alloc_unbound
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#define __attribute__(x)
Definition compiler.h:10
Xen interface.
#define __HYPERVISOR_event_channel_op
Definition xen.h:113
A Xen hypervisor.
Definition xen.h:51
static struct evtchn_close * close
Definition xenevent.h:24
static struct evtchn_alloc_unbound * alloc_unbound
Definition xenevent.h:53