VirtualBox

Ignore:
Timestamp:
Oct 15, 2010 12:07:44 PM (14 years ago)
Author:
vboxsync
Message:

IPRT: Added RTSemEventGetResolution and RTSemEventMultiGetResolution to r0drv.

Location:
trunk/src/VBox/Runtime/r0drv/linux
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/linux/semevent-r0drv-linux.c

    r33043 r33155  
    256256RT_EXPORT_SYMBOL(RTSemEventWaitExDebug);
    257257
     258
     259RTDECL(uint32_t) RTSemEventGetResolution(void)
     260{
     261    return rtR0SemLnxWaitGetResolution();
     262}
     263RT_EXPORT_SYMBOL(RTSemEventGetResolution);
     264
  • trunk/src/VBox/Runtime/r0drv/linux/semeventmulti-r0drv-linux.c

    r33043 r33155  
    321321RT_EXPORT_SYMBOL(RTSemEventMultiWaitExDebug);
    322322
     323
     324RTDECL(uint32_t) RTSemEventMultiGetResolution(void)
     325{
     326    return rtR0SemLnxWaitGetResolution();
     327}
     328RT_EXPORT_SYMBOL(RTSemEventMultiGetResolution);
     329
  • trunk/src/VBox/Runtime/r0drv/linux/waitqueue-r0drv-linux.h

    r33019 r33155  
    3535#include <iprt/string.h>
    3636#include <iprt/time.h>
     37
     38/** The resolution (nanoseconds) specified when using
     39 *  schedule_hrtimeout_range. */
     40#define RTR0SEMLNXWAIT_RESOLUTION   50000
    3741
    3842
     
    213217    else if (pWait->fHighRes)
    214218    {
    215         int rc = schedule_hrtimeout(&pWait->u.KtTimeout, HRTIMER_MODE_ABS);
     219        int rc = schedule_hrtimeout_range(&pWait->u.KtTimeout, HRTIMER_MODE_ABS, RTR0SEMLNXWAIT_RESOLUTION);
    216220        if (!rc)
    217221            pWait->fTimedOut = true;
     
    265269
    266270
    267 #endif
    268 
     271/**
     272 * Gets the max resolution of the timeout machinery.
     273 *
     274 * @returns Resolution specified in nanoseconds.
     275 */
     276DECLINLINE(uint32_t) rtR0SemLnxWaitGetResolution(void)
     277{
     278#ifdef IPRT_LINUX_HAS_HRTIMER
     279    return RTR0SEMLNXWAIT_RESOLUTION;
     280#else
     281    return 1000000000 / HZ; /* ns */
     282#endif
     283}
     284
     285#endif
     286
Note: See TracChangeset for help on using the changeset viewer.

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