~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/ipxe/src/include/ipxe/xenmem.h

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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,
 
27
                                 XENMEM_add_to_physmap, virt_to_phys ( add ) );
 
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,
 
39
                             struct xen_remove_from_physmap *remove ) {
 
40
 
 
41
        return xen_hypercall_2 ( xen, __HYPERVISOR_memory_op,
 
42
                                 XENMEM_remove_from_physmap,
 
43
                                 virt_to_phys ( remove ) );
 
44
}
 
45
 
 
46
#endif /* _IPXE_XENMEM_H */