]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Include/IndustryStandard/Xen/memory.h
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / Xen / memory.h
CommitLineData
6b621f95
AP
1/******************************************************************************\r
2 * memory.h\r
4040754d 3 *\r
6b621f95 4 * Memory reservation and information.\r
4040754d 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
ac0a286f
MK
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
6b621f95
AP
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
ac0a286f 31#define XENMEM_add_to_physmap 7\r
6b621f95 32struct xen_add_to_physmap {\r
ac0a286f
MK
33 /* Which domain to change the mapping for. */\r
34 domid_t domid;\r
6b621f95 35\r
ac0a286f
MK
36 /* Number of pages to go through for gmfn_range */\r
37 UINT16 size;\r
6b621f95 38\r
ac0a286f 39 UINT32 space; /* => enum phys_map_space */\r
6b621f95 40\r
ac0a286f 41 #define XENMAPIDX_grant_table_status 0x80000000\r
6b621f95 42\r
ac0a286f
MK
43 /* Index into space being mapped. */\r
44 xen_ulong_t idx;\r
6b621f95 45\r
ac0a286f
MK
46 /* GPFN in domid where the source mapping page should appear. */\r
47 xen_pfn_t gpfn;\r
6b621f95 48};\r
ac0a286f 49\r
6b621f95 50typedef struct xen_add_to_physmap xen_add_to_physmap_t;\r
ac0a286f 51DEFINE_XEN_GUEST_HANDLE (xen_add_to_physmap_t);\r
6b621f95
AP
52\r
53/*\r
54 * Unmaps the page appearing at a particular GPFN from the specified guest's\r
55 * pseudophysical address space.\r
56 * arg == addr of xen_remove_from_physmap_t.\r
57 */\r
ac0a286f 58#define XENMEM_remove_from_physmap 15\r
6b621f95 59struct xen_remove_from_physmap {\r
ac0a286f
MK
60 /* Which domain to change the mapping for. */\r
61 domid_t domid;\r
6b621f95 62\r
ac0a286f
MK
63 /* GPFN of the current mapping of the page. */\r
64 xen_pfn_t gpfn;\r
6b621f95 65};\r
ac0a286f 66\r
6b621f95 67typedef struct xen_remove_from_physmap xen_remove_from_physmap_t;\r
ac0a286f 68DEFINE_XEN_GUEST_HANDLE (xen_remove_from_physmap_t);\r
6b621f95 69\r
23f93742
AP
70/*\r
71 * Returns the pseudo-physical memory map as it was when the domain\r
72 * was started (specified by XENMEM_set_memory_map).\r
73 * arg == addr of xen_memory_map_t.\r
74 */\r
ac0a286f 75#define XENMEM_memory_map 9\r
23f93742 76struct xen_memory_map {\r
ac0a286f
MK
77 /*\r
78 * On call the number of entries which can be stored in buffer. On\r
79 * return the number of entries which have been stored in\r
80 * buffer.\r
81 */\r
82 UINT32 nr_entries;\r
83\r
84 /*\r
85 * Entries in the buffer are in the same format as returned by the\r
86 * BIOS INT 0x15 EAX=0xE820 call.\r
87 */\r
88 XEN_GUEST_HANDLE (void) buffer;\r
23f93742 89};\r
ac0a286f 90\r
23f93742 91typedef struct xen_memory_map xen_memory_map_t;\r
ac0a286f 92DEFINE_XEN_GUEST_HANDLE (xen_memory_map_t);\r
23f93742 93\r
6b621f95
AP
94#endif /* __XEN_PUBLIC_MEMORY_H__ */\r
95\r
96/*\r
97 * Local variables:\r
98 * mode: C\r
99 * c-file-style: "BSD"\r
100 * c-basic-offset: 4\r
101 * tab-width: 4\r
102 * indent-tabs-mode: nil\r
103 * End:\r
104 */\r