Do not employ timecounter hardware if our hz does not support their

correct rewinding.
This commit is contained in:
phk 2002-09-04 19:32:18 +00:00
parent 649400e2dc
commit 8466938139

View File

@ -278,11 +278,19 @@ getmicrotime(struct timeval *tvp)
void
tc_init(struct timecounter *tc)
{
unsigned u;
printf("Timecounter \"%s\" frequency %lu Hz",
tc->tc_name, (u_long)tc->tc_frequency);
u = tc->tc_frequency / tc->tc_counter_mask;
if (u > hz) {
printf(" -- Insufficient hz, needs at least %u\n", u);
return;
}
tc->tc_next = timecounters;
timecounters = tc;
printf("Timecounter \"%s\" frequency %lu Hz\n",
tc->tc_name, (u_long)tc->tc_frequency);
printf("\n");
(void)tc->tc_get_timecount(tc);
(void)tc->tc_get_timecount(tc);
timecounter = tc;