VirtualBox

Changeset 10944 in vbox for trunk/include/iprt/timer.h


Ignore:
Timestamp:
Jul 29, 2008 6:08:58 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
33809
Message:

iprt: RTTimerLR - low resolution timer API (< 10 Hz).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/timer.h

    r9468 r10944  
    220220RTDECL(int) RTTimerReleaseSystemGranularity(uint32_t u32Granted);
    221221
     222
     223
     224/**
     225 * Timer callback function for low res timers.
     226 *
     227 * This is identfical to FNRTTIMER except for the first parameter, so
     228 * see FNRTTIMER for details.
     229 *
     230 * @param   hTimerLR    The low resolution timer handle.
     231 * @param   pvUser      User argument.
     232 * @param   iTick       The current timer tick. This is always 1 on the first
     233 *                      callback after the timer was started. For omni timers
     234 *                      this will be 1 when a cpu comes back online.
     235 */
     236typedef DECLCALLBACK(void) FNRTTIMERLR(RTTIMERLR hTimerLR, void *pvUser, uint64_t iTick);
     237/** Pointer to FNRTTIMER() function. */
     238typedef FNRTTIMERLR *PFNRTTIMERLR;
     239
     240
     241/**
     242 * Create a recurring low resolution timer.
     243 *
     244 * @returns iprt status code.
     245 * @param   phTimerLR           Where to store the timer handle.
     246 * @param   uMilliesInterval    Milliseconds between the timer ticks, at least 100 ms.
     247 *                              If higher resolution is required use the other API.
     248 * @param   pfnTimer            Callback function which shall be scheduled for execution
     249 *                              on every timer tick.
     250 * @param   pvUser              User argument for the callback.
     251 * @see     RTTimerLRCreateEx, RTTimerLRDestroy, RTTimerLRStop
     252 */
     253RTDECL(int) RTTimerLRCreate(PRTTIMERLR phTimerLR, uint32_t uMilliesInterval, PFNRTTIMERLR pfnTimer, void *pvUser);
     254
     255/**
     256 * Create a suspended low resolution timer.
     257 *
     258 * @returns iprt status code.
     259 * @retval  VERR_NOT_SUPPORTED if an unsupported flag was specfied.
     260 *
     261 * @param   phTimerLR           Where to store the timer handle.
     262 * @param   u64NanoInterval     The interval between timer ticks specified in nanoseconds if it's
     263 *                              a recurring timer, the minimum for is 100000000 ns.
     264 *                              For one shot timers, pass 0.
     265 * @param   fFlags              Timer flags. Same as RTTimerCreateEx.
     266 * @param   pfnTimer            Callback function which shall be scheduled for execution
     267 *                              on every timer tick.
     268 * @param   pvUser              User argument for the callback.
     269 * @see     RTTimerLRStart, RTTimerLRStop, RTTimerLRDestroy
     270 */
     271RTDECL(int) RTTimerLRCreateEx(PRTTIMERLR phTimerLR, uint64_t u64NanoInterval, uint32_t fFlags, PFNRTTIMERLR pfnTimer, void *pvUser);
     272
     273/**
     274 * Stops and destroys a running low resolution timer.
     275 *
     276 * @returns iprt status code.
     277 * @param   hTimerLR            The low resolution timer to stop and destroy.
     278 *                              NIL_RTTIMERLR is accepted.
     279 */
     280RTDECL(int) RTTimerLRDestroy(RTTIMERLR hTimerLR);
     281
     282/**
     283 * Stops an active low resolution timer.
     284 *
     285 * @returns IPRT status code.
     286 * @retval  VERR_INVALID_HANDLE if pTimer isn't valid.
     287 * @retval  VERR_TIMER_ACTIVE if the timer isn't suspended.
     288 *
     289 * @param   hTimerLR            The low resolution timer to activate.
     290 * @param   u64First            The RTTimeSystemNanoTS() for when the timer should start
     291 *                              firing (relative), the minimum is 100000000 ns.
     292 *                              If 0 is specified, the timer will fire ASAP.
     293 *
     294 * @see     RTTimerLRStop
     295 */
     296RTDECL(int) RTTimerLRStart(RTTIMERLR hTimerLR, uint64_t u64First);
     297
     298/**
     299 * Stops an active low resolution timer.
     300 *
     301 * @returns IPRT status code.
     302 * @retval  VERR_INVALID_HANDLE if pTimer isn't valid.
     303 * @retval  VERR_TIMER_SUSPENDED if the timer isn't active.
     304 * @retval  VERR_NOT_SUPPORTED if the IPRT implementation doesn't support stopping a timer.
     305 *
     306 * @param   hTimerLR            The low resolution timer to suspend.
     307 *
     308 * @see     RTTimerLRStart
     309 */
     310RTDECL(int) RTTimerLRStop(RTTIMERLR hTimerLR);
     311
    222312/** @} */
    223313
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette