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

Function tc_adjprecision

freebsd/kern/kern_tc.c:1881–1901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1879}
1880
1881static void __inline
1882tc_adjprecision(void)
1883{
1884 int t;
1885
1886 if (tc_timepercentage > 0) {
1887 t = (99 + tc_timepercentage) / tc_timepercentage;
1888 tc_precexp = fls(t + (t >> 1)) - 1;
1889 FREQ2BT(hz / tc_tick, &bt_timethreshold);
1890 FREQ2BT(hz, &bt_tickthreshold);
1891 bintime_shift(&bt_timethreshold, tc_precexp);
1892 bintime_shift(&bt_tickthreshold, tc_precexp);
1893 } else {
1894 tc_precexp = 31;
1895 bt_timethreshold.sec = INT_MAX;
1896 bt_timethreshold.frac = ~(uint64_t)0;
1897 bt_tickthreshold = bt_timethreshold;
1898 }
1899 sbt_timethreshold = bttosbt(bt_timethreshold);
1900 sbt_tickthreshold = bttosbt(bt_tickthreshold);
1901}
1902
1903static int
1904sysctl_kern_timecounter_adjprecision(SYSCTL_HANDLER_ARGS)

Callers 2

inittimecounterFunction · 0.85

Calls 3

bintime_shiftFunction · 0.85
bttosbtFunction · 0.85
flsFunction · 0.50

Tested by

no test coverage detected