From: cheloha Date: Thu, 8 Sep 2022 03:06:33 +0000 (+0000) Subject: macppc: cpu_initclocks: install tb_timecounter before cpu_startclock() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b0c307ff42a7c5db766e6720b731cebd0381ff83;p=openbsd macppc: cpu_initclocks: install tb_timecounter before cpu_startclock() In the future, the clock interrupt code will need a real timecounter to work correctly. Nudge the tc_init(9) call for tb_timecounter up before cpu_startclock(). --- diff --git a/sys/arch/macppc/macppc/clock.c b/sys/arch/macppc/macppc/clock.c index 14428600e47..707164aa874 100644 --- a/sys/arch/macppc/macppc/clock.c +++ b/sys/arch/macppc/macppc/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.49 2022/07/24 00:28:09 cheloha Exp $ */ +/* $OpenBSD: clock.c,v 1.50 2022/09/08 03:06:33 cheloha Exp $ */ /* $NetBSD: clock.c,v 1.1 1996/09/30 16:34:40 ws Exp $ */ /* @@ -243,6 +243,9 @@ cpu_initclocks(void) #endif } + tb_timecounter.tc_frequency = ticks_per_sec; + tc_init(&tb_timecounter); + rtc_todr.todr_gettime = rtc_gettime; rtc_todr.todr_settime = rtc_settime; todr_handle = &rtc_todr; @@ -268,8 +271,6 @@ cpu_initclocks(void) cpu_startclock(); - tb_timecounter.tc_frequency = ticks_per_sec; - tc_init(&tb_timecounter); ppc_intr_enable(intrstate); }