Files
@ d6b9b2ac5869
Branch filter:
Location: vmkdrivers/BLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release/core/vmkapi_user.h
d6b9b2ac5869
7.8 KiB
text/x-chdr
ESXi-5.5-U2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | /* **********************************************************
* Copyright 2010-2012 VMware, Inc. All rights reserved.
* **********************************************************/
/*
* @VMKAPIMOD_LICENSE@
*/
/*
******************************************************************************
* User Space Memory Interface */ /**
*
* \addtogroup Core
* @{
* \defgroup UserMem User Space Memory
* @{
******************************************************************************
*/
#ifndef _VMKAPI_CORE_USERMEMORY_H_
#define _VMKAPI_CORE_USERMEMORY_H_
/** \cond never */
#ifndef VMK_HEADER_INCLUDED_FROM_VMKAPI_H
#error This vmkapi file should never be included directly but only via vmkapi.h
#endif
/** \endcond never */
/*
***********************************************************************
* vmk_UserMapCallback -- */ /**
*
* \brief Callback function invoked when user mapping is released.
*
* \param[in] callbackParam Opaque parameter for callback function.
*
***********************************************************************
*/
typedef void (*vmk_UserMapCallback)(void *);
/**
* \brief Properties of a vmk_UserMap() map request.
*/
typedef struct vmk_UserMapProps {
/** \brief Module ID of module requesting mapping. */
vmk_ModuleID moduleID;
/** \brief Function to call when mapping is released. */
vmk_UserMapCallback callbackFunction;
/** \brief Opaque parameter for callbackFunction. */
vmk_AddrCookie callbackParam;
/**
* \brief Pointer to map request structure.
*
* \note See Mapping section for description
* of map request structure.
*/
vmk_MapRequest *mapRequest;
} vmk_UserMapProps;
/*
***********************************************************************
* vmk_UserMap -- */ /**
*
* \brief Map the provided request into a contiguous virtual address
* space of current user world.
*
* \note The only supported mapping attributes are READONLY, READWRITE,
* WRITECOMBINE, and UNCACHED. Any other attribute will cause
* mapping to fail with return status VMK_BAD_PARAM.
*
* \param[in] props Properties of this mapping request.
* \param[in,out] vaddr Pointer to virtual address of mapping
* (non-zero to specify a virtual address,
* or zero for default address).
*
* \retval VMK_OK Map is successful.
* \retval VMK_BAD_PARAM Input parameter is invalid.
* \retval VMK_NO_MEMORY Unable to allocate mapping request.
* \retval VMK_NO_RESOURCES Unable to allocate mapping request.
* \retval VMK_INVALID_ADDRESS Requested address not in map range.
*
***********************************************************************
*/
VMK_ReturnStatus vmk_UserMap(
vmk_UserMapProps *props,
vmk_VA *vaddr);
/*
***********************************************************************
* vmk_UserUnmap -- */ /**
*
* \brief Unmap user world virtual address space mapped by vmk_UserMap().
*
* \param[in] vaddr Virtual address to unmap.
* \param[in] length Length of address space in bytes.
*
* \retval VMK_OK Unmap is successful.
* \retval VMK_NOT_FOUND Virtual address and length not mapped.
* \retval VMK_INVALID_ADDRESS Requested address is not page aligned.
*
***********************************************************************
*/
VMK_ReturnStatus vmk_UserUnmap(
vmk_VA vaddr,
vmk_ByteCount length);
/*
***********************************************************************
* vmk_UserAddValidMPNRange -- */ /**
*
* \brief Indicate a range of consecutive MPNs can be referenced by
* user worlds.
*
* \param[in] mpn First MPN in range.
* \param[in] numPages Number of machine pages in range.
*
* \retval VMK_OK MPNs added to user worlds.
* \retval VMK_BAD_PARAM Input parameter is invalid.
* \retval VMK_NO_MEMORY Unable to allocate memory for request.
* \retval VMK_INVALID_PAGE_NUMBER MPN range intersects with existing
* MPN range.
*
***********************************************************************
*/
VMK_ReturnStatus vmk_UserAddValidMPNRange(
vmk_MPN mpn,
vmk_uint32 numPages);
/*
***********************************************************************
* vmk_UserRemoveValidMPNRange -- */ /**
*
* \brief Remove a range of consecutive MPNs from user worlds.
*
* \param[in] mpn First MPN in range.
* \param[in] numPages Number of machine pages in range.
*
* \retval VMK_OK MPNs removed from user worlds.
* \retval VMK_NOT_FOUND MPN range not found.
*
***********************************************************************
*/
VMK_ReturnStatus vmk_UserRemoveValidMPNRange(
vmk_MPN mpn,
vmk_uint32 numPages);
/*
***********************************************************************
* vmk_UserPinPage -- */ /**
*
* \brief Marks the VPN in the specified world as not swappable.
*
* \param[in] worldID ID of world whose mapping will be pinned.
* \param[in] vpn VPN to pin.
* \param[out] mpn MPN backing this pinned VPN.
*
* \retval VMK_OK VPNs was pinned successfully.
* \retval VMK_BAD_PARAM An invalid argument was provided.
* \retval VMK_INVALID_WORLD An invalid worldID was provided.
*
***********************************************************************
*/
VMK_ReturnStatus vmk_UserPinPage(
vmk_WorldID worldID,
vmk_VPN vpn,
vmk_MPN *mpn);
/*
***********************************************************************
* vmk_UserUnpinPage -- */ /**
*
* \brief Marks the specified VPN in the specified world as swappable.
*
* \note This VPN must have been pinned by a call to vmk_UserPinPage().
*
* \param[in] worldID ID of world whose mapping will be
* unpinned.
* \param[in] vpn VPN to unpin.
*
* \retval VMK_OK VPNs was unpinned successfully.
* \retval VMK_BAD_PARAM An invalid argument was provided.
* \retval VMK_INVALID_WORLD An invalid worldID was provided.
*
***********************************************************************
*/
VMK_ReturnStatus vmk_UserUnpinPage(
vmk_WorldID worldID,
vmk_VPN vpn);
/*
******************************************************************************
* vmk_CopyFromUser -- */ /**
*
* Copy memory from a user space application into a kernel buffer
*
* \note Caller must not hold any spinlocks.
* \note Must be called from a blockable context
*
* \param[in] dest Copy-to location.
* \param[in] src Copy-from location.
* \param[in] len Amount to copy.
*
******************************************************************************
*/
VMK_ReturnStatus vmk_CopyFromUser(
vmk_VA dest,
vmk_VA src,
vmk_ByteCount len);
/*
******************************************************************************
* vmk_CopyToUser -- */ /**
*
* Copy memory from a kernel buffer into a user space application.
*
* \note Caller must not hold any spinlocks.
* \note Must be called from a blockable context
*
* \param[in] dest Copy-to location.
* \param[in] src Copy-from location.
* \param[in] len Amount to copy.
*
******************************************************************************
*/
VMK_ReturnStatus vmk_CopyToUser(
vmk_VA dest,
vmk_VA src,
vmk_ByteCount len);
#endif
/** @} */
/** @} */
|