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. */
50 typedef struct xen_add_to_physmap xen_add_to_physmap_t
;
51 DEFINE_XEN_GUEST_HANDLE (xen_add_to_physmap_t
);
54 * Unmaps the page appearing at a particular GPFN from the specified guest's
55 * pseudophysical address space.
56 * arg == addr of xen_remove_from_physmap_t.
58 #define XENMEM_remove_from_physmap 15
59 struct xen_remove_from_physmap
{
60 /* Which domain to change the mapping for. */
63 /* GPFN of the current mapping of the page. */
67 typedef struct xen_remove_from_physmap xen_remove_from_physmap_t
;
68 DEFINE_XEN_GUEST_HANDLE (xen_remove_from_physmap_t
);
71 * Returns the pseudo-physical memory map as it was when the domain
72 * was started (specified by XENMEM_set_memory_map).
73 * arg == addr of xen_memory_map_t.
75 #define XENMEM_memory_map 9
76 struct xen_memory_map
{
78 * On call the number of entries which can be stored in buffer. On
79 * return the number of entries which have been stored in
85 * Entries in the buffer are in the same format as returned by the
86 * BIOS INT 0x15 EAX=0xE820 call.
88 XEN_GUEST_HANDLE (void) buffer
;
91 typedef struct xen_memory_map xen_memory_map_t
;
92 DEFINE_XEN_GUEST_HANDLE (xen_memory_map_t
);
94 #endif /* __XEN_PUBLIC_MEMORY_H__ */
102 * indent-tabs-mode: nil