iPXE
xen.h
Go to the documentation of this file.
1#ifndef _IPXE_XEN_H
2#define _IPXE_XEN_H
3
4/** @file
5 *
6 * Xen interface
7 *
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13/* Define Xen interface version before including any Xen header files */
14#define __XEN_INTERFACE_VERSION__ 0x00040400
15
16#include <stdint.h>
17#include <ipxe/bitops.h>
18#include <xen/xen.h>
19#include <xen/event_channel.h>
20
21/* Memory barrier macros used by ring.h */
22#define xen_mb() mb()
23#define xen_rmb() rmb()
24#define xen_wmb() wmb()
25
26struct xen_hypercall;
27
28/** A Xen grant table */
29struct xen_grant {
30 /** Grant table entries */
32 /** Total grant table length */
33 size_t len;
34 /** Entry size shift (for later version tables) */
35 unsigned int shift;
36 /** Number of grant table entries in use */
37 unsigned int used;
38 /** Most recently used grant reference */
39 unsigned int ref;
40};
41
42/** A XenStore */
43struct xen_store {
44 /** XenStore domain interface */
46 /** Event channel */
48};
49
50/** A Xen hypervisor */
52 /** Hypercall table */
54 /** Shared info page */
56 /** Grant table */
58 /** XenStore */
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 */
69static inline __attribute__ (( always_inline )) int
70xenevent_pending ( struct xen_hypervisor *xen, evtchn_port_t port ) {
71
73}
74
75#include <bits/xen.h>
76
77/**
78 * Convert a Xen status code to an iPXE status code
79 *
80 * @v xenrc Xen status code (negated)
81 * @ret rc iPXE status code (before negation)
82 *
83 * Xen status codes are defined in the file include/xen/errno.h in the
84 * Xen repository. They happen to match the Linux error codes, some
85 * of which can be found in our include/ipxe/errno/linux.h.
86 */
87#define EXEN( xenrc ) EPLATFORM ( EINFO_EPLATFORM, -(xenrc) )
88
89#endif /* _IPXE_XEN_H */
u8 port
Port number.
Definition CIB_PRM.h:3
Xen interface.
uint32_t evtchn_port_t
#define grant_entry_v1
#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
Bit operations.
int test_and_clear_bit(unsigned int bit, volatile void *bits)
xen_ulong_t evtchn_pending[sizeof(xen_ulong_t) *8]
Definition xen.h:781
A Xen grant table.
Definition xen.h:29
unsigned int used
Number of grant table entries in use.
Definition xen.h:37
unsigned int shift
Entry size shift (for later version tables)
Definition xen.h:35
size_t len
Total grant table length.
Definition xen.h:33
struct grant_entry_v1 * table
Grant table entries.
Definition xen.h:31
unsigned int ref
Most recently used grant reference.
Definition xen.h:39
A hypercall entry point.
Definition xen.h:29
A Xen hypervisor.
Definition xen.h:51
struct shared_info * shared
Shared info page.
Definition xen.h:55
struct xen_hypercall * hypercall
Hypercall table.
Definition xen.h:53
struct xen_grant grant
Grant table.
Definition xen.h:57
struct xen_store store
XenStore.
Definition xen.h:59
A XenStore.
Definition xen.h:43
struct xenstore_domain_interface * intf
XenStore domain interface.
Definition xen.h:45
evtchn_port_t port
Event channel.
Definition xen.h:47