Files
@ d0a14f973771
Branch filter:
Location: vmkdrivers/BLD/build/HEADERS/vmkapi-current-all-public/vmkernel64/release/platform/x86/vmkapi_ioresource.h
d0a14f973771
6.8 KiB
text/x-chdr
ESXi-5.0-U1
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 | /***************************************************************************
* Copyright 2010 VMware, Inc. All rights reserved.
***************************************************************************/
/*
* @VMKAPIMOD_LICENSE@
*/
/*
***********************************************************************
* IOResource */ /**
* \defgroup IOResource Generic IO resource interface.
* @{
***********************************************************************
*/
#ifndef _VMKAPI_IORESOURCE_H_
#define _VMKAPI_IORESOURCE_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 */
/** \brief IOResource type */
typedef enum {
VMK_IORESOURCE_NONE = 0,
VMK_IORESOURCE_UNKNOWN = 1,
VMK_IORESOURCE_MEM = 2,
VMK_IORESOURCE_PORT = 3,
} vmk_IOResourceType;
/** \brief IOResource address */
typedef struct vmk_IOResourceAddress {
/** Resource type */
vmk_IOResourceType type;
/** Physical address of resource */
union {
vmk_MA memory;
vmk_IOPortAddr port;
} address;
} vmk_IOResourceAddress;
/** \brief IOResource properties
*
* Properties of an io resource as defined at registration.
* These define what an io resource is capable of.
* Attributes specified for io reservation and/or mapping
* requests are checked for conflict against these.
*/
typedef enum {
/** Resource can be accessed by multiple users */
VMK_IORESOURCE_SHAREABLE=0x1,
/** Resource accesses can be safely cached */
VMK_IORESOURCE_CACHEABLE=0x2,
/** Resource is a prefetchable region */
VMK_IORESOURCE_PREFETCHABLE=0x4,
} vmk_IOResourceAttrs;
/** \brief IOResource reservation flags */
typedef enum {
/** Request exclusive use of resource */
VMK_IORESOURCE_RESERVE_EXCLUSIVE=0x1,
} vmk_IOReservationAttrs;
/** \brief IOResource description */
typedef struct vmk_IOResourceInfo {
/** Module registering the resource */
vmk_ModuleID moduleID;
/** Resource begins at this physical address */
vmk_IOResourceAddress start;
/** Number of bytes from the start */
vmk_ByteCount len;
/** Special attributes of this resource */
vmk_IOResourceAttrs attrs;
} vmk_IOResourceInfo;
/** \brief IOResource handle */
struct vmkIOResource;
typedef struct vmkIOResource* vmk_IOResource;
/** \brief IOResource reservation handle */
struct vmkIOReservation;
typedef struct vmkIOReservation* vmk_IOReservation;
/*
***********************************************************************
* vmk_IOResourceRegister -- */ /**
*
* \brief Register an IO resource with the vmkernel.
*
* \note This function will not block.
*
* \param[in] resourceInfo IOResource description data.
* \param[out] handle Handle to registered resource.
*
* \retval VMK_OK Success.
* \retval VMK_BAD_PARAM IOResource information incomplete.
* \retval VMK_NO_MEMORY Couldn't allocate memory for resource.
* \retval VMK_FAILURE IOResource overlaps with an existing resource.
*
***********************************************************************
*/
VMK_ReturnStatus
vmk_IOResourceRegister(vmk_IOResourceInfo *resourceInfo,
vmk_IOResource *handle);
/*
***********************************************************************
* vmk_IOResourceUnregister -- */ /**
*
* \brief Unregister a resource from the vmkernel.
*
* \note This function will not block.
*
* \param[in] handle IOResource to unregister.
*
* \retval VMK_OK Success.
* \retval VMK_INVALID_HANDLE Invalid handle.
*
***********************************************************************
*/
VMK_ReturnStatus
vmk_IOResourceUnregister(vmk_IOResource handle);
/*
***********************************************************************
* vmk_IOResourceReserve -- */ /**
*
* \brief Reserve a resource.
*
* \note This function will not block.
*
* \param[in] resourceInfo Requested resource information.
* \param[out] reservation Reservation handle.
*
* \retval VMK_OK Success.
* \retval VMK_NO_MEMORY Couldn't allocate reservation handle.
* \retval VMK_BAD_ADDR_RANGE Request doesn't match existing resource.
* \retval VMK_BAD_PARAM Options don't match resource.
* \retval VMK_NOT_SHARED Reservation conflict.
*
***********************************************************************
*/
VMK_ReturnStatus
vmk_IOResourceReserve(vmk_IOResourceInfo *resourceInfo,
vmk_IOReservation *reservation);
/*
***********************************************************************
* vmk_IOResourceRelease -- */ /**
*
* \brief Release a resource reservation.
*
* \note This function will not block.
*
* \param[in] reservation Reservation handle.
*
* \retval VMK_OK Success.
* \retval VMK_INVALID_HANDLE Invalid handle.
*
***********************************************************************
*/
VMK_ReturnStatus
vmk_IOResourceRelease(vmk_IOReservation reservation);
/*
***********************************************************************
* vmk_IOResourceBindToDevice -- */ /**
*
* \brief Associate a resource with a device.
*
* This call is used to attach an IO resource to a device registered
* with the vmkernel. A device may not always be known when registering
* an IO resource if that device is discovered by probing a known
* IO resource.
*
* \note Resource must be removed from the device using
* vmk_IOResourceUnbindFromDevice
*
* \note This function may block.
*
* \param[in] resource IOResource handle.
* \param[in] device Device handle.
*
* \retval VMK_OK Success.
* \retval VMK_BAD_PARAM Resource or device handle is invalid.
*
***********************************************************************
*/
VMK_ReturnStatus
vmk_IOResourceBindToDevice(vmk_IOResource resource,
vmk_Device device);
/*
***********************************************************************
* vmk_IOResourceUnbindFromDevice -- */ /**
*
* \brief Remove a resource from a device.
*
* \note This function may block.
*
* \param[in] resource IOResource handle.
* \param[in] device Device handle.
*
* \retval VMK_OK Success.
* \retval VMK_BAD_PARAM Resource or device handle is invalid.
*
***********************************************************************
*/
VMK_ReturnStatus
vmk_IOResourceUnbindFromDevice(vmk_IOResource resource,
vmk_Device device);
#endif
/** @} */
|