Changeset View
Changeset View
Standalone View
Standalone View
sys/xen/interface/memory.h
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Returns the maximum machine frame number of mapped RAM in this system. | * Returns the maximum machine frame number of mapped RAM in this system. | ||||
* This command always succeeds (it never returns an error code). | * This command always succeeds (it never returns an error code). | ||||
* arg == NULL. | * arg == NULL. | ||||
*/ | */ | ||||
#define XENMEM_maximum_ram_page 2 | #define XENMEM_maximum_ram_page 2 | ||||
struct xen_memory_domain { | |||||
/* [IN] Domain information is being queried for. */ | |||||
domid_t domid; | |||||
}; | |||||
/* | /* | ||||
* Returns the current or maximum memory reservation, in pages, of the | * Returns the current or maximum memory reservation, in pages, of the | ||||
* specified domain (may be DOMID_SELF). Returns -ve errcode on failure. | * specified domain (may be DOMID_SELF). Returns -ve errcode on failure. | ||||
* arg == addr of domid_t. | * arg == addr of struct xen_memory_domain. | ||||
*/ | */ | ||||
#define XENMEM_current_reservation 3 | #define XENMEM_current_reservation 3 | ||||
#define XENMEM_maximum_reservation 4 | #define XENMEM_maximum_reservation 4 | ||||
/* | /* | ||||
* Returns the maximum GPFN in use by the guest, or -ve errcode on failure. | * Returns the maximum GFN in use by the specified domain (may be DOMID_SELF). | ||||
* Returns -ve errcode on failure. | |||||
* arg == addr of struct xen_memory_domain. | |||||
*/ | */ | ||||
#define XENMEM_maximum_gpfn 14 | #define XENMEM_maximum_gpfn 14 | ||||
/* | /* | ||||
* Returns a list of MFN bases of 2MB extents comprising the machine_to_phys | * 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 | * mapping table. Architectures which do not have a m2p table do not implement | ||||
* this command. | * this command. | ||||
* arg == addr of xen_machphys_mfn_list_t. | * arg == addr of xen_machphys_mfn_list_t. | ||||
▲ Show 20 Lines • Show All 430 Lines • ▼ Show 20 Lines | #define XENMEM_RDM_ALL 1 /* Request all regions (ignore dev union). */ | ||||
* Gets set to the required number of entries when too low, | * Gets set to the required number of entries when too low, | ||||
* signaled by error code -ERANGE. | * signaled by error code -ERANGE. | ||||
*/ | */ | ||||
unsigned int nr_entries; | unsigned int nr_entries; | ||||
/* OUT */ | /* OUT */ | ||||
XEN_GUEST_HANDLE(xen_reserved_device_memory_t) buffer; | XEN_GUEST_HANDLE(xen_reserved_device_memory_t) buffer; | ||||
/* IN */ | /* IN */ | ||||
union { | union { | ||||
struct physdev_pci_device pci; | physdev_pci_device_t pci; | ||||
} dev; | } dev; | ||||
}; | }; | ||||
typedef struct xen_reserved_device_memory_map xen_reserved_device_memory_map_t; | typedef struct xen_reserved_device_memory_map xen_reserved_device_memory_map_t; | ||||
DEFINE_XEN_GUEST_HANDLE(xen_reserved_device_memory_map_t); | DEFINE_XEN_GUEST_HANDLE(xen_reserved_device_memory_map_t); | ||||
#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */ | #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */ | ||||
/* | /* | ||||
* Get the pages for a particular guest resource, so that they can be | * Get the pages for a particular guest resource, so that they can be | ||||
* mapped directly by a tools domain. | * mapped directly by a tools domain. | ||||
*/ | */ | ||||
#define XENMEM_acquire_resource 28 | #define XENMEM_acquire_resource 28 | ||||
struct xen_mem_acquire_resource { | struct xen_mem_acquire_resource { | ||||
/* IN - The domain whose resource is to be mapped */ | /* IN - The domain whose resource is to be mapped */ | ||||
domid_t domid; | domid_t domid; | ||||
/* IN - the type of resource */ | /* IN - the type of resource */ | ||||
uint16_t type; | uint16_t type; | ||||
#define XENMEM_resource_ioreq_server 0 | #define XENMEM_resource_ioreq_server 0 | ||||
#define XENMEM_resource_grant_table 1 | #define XENMEM_resource_grant_table 1 | ||||
#define XENMEM_resource_vmtrace_buf 2 | |||||
/* | /* | ||||
* IN - a type-specific resource identifier, which must be zero | * IN - a type-specific resource identifier, which must be zero | ||||
* unless stated otherwise. | * unless stated otherwise. | ||||
* | * | ||||
* type == XENMEM_resource_ioreq_server -> id == ioreq server id | * type == XENMEM_resource_ioreq_server -> id == ioreq server id | ||||
* type == XENMEM_resource_grant_table -> id defined below | * type == XENMEM_resource_grant_table -> id defined below | ||||
*/ | */ | ||||
uint32_t id; | uint32_t id; | ||||
#define XENMEM_resource_grant_table_id_shared 0 | #define XENMEM_resource_grant_table_id_shared 0 | ||||
#define XENMEM_resource_grant_table_id_status 1 | #define XENMEM_resource_grant_table_id_status 1 | ||||
/* | /* | ||||
* IN/OUT - As an IN parameter number of frames of the resource | * IN/OUT | ||||
* to be mapped. However, if the specified value is 0 and | * | ||||
* frame_list is NULL then this field will be set to the | * As an IN parameter number of frames of the resource to be mapped. | ||||
* maximum value supported by the implementation on return. | * This value may be updated over the course of the operation. | ||||
* | |||||
* When frame_list is NULL and nr_frames is 0, this is interpreted as a | |||||
* request for the size of the resource, which shall be returned in the | |||||
* nr_frames field. | |||||
* | |||||
* The size of a resource will never be zero, but a nonzero result doesn't | |||||
* guarantee that a subsequent mapping request will be successful. There | |||||
* are further type/id specific constraints which may change between the | |||||
* two calls. | |||||
*/ | */ | ||||
uint32_t nr_frames; | uint32_t nr_frames; | ||||
uint32_t pad; | uint32_t pad; | ||||
/* | /* | ||||
* IN - the index of the initial frame to be mapped. This parameter | * IN - the index of the initial frame to be mapped. This parameter | ||||
* is ignored if nr_frames is 0. | * is ignored if nr_frames is 0. This value may be updated | ||||
* over the course of the operation. | |||||
*/ | */ | ||||
uint64_t frame; | uint64_t frame; | ||||
#define XENMEM_resource_ioreq_server_frame_bufioreq 0 | #define XENMEM_resource_ioreq_server_frame_bufioreq 0 | ||||
#define XENMEM_resource_ioreq_server_frame_ioreq(n) (1 + (n)) | #define XENMEM_resource_ioreq_server_frame_ioreq(n) (1 + (n)) | ||||
/* | /* | ||||
* IN/OUT - If the tools domain is PV then, upon return, frame_list | * IN/OUT - If the tools domain is PV then, upon return, frame_list | ||||
* will be populated with the MFNs of the resource. | * will be populated with the MFNs of the resource. | ||||
* If the tools domain is HVM then it is expected that, on | * If the tools domain is HVM then it is expected that, on | ||||
* entry, frame_list will be populated with a list of GFNs | * entry, frame_list will be populated with a list of GFNs | ||||
* that will be mapped to the MFNs of the resource. | * that will be mapped to the MFNs of the resource. | ||||
* If -EIO is returned then the frame_list has only been | * If -EIO is returned then the frame_list has only been | ||||
* partially mapped and it is up to the caller to unmap all | * partially mapped and it is up to the caller to unmap all | ||||
* the GFNs. | * the GFNs. | ||||
* This parameter may be NULL if nr_frames is 0. | * This parameter may be NULL if nr_frames is 0. This | ||||
* value may be updated over the course of the operation. | |||||
*/ | */ | ||||
XEN_GUEST_HANDLE(xen_pfn_t) frame_list; | XEN_GUEST_HANDLE(xen_pfn_t) frame_list; | ||||
}; | }; | ||||
typedef struct xen_mem_acquire_resource xen_mem_acquire_resource_t; | typedef struct xen_mem_acquire_resource xen_mem_acquire_resource_t; | ||||
DEFINE_XEN_GUEST_HANDLE(xen_mem_acquire_resource_t); | DEFINE_XEN_GUEST_HANDLE(xen_mem_acquire_resource_t); | ||||
/* | /* | ||||
* XENMEM_get_vnumainfo used by guest to get | * XENMEM_get_vnumainfo used by guest to get | ||||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |