]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/IndustryStandard/Xen/memory.h
OvmfPkg/License.txt: refresh the MIT license text and include the SPDX ID
[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
6 * Permission is hereby granted, free of charge, to any person obtaining a copy\r
7 * of this software and associated documentation files (the "Software"), to\r
8 * deal in the Software without restriction, including without limitation the\r
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\r
10 * sell copies of the Software, and to permit persons to whom the Software is\r
11 * furnished to do so, subject to the following conditions:\r
12 *\r
13 * The above copyright notice and this permission notice shall be included in\r
14 * all copies or substantial portions of the Software.\r
15 *\r
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
22 * DEALINGS IN THE SOFTWARE.\r
23 *\r
24 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>\r
25 */\r
26\r
27#ifndef __XEN_PUBLIC_MEMORY_H__\r
28#define __XEN_PUBLIC_MEMORY_H__\r
29\r
30#include "xen.h"\r
31\r
32/* Source mapping space. */\r
33/* ` enum phys_map_space { */\r
34#define XENMAPSPACE_shared_info 0 /* shared info page */\r
35#define XENMAPSPACE_grant_table 1 /* grant table page */\r
36#define XENMAPSPACE_gmfn 2 /* GMFN */\r
37#define XENMAPSPACE_gmfn_range 3 /* GMFN range, XENMEM_add_to_physmap only. */\r
38#define XENMAPSPACE_gmfn_foreign 4 /* GMFN from another dom,\r
39 * XENMEM_add_to_physmap_batch only. */\r
40/* ` } */\r
41\r
42/*\r
43 * Sets the GPFN at which a particular page appears in the specified guest's\r
44 * pseudophysical address space.\r
45 * arg == addr of xen_add_to_physmap_t.\r
46 */\r
47#define XENMEM_add_to_physmap 7\r
48struct xen_add_to_physmap {\r
49 /* Which domain to change the mapping for. */\r
50 domid_t domid;\r
51\r
52 /* Number of pages to go through for gmfn_range */\r
53 UINT16 size;\r
54\r
55 UINT32 space; /* => enum phys_map_space */\r
56\r
57#define XENMAPIDX_grant_table_status 0x80000000\r
58\r
59 /* Index into space being mapped. */\r
60 xen_ulong_t idx;\r
61\r
62 /* GPFN in domid where the source mapping page should appear. */\r
63 xen_pfn_t gpfn;\r
64};\r
65typedef struct xen_add_to_physmap xen_add_to_physmap_t;\r
66DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t);\r
67\r
68/*\r
69 * Unmaps the page appearing at a particular GPFN from the specified guest's\r
70 * pseudophysical address space.\r
71 * arg == addr of xen_remove_from_physmap_t.\r
72 */\r
73#define XENMEM_remove_from_physmap 15\r
74struct xen_remove_from_physmap {\r
75 /* Which domain to change the mapping for. */\r
76 domid_t domid;\r
77\r
78 /* GPFN of the current mapping of the page. */\r
79 xen_pfn_t gpfn;\r
80};\r
81typedef struct xen_remove_from_physmap xen_remove_from_physmap_t;\r
82DEFINE_XEN_GUEST_HANDLE(xen_remove_from_physmap_t);\r
83\r
84#endif /* __XEN_PUBLIC_MEMORY_H__ */\r
85\r
86/*\r
87 * Local variables:\r
88 * mode: C\r
89 * c-file-style: "BSD"\r
90 * c-basic-offset: 4\r
91 * tab-width: 4\r
92 * indent-tabs-mode: nil\r
93 * End:\r
94 */\r