iPXE
xenmem.h
Go to the documentation of this file.
00001 #ifndef _IPXE_XENMEM_H
00002 #define _IPXE_XENMEM_H
00003 
00004 /** @file
00005  *
00006  * Xen memory operations
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 #include <ipxe/xen.h>
00013 #include <xen/memory.h>
00014 
00015 /**
00016  * Add page to physical address space
00017  *
00018  * @v xen               Xen hypervisor
00019  * @v add               Page mapping descriptor
00020  * @ret xenrc           Xen status code
00021  */
00022 static inline __attribute__ (( always_inline )) int
00023 xenmem_add_to_physmap ( struct xen_hypervisor *xen,
00024                         struct xen_add_to_physmap *add ) {
00025 
00026         return xen_hypercall_2 ( xen, __HYPERVISOR_memory_op,
00027                                  XENMEM_add_to_physmap, virt_to_phys ( add ) );
00028 }
00029 
00030 /**
00031  * Remove page from physical address space
00032  *
00033  * @v xen               Xen hypervisor
00034  * @v remove            Page mapping descriptor
00035  * @ret xenrc           Xen status code
00036  */
00037 static inline __attribute__ (( always_inline )) int
00038 xenmem_remove_from_physmap ( struct xen_hypervisor *xen,
00039                              struct xen_remove_from_physmap *remove ) {
00040 
00041         return xen_hypercall_2 ( xen, __HYPERVISOR_memory_op,
00042                                  XENMEM_remove_from_physmap,
00043                                  virt_to_phys ( remove ) );
00044 }
00045 
00046 #endif /* _IPXE_XENMEM_H */