Files
@ d0a14f973771
Branch filter:
Location: vmkdrivers/BLD/build/HEADERS/vmkapi-current-all-public/vmkernel64/release/base/vmkapi_time_incompat.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 | /* **********************************************************
* Copyright 2010 VMware, Inc. All rights reserved.
* **********************************************************/
/*
* @VMKAPIMOD_LICENSE@
*/
/*
***********************************************************************
* Time */ /**
*
* \addtogroup Time
*
* @{
***********************************************************************
*/
#ifndef _VMKAPI_TIME_INCOMPAT_H_
#define _VMKAPI_TIME_INCOMPAT_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 */
#define VMK_USECS_PER_JIFFY 10000
#define VMK_JIFFIES_PER_SECOND (VMK_USEC_PER_SEC/VMK_USECS_PER_JIFFY)
/*
***********************************************************************
* vmk_jiffies -- */ /**
*
* \brief A global that increments every VMK_USECS_PER_JIFFY
* microsceonds.
*
***********************************************************************
*/
extern volatile unsigned long vmk_jiffies;
/*
***********************************************************************
* vmk_TimerAdd -- */ /**
*
* \brief Schedule a timer.
*
* The VMKernel can schedule simultaneously a limited number of timers
* for each CPU.
*
* \warning Timers are a limited resource. The VMKernel does not
* guarantee to provide more than 100 concurrent timers per CPU
* system-wide, and exceeding the limit is a fatal error.
*
* \param[in] callback Timer callback.
* \param[in] data Argument passed to the timer callback on
* timeout.
* \param[in] timeoutUs Timeout in microseconds.
* \param[in] periodic Whether the timer should automatically
* reschedule itself.
* \param[in] rank Major rank of the timer; see explanation of
* lock and timer ranks in vmkapi_lock.h.
* \param[out] timer Timer reference.
*
* \retval VMK_NO_RESOURCES Couldn't schedule the timer.
* \retval VMK_OK The timer was successfully scheduled.
*
***********************************************************************
*/
VMK_ReturnStatus vmk_TimerAdd(
vmk_TimerCallback callback,
vmk_TimerCookie data,
vmk_int32 timeoutUs,
vmk_Bool periodic,
vmk_SpinlockRank rank,
vmk_Timer *timer);
/*
***********************************************************************
* vmk_TimerModifyOrAdd -- */ /**
*
* \brief Schedule or reschedule a timer.
*
* Atomically remove the timer referenced by *timer (if pending) and
* reschedule it with the given new parameters, possibly replacing
* *timer with a new timer reference. It is permissible for *timer to
* be VMK_INVALID_TIMER on input; in this case a new timer reference is
* always returned. This function is slower than vmk_TimerAdd and
* should be used only if the atomic replacement semantics are needed.
*
* \param[in] callback Timer callback
* \param[in] data Argument passed to the timer callback on
* timeout.
* \param[in] timeoutUs Timeout in microseconds
* \param[in] periodic Whether the timer should automatically
* reschedule itself
* \param[in] rank Major rank of the timer; see explanation of
* lock and timer ranks in vmkapi_lock.h.
* \param[in,out] timer Timer reference
* \param[out] pending Whether the timer was still pending when
* modified.
*
* \retval VMK_NO_RESOURCES Couldn't schedule the timer.
* \retval VMK_OK The timer was successfully scheduled.
*
***********************************************************************
*/
VMK_ReturnStatus vmk_TimerModifyOrAdd(
vmk_TimerCallback callback,
vmk_TimerCookie data,
vmk_int32 timeoutUs,
vmk_Bool periodic,
vmk_SpinlockRank rank,
vmk_Timer *timer,
vmk_Bool *pending);
/*
***********************************************************************
* vmk_TimerRemove -- */ /**
*
* \ingroup Time
* \brief Cancel a scheduled timer.
*
* \param[in] timer A timer reference.
*
* \retval VMK_OK The timer was successfully cancelled. If the
* timer was one-shot, it did not fire and never
* will.
* \retval VMK_NOT_FOUND The timer had previously been removed, was a
* one-shot that already fired, or is
* VMK_INVALID_TIMER.
*
***********************************************************************
*/
VMK_ReturnStatus vmk_TimerRemove(
vmk_Timer timer);
/*
***********************************************************************
* vmk_TimerRemoveSync -- */ /**
*
* \ingroup Time
* \brief Cancel a scheduled timer
*
* If the timer fired before it could be cancelled, spin until the timer
* callback completes.
*
* \warning This function must not be called from the timer callback
* itself. It must be called with current lock rank less than
* the timer's rank; see an explanation of lock and timer ranks
* in vmkapi_lock.h.
*
* \param[in] timer A timer reference.
*
* \retval VMK_OK The timer was successfully cancelled. If the
* timer was one-shot, it did not fire and
* never will.
* \retval VMK_NOT_FOUND The timer had previously been removed, was a
* one-shot that already fired, or is
* VMK_INVALID_TIMER.
*
***********************************************************************
*/
VMK_ReturnStatus vmk_TimerRemoveSync(
vmk_Timer timer);
#endif /* _VMKAPI_TIME_INCOMPAT_H_ */
/** @} */
|