iPXE
xenmem.h
Go to the documentation of this file.
1#ifndef _IPXE_XENMEM_H
2#define _IPXE_XENMEM_H
3
4/** @file
5 *
6 * Xen memory operations
7 *
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <ipxe/xen.h>
14#include <xen/memory.h>
15
16/**
17 * Add page to physical address space
18 *
19 * @v xen Xen hypervisor
20 * @v add Page mapping descriptor
21 * @ret xenrc Xen status code
22 */
23static inline __attribute__ (( always_inline )) int
24xenmem_add_to_physmap ( struct xen_hypervisor *xen,
26
27 return xen_hypercall_2 ( xen, __HYPERVISOR_memory_op,
28 XENMEM_add_to_physmap, virt_to_phys ( add ) );
29}
30
31/**
32 * Remove page from physical address space
33 *
34 * @v xen Xen hypervisor
35 * @v remove Page mapping descriptor
36 * @ret xenrc Xen status code
37 */
38static inline __attribute__ (( always_inline )) int
39xenmem_remove_from_physmap ( struct xen_hypervisor *xen,
41
42 return xen_hypercall_2 ( xen, __HYPERVISOR_memory_op,
44 virt_to_phys ( remove ) );
45}
46
47#endif /* _IPXE_XENMEM_H */
#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_memory_op
Definition xen.h:93
#define XENMEM_add_to_physmap
Definition memory.h:225
#define XENMEM_remove_from_physmap
Definition memory.h:292
A Xen hypervisor.
Definition xen.h:51
static struct xen_remove_from_physmap * remove
Definition xenmem.h:40
static struct xen_add_to_physmap * add
Definition xenmem.h:25