VirtualBox

Changeset 33630 in vbox for trunk/src


Ignore:
Timestamp:
Oct 31, 2010 4:00:19 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
67241
Message:

waitqueue-r0drv-linux.h: Use the RT_NS/US_1SEC constants.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/linux/waitqueue-r0drv-linux.h

    r33609 r33630  
    101101/** @todo optimize: millisecs -> nanosecs -> millisec -> jiffies */
    102102        if (fFlags & RTSEMWAIT_FLAGS_MILLISECS)
    103             uTimeout = uTimeout < UINT64_MAX / UINT32_C(1000000) * UINT32_C(1000000)
    104                      ? uTimeout * UINT32_C(1000000)
     103            uTimeout = uTimeout < UINT64_MAX / RT_US_1SEC * RT_US_1SEC
     104                     ? uTimeout * RT_US_1SEC
    105105                     : UINT64_MAX;
    106106        if (uTimeout == UINT64_MAX)
     
    137137#ifdef IPRT_LINUX_HAS_HRTIMER
    138138        if (   (fFlags & (RTSEMWAIT_FLAGS_NANOSECS | RTSEMWAIT_FLAGS_ABSOLUTE))
    139             || pWait->cNsRelTimeout < UINT32_C(1000000000) / HZ * 4)
     139            || pWait->cNsRelTimeout < RT_NS_1SEC / HZ * 4)
    140140        {
    141141            pWait->fHighRes     = true;
    142142# if BITS_PER_LONG < 64
    143143            if (   KTIME_SEC_MAX <= LONG_MAX
    144                 && pWait->uNsAbsTimeout >= KTIME_SEC_MAX * UINT64_C(1000000000) + UINT64_C(999999999))
     144                && pWait->uNsAbsTimeout >= KTIME_SEC_MAX * RT_NS_1SEC_64 + (RT_NS_1SEC - 1))
    145145                fFlags |= RTSEMWAIT_FLAGS_INDEFINITE;
    146146            else
     
    151151#endif
    152152        {
    153             uint64_t cJiffies = ASMMultU64ByU32DivByU32(pWait->cNsRelTimeout, HZ, UINT32_C(1000000000));
     153            uint64_t cJiffies = ASMMultU64ByU32DivByU32(pWait->cNsRelTimeout, HZ, RT_NS_1SEC);
    154154            if (cJiffies >= MAX_JIFFY_OFFSET)
    155155                fFlags |= RTSEMWAIT_FLAGS_INDEFINITE;
     
    279279    return RTR0SEMLNXWAIT_RESOLUTION;
    280280#else
    281     return 1000000000 / HZ; /* ns */
    282 #endif
    283 }
    284 
    285 #endif
    286 
     281    return RT_NS_1SEC / HZ; /* ns */
     282#endif
     283}
     284
     285#endif
     286
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