MCPcopy Create free account
hub / github.com/F-Stack/f-stack / initclocks

Function initclocks

freebsd/kern/kern_clock.c:395–423  ·  view source on GitHub ↗

* Initialize clock frequencies and start both clocks running. */ ARGSUSED*/

Source from the content-addressed store, hash-verified

393 */
394/* ARGSUSED*/
395static void
396initclocks(void *dummy)
397{
398 int i;
399
400 /*
401 * Set divisors to 1 (normal case) and let the machine-specific
402 * code do its bit.
403 */
404 mtx_init(&time_lock, "time lock", NULL, MTX_DEF);
405 cpu_initclocks();
406
407 /*
408 * Compute profhz/stathz, and fix profhz if needed.
409 */
410 i = stathz ? stathz : hz;
411 if (profhz == 0)
412 profhz = i;
413 psratio = profhz / i;
414
415#ifdef SW_WATCHDOG
416 /* Enable hardclock watchdog now, even if a hardware watchdog exists. */
417 watchdog_attach();
418#else
419 /* Volunteer to run a software watchdog. */
420 if (wdog_software_attach == NULL)
421 wdog_software_attach = watchdog_attach;
422#endif
423}
424
425static __noinline void
426hardclock_itimer(struct thread *td, struct pstats *pstats, int cnt, int usermode)

Callers

nothing calls this directly

Calls 3

mtx_initFunction · 0.85
watchdog_attachFunction · 0.85
cpu_initclocksFunction · 0.50

Tested by

no test coverage detected