In the future, the clock interrupt will need a working timecounter to
accurately reschedule itself.
Move tc_init(9) up before cpu_startclock().
kettenis@ notes several other platforms need this same change. Maybe
we can do the rest all at once.
Tested by kettenis@.
Link: https://marc.info/?l=openbsd-tech&m=165343754512382&w=2
ok kettenis@
-/* $OpenBSD: clock.c,v 1.4 2022/08/09 04:40:08 cheloha Exp $ */
+/* $OpenBSD: clock.c,v 1.5 2022/08/11 17:15:21 cheloha Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
void
cpu_initclocks(void)
{
+ tb_timecounter.tc_frequency = tb_freq;
+ tc_init(&tb_timecounter);
+
tick_increment = tb_freq / hz;
stathz = 100;
evcount_attach(&stat_count, "stat", NULL);
cpu_startclock();
-
- tb_timecounter.tc_frequency = tb_freq;
- tc_init(&tb_timecounter);
}
void