|
@@ -13,6 +13,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
13
|
13
|
#define __XEN_INTERFACE_VERSION__ 0x00040400
|
14
|
14
|
|
15
|
15
|
#include <stdint.h>
|
|
16
|
+#include <ipxe/bitops.h>
|
16
|
17
|
#include <ipxe/uaccess.h>
|
17
|
18
|
#include <xen/xen.h>
|
18
|
19
|
#include <xen/event_channel.h>
|
|
@@ -58,6 +59,19 @@ struct xen_hypervisor {
|
58
|
59
|
struct xen_store store;
|
59
|
60
|
};
|
60
|
61
|
|
|
62
|
+/**
|
|
63
|
+ * Test and clear pending event
|
|
64
|
+ *
|
|
65
|
+ * @v xen Xen hypervisor
|
|
66
|
+ * @v port Event channel port
|
|
67
|
+ * @ret pending Event was pending
|
|
68
|
+ */
|
|
69
|
+static inline __attribute__ (( always_inline )) int
|
|
70
|
+xenevent_pending ( struct xen_hypervisor *xen, evtchn_port_t port ) {
|
|
71
|
+
|
|
72
|
+ return test_and_clear_bit ( port, xen->shared->evtchn_pending );
|
|
73
|
+}
|
|
74
|
+
|
61
|
75
|
#include <bits/xen.h>
|
62
|
76
|
|
63
|
77
|
/**
|