]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/IndustryStandard/Xen/memory.h
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / Xen / memory.h
1 /******************************************************************************
2 * memory.h
3 *
4 * Memory reservation and information.
5 *
6 * SPDX-License-Identifier: MIT
7 *
8 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
9 */
10
11 #ifndef __XEN_PUBLIC_MEMORY_H__
12 #define __XEN_PUBLIC_MEMORY_H__
13
14 #include "xen.h"
15
16 /* Source mapping space. */
17 /* ` enum phys_map_space { */
18 #define XENMAPSPACE_shared_info 0 /* shared info page */
19 #define XENMAPSPACE_grant_table 1 /* grant table page */
20 #define XENMAPSPACE_gmfn 2 /* GMFN */
21 #define XENMAPSPACE_gmfn_range 3 /* GMFN range, XENMEM_add_to_physmap only. */
22 #define XENMAPSPACE_gmfn_foreign 4 /* GMFN from another dom,
23 * XENMEM_add_to_physmap_batch only. */
24 /* ` } */
25
26 /*
27 * Sets the GPFN at which a particular page appears in the specified guest's
28 * pseudophysical address space.
29 * arg == addr of xen_add_to_physmap_t.
30 */
31 #define XENMEM_add_to_physmap 7
32 struct xen_add_to_physmap {
33 /* Which domain to change the mapping for. */
34 domid_t domid;
35
36 /* Number of pages to go through for gmfn_range */
37 UINT16 size;
38
39 UINT32 space; /* => enum phys_map_space */
40
41 #define XENMAPIDX_grant_table_status 0x80000000
42
43 /* Index into space being mapped. */
44 xen_ulong_t idx;
45
46 /* GPFN in domid where the source mapping page should appear. */
47 xen_pfn_t gpfn;
48 };
49
50 typedef struct xen_add_to_physmap xen_add_to_physmap_t;
51 DEFINE_XEN_GUEST_HANDLE (xen_add_to_physmap_t);
52
53 /*
54 * Unmaps the page appearing at a particular GPFN from the specified guest's
55 * pseudophysical address space.
56 * arg == addr of xen_remove_from_physmap_t.
57 */
58 #define XENMEM_remove_from_physmap 15
59 struct xen_remove_from_physmap {
60 /* Which domain to change the mapping for. */
61 domid_t domid;
62
63 /* GPFN of the current mapping of the page. */
64 xen_pfn_t gpfn;
65 };
66
67 typedef struct xen_remove_from_physmap xen_remove_from_physmap_t;
68 DEFINE_XEN_GUEST_HANDLE (xen_remove_from_physmap_t);
69
70 /*
71 * Returns the pseudo-physical memory map as it was when the domain
72 * was started (specified by XENMEM_set_memory_map).
73 * arg == addr of xen_memory_map_t.
74 */
75 #define XENMEM_memory_map 9
76 struct xen_memory_map {
77 /*
78 * On call the number of entries which can be stored in buffer. On
79 * return the number of entries which have been stored in
80 * buffer.
81 */
82 UINT32 nr_entries;
83
84 /*
85 * Entries in the buffer are in the same format as returned by the
86 * BIOS INT 0x15 EAX=0xE820 call.
87 */
88 XEN_GUEST_HANDLE (void) buffer;
89 };
90
91 typedef struct xen_memory_map xen_memory_map_t;
92 DEFINE_XEN_GUEST_HANDLE (xen_memory_map_t);
93
94 #endif /* __XEN_PUBLIC_MEMORY_H__ */
95
96 /*
97 * Local variables:
98 * mode: C
99 * c-file-style: "BSD"
100 * c-basic-offset: 4
101 * tab-width: 4
102 * indent-tabs-mode: nil
103 * End:
104 */