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 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <ipxe/xen.h>
13 #include <xen/memory.h>
14 
15 /**
16  * Add page to physical address space
17  *
18  * @v xen Xen hypervisor
19  * @v add Page mapping descriptor
20  * @ret xenrc Xen status code
21  */
22 static inline __attribute__ (( always_inline )) int
23 xenmem_add_to_physmap ( struct xen_hypervisor *xen,
24  struct xen_add_to_physmap *add ) {
25 
26  return xen_hypercall_2 ( xen, __HYPERVISOR_memory_op,
28 }
29 
30 /**
31  * Remove page from physical address space
32  *
33  * @v xen Xen hypervisor
34  * @v remove Page mapping descriptor
35  * @ret xenrc Xen status code
36  */
37 static inline __attribute__ (( always_inline )) int
38 xenmem_remove_from_physmap ( struct xen_hypervisor *xen,
40 
41  return xen_hypercall_2 ( xen, __HYPERVISOR_memory_op,
43  virt_to_phys ( remove ) );
44 }
45 
46 #endif /* _IPXE_XENMEM_H */
static struct xen_add_to_physmap * add
Definition: xenmem.h:24
static __attribute__((always_inline)) int xenmem_add_to_physmap(struct xen_hypervisor *xen
Add page to physical address space.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static __always_inline unsigned long virt_to_phys(volatile const void *addr)
Convert virtual address to a physical address.
Definition: uaccess.h:287
A Xen hypervisor.
Definition: xen.h:51
Xen interface.
#define XENMEM_remove_from_physmap
Definition: memory.h:288
#define XENMEM_add_to_physmap
Definition: memory.h:229
static struct xen_remove_from_physmap * remove
Definition: xenmem.h:39
#define __HYPERVISOR_memory_op
Definition: xen.h:78