1 /******************************************************************************
4 * Memory reservation and information.
6 * SPDX-License-Identifier: MIT
8 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
11 #ifndef __XEN_PUBLIC_MEMORY_H__
12 #define __XEN_PUBLIC_MEMORY_H__
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. */
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.
31 #define XENMEM_add_to_physmap 7
32 struct xen_add_to_physmap
{
33 /* Which domain to change the mapping for. */
36 /* Number of pages to go through for gmfn_range */
39 UINT32 space
; /* => enum phys_map_space */
41 #define XENMAPIDX_grant_table_status 0x80000000
43 /* Index into space being mapped. */
46 /* GPFN in domid where the source mapping page should appear. */
49 typedef struct xen_add_to_physmap xen_add_to_physmap_t
;
50 DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t
);
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.
57 #define XENMEM_remove_from_physmap 15
58 struct xen_remove_from_physmap
{
59 /* Which domain to change the mapping for. */
62 /* GPFN of the current mapping of the page. */
65 typedef struct xen_remove_from_physmap xen_remove_from_physmap_t
;
66 DEFINE_XEN_GUEST_HANDLE(xen_remove_from_physmap_t
);
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.
73 #define XENMEM_memory_map 9
74 struct xen_memory_map
{
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
83 * Entries in the buffer are in the same format as returned by the
84 * BIOS INT 0x15 EAX=0xE820 call.
86 XEN_GUEST_HANDLE(void) buffer
;
88 typedef struct xen_memory_map xen_memory_map_t
;
89 DEFINE_XEN_GUEST_HANDLE(xen_memory_map_t
);
91 #endif /* __XEN_PUBLIC_MEMORY_H__ */
99 * indent-tabs-mode: nil