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