12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #ifndef _IPXE_XEN_H
- #define _IPXE_XEN_H
-
- /** @file
- *
- * Xen interface
- *
- */
-
- FILE_LICENCE ( GPL2_OR_LATER );
-
- /* Define Xen interface version before including any Xen header files */
- #define __XEN_INTERFACE_VERSION__ 0x00040400
-
- #include <stdint.h>
- #include <ipxe/uaccess.h>
- #include <xen/xen.h>
- #include <xen/event_channel.h>
-
- /* Memory barrier macros used by ring.h */
- #define xen_mb() mb()
- #define xen_rmb() rmb()
- #define xen_wmb() wmb()
-
- struct xen_hypercall;
-
- /** A Xen grant table */
- struct xen_grant {
- /** Grant table entries */
- union grant_entry_v2 *table;
- /** Number of grant table entries (must be a power of two) */
- unsigned int count;
- /** Number of grant table entries in use */
- unsigned int used;
- /** Most recently used grant reference */
- unsigned int ref;
- };
-
- /** A XenStore */
- struct xen_store {
- /** XenStore domain interface */
- struct xenstore_domain_interface *intf;
- /** Event channel */
- evtchn_port_t port;
- };
-
- /** A Xen hypervisor */
- struct xen_hypervisor {
- /** Hypercall table */
- struct xen_hypercall *hypercall;
- /** Shared info page */
- struct shared_info *shared;
- /** Grant table */
- struct xen_grant grant;
- /** XenStore */
- struct xen_store store;
- };
-
- #include <bits/xen.h>
-
- /**
- * Convert a Xen status code to an iPXE status code
- *
- * @v xenrc Xen status code (negated)
- * @ret rc iPXE status code (before negation)
- *
- * Xen status codes are defined in the file include/xen/errno.h in the
- * Xen repository. They happen to match the Linux error codes, some
- * of which can be found in our include/ipxe/errno/linux.h.
- */
- #define EXEN( xenrc ) EPLATFORM ( EINFO_EPLATFORM, -(xenrc) )
-
- #endif /* _IPXE_XEN_H */
|