]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/IndustryStandard/Xen/memory.h
54ee4b465417128374ed9b887089999a8326cdb2
[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 typedef struct xen_add_to_physmap xen_add_to_physmap_t;
50 DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t);
51
52 /*
53 * Unmaps the page appearing at a particular GPFN from the specified guest's
54 * pseudophysical address space.
55 * arg == addr of xen_remove_from_physmap_t.
56 */
57 #define XENMEM_remove_from_physmap 15
58 struct xen_remove_from_physmap {
59 /* Which domain to change the mapping for. */
60 domid_t domid;
61
62 /* GPFN of the current mapping of the page. */
63 xen_pfn_t gpfn;
64 };
65 typedef struct xen_remove_from_physmap xen_remove_from_physmap_t;
66 DEFINE_XEN_GUEST_HANDLE(xen_remove_from_physmap_t);
67
68 /*
69 * Returns the pseudo-physical memory map as it was when the domain
70 * was started (specified by XENMEM_set_memory_map).
71 * arg == addr of xen_memory_map_t.
72 */
73 #define XENMEM_memory_map 9
74 struct xen_memory_map {
75 /*
76 * On call the number of entries which can be stored in buffer. On
77 * return the number of entries which have been stored in
78 * buffer.
79 */
80 UINT32 nr_entries;
81
82 /*
83 * Entries in the buffer are in the same format as returned by the
84 * BIOS INT 0x15 EAX=0xE820 call.
85 */
86 XEN_GUEST_HANDLE(void) buffer;
87 };
88 typedef struct xen_memory_map xen_memory_map_t;
89 DEFINE_XEN_GUEST_HANDLE(xen_memory_map_t);
90
91 #endif /* __XEN_PUBLIC_MEMORY_H__ */
92
93 /*
94 * Local variables:
95 * mode: C
96 * c-file-style: "BSD"
97 * c-basic-offset: 4
98 * tab-width: 4
99 * indent-tabs-mode: nil
100 * End:
101 */