Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_timeout.c
Show First 20 Lines • Show All 896 Lines • ▼ Show 20 Lines | if ((flags & C_HARDCLOCK) != 0 || sbt >= sbt_tickthreshold) { | ||||
*/ | */ | ||||
#ifdef __LP64__ | #ifdef __LP64__ | ||||
to_sbt = DPCPU_GET(hardclocktime); | to_sbt = DPCPU_GET(hardclocktime); | ||||
#else | #else | ||||
spinlock_enter(); | spinlock_enter(); | ||||
to_sbt = DPCPU_GET(hardclocktime); | to_sbt = DPCPU_GET(hardclocktime); | ||||
spinlock_exit(); | spinlock_exit(); | ||||
#endif | #endif | ||||
if (cold && to_sbt == 0) | if (__predict_false(cold && to_sbt == 0)) { | ||||
to_sbt = sbinuptime(); | to_sbt = sbinuptime(); | ||||
to_sbt -= to_sbt % tick_sbt; | |||||
} | |||||
if ((flags & C_HARDCLOCK) == 0) | if ((flags & C_HARDCLOCK) == 0) | ||||
to_sbt += tick_sbt; | to_sbt += tick_sbt; | ||||
sbt -= sbt % tick_sbt; /* align timeout */ | |||||
} else | } else | ||||
to_sbt = sbinuptime(); | to_sbt = sbinuptime(); | ||||
if (SBT_MAX - to_sbt < sbt) | if (SBT_MAX - to_sbt < sbt) | ||||
to_sbt = SBT_MAX; | to_sbt = SBT_MAX; | ||||
else | else | ||||
to_sbt += sbt; | to_sbt += sbt; | ||||
*res = to_sbt; | *res = to_sbt; | ||||
to_pr = ((C_PRELGET(flags) < 0) ? sbt >> tc_precexp : | to_pr = ((C_PRELGET(flags) < 0) ? sbt >> tc_precexp : | ||||
▲ Show 20 Lines • Show All 638 Lines • Show Last 20 Lines |