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

Function resume_TSC

freebsd/x86/x86/tsc.c:681–705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679SYSINIT(tsc_tc, SI_SUB_SMP, SI_ORDER_ANY, init_TSC_tc, NULL);
680
681void
682resume_TSC(void)
683{
684#ifdef SMP
685 int quality;
686
687 /* If TSC was not good on boot, it is unlikely to become good now. */
688 if (tsc_timecounter.tc_quality < 0)
689 return;
690 /* Nothing to do with UP. */
691 if (mp_ncpus < 2)
692 return;
693
694 /*
695 * If TSC was good, a single synchronization should be enough,
696 * but honour smp_tsc_adjust if it's set.
697 */
698 quality = test_tsc(MAX(smp_tsc_adjust, 1));
699 if (quality != tsc_timecounter.tc_quality) {
700 printf("TSC timecounter quality changed: %d -> %d\n",
701 tsc_timecounter.tc_quality, quality);
702 tsc_timecounter.tc_quality = quality;
703 }
704#endif /* SMP */
705}
706
707/*
708 * When cpufreq levels change, find out about the (new) max frequency. We

Callers

nothing calls this directly

Calls 2

test_tscFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected