Index: sys/kern/kern_clocksource.c =================================================================== --- sys/kern/kern_clocksource.c +++ sys/kern/kern_clocksource.c @@ -665,6 +665,7 @@ statperiod = SBT_1S / stathz; profperiod = SBT_1S / profhz; ET_LOCK(); + printf("CALLOUT: time when starting: %lx\n", sbinuptime()); configtimer(1); ET_UNLOCK(); } Index: sys/kern/kern_timeout.c =================================================================== --- sys/kern/kern_timeout.c +++ sys/kern/kern_timeout.c @@ -416,6 +416,31 @@ } SYSINIT(start_softclock, SI_SUB_SOFTINTR, SI_ORDER_FIRST, start_softclock, NULL); +static void +test_callout(void *arg) +{ + + printf("CALLOUT: %s fired at %lx\n", (const char *)arg, sbinuptime()); +} + +static void +test_callouts(void *dummy) +{ + static struct callout c1, c2, c4, c10; + + printf("CALLOUT: uptime at test start: %lx\n", sbinuptime()); + + callout_init(&c1, 1); + callout_init(&c2, 1); + callout_init(&c4, 1); + callout_init(&c10, 1); + callout_reset(&c1, hz, test_callout, "1 second"); + callout_reset(&c2, 2 * hz, test_callout, "2 second"); + callout_reset(&c4, 4 * hz, test_callout, "4 second"); + callout_reset(&c10, 10 * hz, test_callout, "10 second"); +} +SYSINIT(test_callouts, SI_SUB_SOFTINTR, SI_ORDER_SECOND, test_callouts, NULL); + #define CC_HASH_SHIFT 8 static inline u_int @@ -981,6 +1006,8 @@ spinlock_exit(); #endif #endif + if (cold && to_sbt == 0) + to_sbt = sbinuptime(); if ((flags & C_HARDCLOCK) == 0) to_sbt += tick_sbt; } else Index: sys/kern/subr_sleepqueue.c =================================================================== --- sys/kern/subr_sleepqueue.c +++ sys/kern/subr_sleepqueue.c @@ -386,7 +386,7 @@ MPASS(TD_ON_SLEEPQ(td)); MPASS(td->td_sleepqueue == NULL); MPASS(wchan != NULL); - if (cold) + if (cold && td == &thread0) panic("timed sleep before timers are working"); KASSERT(td->td_sleeptimo == 0, ("td %d %p td_sleeptimo %jx", td->td_tid, td, (uintmax_t)td->td_sleeptimo));