diff options
author | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2022-09-08 03:09:41 +0000 |
---|---|---|
committer | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2022-09-08 03:09:41 +0000 |
commit | 82b2713b93ab5389a85fbe800c3e2ba5e68e35df (patch) | |
tree | d5bac9ae75af91f6746e3d9ec38f02ce204682eb /sys | |
parent | b15556e797c85633afc1a6c5a6cb1ffd10c5a310 (diff) |
riscv64: 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().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/riscv64/riscv64/clock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/riscv64/riscv64/clock.c b/sys/arch/riscv64/riscv64/clock.c index 75643f998f5..b1ddd387a40 100644 --- a/sys/arch/riscv64/riscv64/clock.c +++ b/sys/arch/riscv64/riscv64/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.4 2022/08/09 04:49:08 cheloha Exp $ */ +/* $OpenBSD: clock.c,v 1.5 2022/09/08 03:09:40 cheloha Exp $ */ /* * Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org> @@ -63,6 +63,9 @@ tb_get_timecount(struct timecounter *tc) void cpu_initclocks(void) { + tb_timecounter.tc_frequency = tb_freq; + tc_init(&tb_timecounter); + tick_increment = tb_freq / hz; stathz = 100; @@ -77,9 +80,6 @@ cpu_initclocks(void) evcount_attach(&stat_count, "stat", NULL); cpu_startclock(); - - tb_timecounter.tc_frequency = tb_freq; - tc_init(&tb_timecounter); } void |