VirtualBox

Changeset 53476 in vbox


Ignore:
Timestamp:
Dec 8, 2014 11:18:56 AM (10 years ago)
Author:
vboxsync
Message:

HostDrivers/support: Use 128-bit unsigned int math as mentioned in r97204.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r53474 r53476  
    4646#include <iprt/spinlock.h>
    4747#include <iprt/thread.h>
     48#include <iprt/uint128.h>
    4849#include <iprt/uuid.h>
    4950#include <iprt/net.h>
     
    61716172    else
    61726173    {
    6173         /* Try not to lose precision, the larger the interval the more likely we overflow. */
    6174 #if 0  /** @todo r=bird: What about falling back on iprt/uint128.h here instead of
    6175          * trading accuracy for values that works with ASMMultU64ByU32DivByU32? Speed
    6176          * is hardly an issue at this point. */
     6174#if 1
    61776175        RTUINT128U CpuHz, Tmp, Divisor;
    6178         RTUInt128MulU64ByU64(&Tmp, u64DeltaTsc, RT_NS_1SEC);
     6176        CpuHz.s.Lo = CpuHz.s.Hi = 0;
     6177        RTUInt128MulU64ByU64(&Tmp, u64DeltaTsc, RT_NS_1SEC_64);
    61796178        RTUInt128Div(&CpuHz, &Tmp, RTUInt128AssignU64(&Divisor, u64DeltaNanoTS));
    61806179        pGip->u64CpuHz = CpuHz.s.Lo;
    61816180#else
     6181        /* Try not to lose precision, the larger the interval the more likely we overflow. */
    61826182        if (   u64DeltaTsc < UINT64_MAX / RT_NS_100MS
    61836183            && u64DeltaNanoTS / 10 < UINT32_MAX)
  • trunk/src/VBox/HostDrivers/Support/linux/files_vboxdrv

    r47199 r53476  
    6464    ${PATH_ROOT}/include/iprt/timer.h=>include/iprt/timer.h \
    6565    ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \
     66    ${PATH_ROOT}/include/iprt/uint128.h=>include/iprt/uint128.h \
    6667    ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \
    6768    ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \
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