Files
@ d0a14f973771
Branch filter:
Location: vmkdrivers/BLD/build/HEADERS/vmkapi-current-all-public/vmkernel64/release/core/vmkapi_bh.h
d0a14f973771
6.0 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 | /* **********************************************************
* Copyright 2007 - 2010 VMware, Inc. All rights reserved.
* **********************************************************/
/*
* @VMKAPIMOD_LICENSE@
*/
/*
*******************************************************************************
* BottomHalf */ /**
* \addtogroup Core
* @{
* \defgroup BottomHalf Bottom-Half
*
* Bottom-halves are soft-interrupt-like contexts that run below the priority of
* hardware interrupts but outside the context of a schedulable entity like a
* World. This means that bottom-half callbacks may not block while they
* execute.
*
* @{
*******************************************************************************
*/
#ifndef _VMKAPI_BH_H_
#define _VMKAPI_BH_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 Bottom-Half ID
*
* Identifies a registered bottom-half
*/
struct vmkBHInt;
typedef struct vmkBHInt *vmk_BHID;
/*
*******************************************************************************
* vmk_BHCallBack -- */ /**
*
* \brief Prototype for a bottom-half callback function.
*
* This function will be called when a scheduled bottom-half is run. Bottom-
* halves are expected to only run for a short period of time and surrender the
* PCPU as quickly as possible by returning from the callback.
* A bottom-half callback may not execute longer than 0.5 milliseconds (500
* microseconds).
*
* \note A callback of this type must not block or call any API
* functions that may block.
*
* \param[in] private Private data as specified to vmk_BHRegister.
*
*******************************************************************************
*/
typedef void (*vmk_BHCallBack)(vmk_AddrCookie data);
/**
* \brief Bottom-half Properties
*
* Properties of a bottom-half that is getting registered
*/
typedef struct vmk_BHProps {
/** Module ID of the registering module */
vmk_ModuleID moduleID;
/** Name associated with this bottom-half */
vmk_Name name;
/** Function to be called when the bottom-half is run */
vmk_BHCallBack callback;
/** Private data pointer that will be passed to the callback */
void *priv;
} vmk_BHProps;
/*
*******************************************************************************
* vmk_BHRegister -- */ /**
*
* \brief Register a function that can be scheduled as a bottom-half.
*
* \param[in] props Properties of this bottom half
* \param[out] newBH Bottom-half identifier
*
* \note This function will not block.
*
* \retval VMK_NO_RESOURCES Bottom-half registration table was full,
* new bottom-half was not registered.
* \retval VMK_NAME_INVALID Specified name was invalid.
*
*******************************************************************************
*/
VMK_ReturnStatus vmk_BHRegister(
vmk_BHProps *props,
vmk_BHID *newBH);
/*
******************************************************************************
* vmk_BHUnregister -- */ /**
*
* \brief Unregister a previously registered bottom-half callback.
*
* \note This function will not block.
*
* \param[in] bottomHalf Bottom-half to unregister.
*
******************************************************************************
*/
void vmk_BHUnregister(
vmk_BHID bottomHalf);
/*
******************************************************************************
* vmk_BHSchedulePCPU -- */ /**
*
* \brief Schedule the execution of a bottom-half on a particular PCPU
*
* This schedules the function which has been registered and associated
* with the bottom-half identifier by vmk_BottomHalfRegister to
* run as bottom-half with the given physical CPU.
*
* \warning Do not schedule a bottom-half on another CPU too frequently
* since the bottom-half cache-line is kept on the local CPU.
*
* \note This function will not block.
*
* \param[in] bottomHalf Bottom-half to schedule.
* \param[in] pcpu PCPU on which the bottom-half should run.
*
* \retval VMK_OK The given bottom-half has been scheduled successfully.
* \retval VMK_INVALID_TARGET The specified PCPU is not available.
*
******************************************************************************
*/
VMK_ReturnStatus vmk_BHSchedulePCPU(
vmk_BHID bottomHalf,
vmk_uint32 pcpu);
/*
******************************************************************************
* vmk_BHScheduleAnyPCPU -- */ /**
*
* \brief Schedule the execution of a bottom-half on an arbitrary PCPU
*
* \note This function will not block.
*
* \param[in] bottomHalf Bottom-half to schedule.
*
******************************************************************************
*/
void vmk_BHScheduleAnyPCPU(
vmk_BHID bottomHalf);
/*
* XXX PR582861: vmk_BottomHalfCheck needs to be removed before beta. How are
* 3rd party devs supposed to make sense out of this? This is vmkernel internal
* stuff. Should probably be replaced by an API for CpuSched_PreemptionPoint
*/
/*
***********************************************************************
* vmk_BottomHalfCheck -- */ /**
*
* \brief Execute pending bottom-half handlers on the local pcpu.
*
* Afterwards, if a reschedule is pending and "canReschedule" is VMK_TRUE
* then invoke the scheduler.
*
* \note This function may block if canReschedule is VMK_TRUE.
*
* \param[in] canReschedule If VMK_TRUE then invoke the scheduler after
* pending bottom-halves execute.
*
***********************************************************************
*/
void vmk_BottomHalfCheck(
vmk_Bool canReschedule);
#endif /* _VMKAPI_BH_H_ */
/** @} */
/** @} */
|