Changeset 48165 in vbox for trunk/src/VBox/Runtime/r0drv/solaris/timer-r0drv-solaris.c
- Timestamp:
- Aug 29, 2013 5:16:42 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/solaris/timer-r0drv-solaris.c
r48148 r48165 137 137 PRTTIMER pTimer = (PRTTIMER)pvArg; 138 138 AssertPtrReturnVoid(pTimer); 139 Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD)); 140 141 if (pTimer->fSuspended) 142 return; 139 143 140 144 if (pTimer->pSingleTimer) 141 145 { 146 /* For specific periodic timers, we might fire on the wrong CPU between cyclic_add() and cyclic_bind(). 147 Ignore these shots while we are temporarily rebinding to the right CPU. */ 148 if ( pTimer->fSpecificCpu 149 && pTimer->interval != 0 150 && pTimer->iCpu != RTMpCpuId()) /* ASSUMES: index == cpuid */ 151 { 152 return; 153 } 154 155 /* Allow RTTimer to be restarted for one-shot timers. */ 156 if (pTimer->interval == 0) 157 pTimer->fSuspended = true; 142 158 uint64_t u64Tick = ++pTimer->pSingleTimer->u64Tick; 143 159 pTimer->pfnTimer(pTimer, pTimer->pvUser, u64Tick); … … 203 219 return VERR_CPU_NOT_FOUND; 204 220 205 if ((fFlags & RTTIMER_FLAGS_CPU_ALL) == RTTIMER_FLAGS_CPU_ALL && u64NanoInterval == 0) 221 /* One-shot omni timers are not supported by the cyclic system. */ 222 if ( (fFlags & RTTIMER_FLAGS_CPU_ALL) == RTTIMER_FLAGS_CPU_ALL 223 && u64NanoInterval == 0) 224 { 206 225 return VERR_NOT_SUPPORTED; 207 208 /* One-shot timers are not supported by the cyclic system. */ 209 if (u64NanoInterval == 0) 226 } 227 228 /* One-shot specific timers are not supported. See rtTimerSolCallbackWrapper(). */ 229 if ( (fFlags & RTTIMER_FLAGS_CPU_ALL) != RTTIMER_FLAGS_CPU_ALL 230 && (fFlags & RTTIMER_FLAGS_CPU_SPECIFIC) 231 && u64NanoInterval == 0) 232 { 210 233 return VERR_NOT_SUPPORTED; 234 } 211 235 212 236 /* … … 274 298 return VERR_TIMER_ACTIVE; 275 299 276 /* One-shot timers are not supported by the cyclic system. */277 if (pTimer->interval == 0)278 return VERR_NOT_SUPPORTED;279 280 300 pTimer->fSuspended = false; 281 301 if (pTimer->fAllCpu) 282 302 { 303 Assert(pTimer->interval); 283 304 PRTR0OMNITIMERSOL pOmniTimer = RTMemAllocZ(sizeof(RTR0OMNITIMERSOL)); 284 305 if (RT_UNLIKELY(!pOmniTimer)) … … 338 359 pSingleTimer->hFireTime.cyt_when = u64First + RTTimeNanoTS(); 339 360 if (pTimer->interval == 0) 340 { 341 /** @todo use gethrtime_max instead of LLONG_MAX? */ 342 AssertCompileSize(pSingleTimer->hFireTime.cyt_interval, sizeof(long long)); 343 pSingleTimer->hFireTime.cyt_interval = LLONG_MAX - pSingleTimer->hFireTime.cyt_when; 344 } 361 pSingleTimer->hFireTime.cyt_interval = INT64_MAX - pSingleTimer->hFireTime.cyt_when; 345 362 else 346 363 pSingleTimer->hFireTime.cyt_interval = pTimer->interval; 347 348 /* Disable interrupts to prevent timer firing between cyclic_add() and cyclic_bind(). */349 RTCCUINTREG uEflags = ASMIntDisableFlags();350 364 351 365 pTimer->hCyclicId = cyclic_add(&pSingleTimer->hHandler, &pSingleTimer->hFireTime); … … 353 367 cyclic_bind(pTimer->hCyclicId, cpu[iCpu], NULL /* cpupart */); 354 368 355 ASMSetFlags(uEflags);356 369 mutex_exit(&cpu_lock); 357 370 }
Note:
See TracChangeset
for help on using the changeset viewer.