- Timestamp:
- Oct 31, 2010 4:00:19 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 67241
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/waitqueue-r0drv-linux.h
r33609 r33630 101 101 /** @todo optimize: millisecs -> nanosecs -> millisec -> jiffies */ 102 102 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 105 105 : UINT64_MAX; 106 106 if (uTimeout == UINT64_MAX) … … 137 137 #ifdef IPRT_LINUX_HAS_HRTIMER 138 138 if ( (fFlags & (RTSEMWAIT_FLAGS_NANOSECS | RTSEMWAIT_FLAGS_ABSOLUTE)) 139 || pWait->cNsRelTimeout < UINT32_C(1000000000)/ HZ * 4)139 || pWait->cNsRelTimeout < RT_NS_1SEC / HZ * 4) 140 140 { 141 141 pWait->fHighRes = true; 142 142 # if BITS_PER_LONG < 64 143 143 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)) 145 145 fFlags |= RTSEMWAIT_FLAGS_INDEFINITE; 146 146 else … … 151 151 #endif 152 152 { 153 uint64_t cJiffies = ASMMultU64ByU32DivByU32(pWait->cNsRelTimeout, HZ, UINT32_C(1000000000));153 uint64_t cJiffies = ASMMultU64ByU32DivByU32(pWait->cNsRelTimeout, HZ, RT_NS_1SEC); 154 154 if (cJiffies >= MAX_JIFFY_OFFSET) 155 155 fFlags |= RTSEMWAIT_FLAGS_INDEFINITE; … … 279 279 return RTR0SEMLNXWAIT_RESOLUTION; 280 280 #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.