/* SPDX-License-Identifier: MIT */ /****************************************************************************** * memory.h * * Memory reservation and information. * * Copyright (c) 2005, Keir Fraser <[email protected]> */ #ifndef __XEN_PUBLIC_MEMORY_H__ #define __XEN_PUBLIC_MEMORY_H__ #include <linux/spinlock.h> /* * Increase or decrease the specified domain's memory reservation. Returns a * -ve errcode on failure, or the # extents successfully allocated or freed. * arg == addr of struct xen_memory_reservation. */ #define XENMEM_increase_reservation … #define XENMEM_decrease_reservation … #define XENMEM_populate_physmap … struct xen_memory_reservation { … }; DEFINE_GUEST_HANDLE_STRUCT(…); /* * An atomic exchange of memory pages. If return code is zero then * @out.extent_list provides GMFNs of the newly-allocated memory. * Returns zero on complete success, otherwise a negative error code. * On complete success then always @nr_exchanged == @in.nr_extents. * On partial success @nr_exchanged indicates how much work was done. */ #define XENMEM_exchange … struct xen_memory_exchange { … }; DEFINE_GUEST_HANDLE_STRUCT(…); /* * Returns the maximum machine frame number of mapped RAM in this system. * This command always succeeds (it never returns an error code). * arg == NULL. */ #define XENMEM_maximum_ram_page … /* * Returns the current or maximum memory reservation, in pages, of the * specified domain (may be DOMID_SELF). Returns -ve errcode on failure. * arg == addr of domid_t. */ #define XENMEM_current_reservation … #define XENMEM_maximum_reservation … /* * Returns a list of MFN bases of 2MB extents comprising the machine_to_phys * mapping table. Architectures which do not have a m2p table do not implement * this command. * arg == addr of xen_machphys_mfn_list_t. */ #define XENMEM_machphys_mfn_list … struct xen_machphys_mfn_list { … }; DEFINE_GUEST_HANDLE_STRUCT(…); /* * Returns the location in virtual address space of the machine_to_phys * mapping table. Architectures which do not have a m2p table, or which do not * map it by default into guest address space, do not implement this command. * arg == addr of xen_machphys_mapping_t. */ #define XENMEM_machphys_mapping … struct xen_machphys_mapping { … }; DEFINE_GUEST_HANDLE_STRUCT(…); #define XENMAPSPACE_shared_info … #define XENMAPSPACE_grant_table … #define XENMAPSPACE_gmfn … #define XENMAPSPACE_gmfn_range … #define XENMAPSPACE_gmfn_foreign … #define XENMAPSPACE_dev_mmio … /* * Sets the GPFN at which a particular page appears in the specified guest's * pseudophysical address space. * arg == addr of xen_add_to_physmap_t. */ #define XENMEM_add_to_physmap … struct xen_add_to_physmap { … }; DEFINE_GUEST_HANDLE_STRUCT(…); /*** REMOVED ***/ /*#define XENMEM_translate_gpfn_list 8*/ #define XENMEM_add_to_physmap_range … struct xen_add_to_physmap_range { … }; DEFINE_GUEST_HANDLE_STRUCT(…); /* * Returns the pseudo-physical memory map as it was when the domain * was started (specified by XENMEM_set_memory_map). * arg == addr of struct xen_memory_map. */ #define XENMEM_memory_map … struct xen_memory_map { … }; DEFINE_GUEST_HANDLE_STRUCT(…); /* * Returns the real physical memory map. Passes the same structure as * XENMEM_memory_map. * arg == addr of struct xen_memory_map. */ #define XENMEM_machine_memory_map … /* * Unmaps the page appearing at a particular GPFN from the specified guest's * pseudophysical address space. * arg == addr of xen_remove_from_physmap_t. */ #define XENMEM_remove_from_physmap … struct xen_remove_from_physmap { … }; DEFINE_GUEST_HANDLE_STRUCT(…); /* * Get the pages for a particular guest resource, so that they can be * mapped directly by a tools domain. */ #define XENMEM_acquire_resource … struct xen_mem_acquire_resource { … }; DEFINE_GUEST_HANDLE_STRUCT(…); #endif /* __XEN_PUBLIC_MEMORY_H__ */