From: cheloha Date: Fri, 27 Jan 2023 15:37:16 +0000 (+0000) Subject: riscv64: initialize stathz, profhz like other platforms do X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5306634dc593786510f2860182776be737cd5cee;p=openbsd riscv64: initialize stathz, profhz like other platforms do Don't hardcode 100 and 1000. Use hz(9) for stathz, compute profhz using stathz, just like most other platforms. Link: https://marc.info/?l=openbsd-tech&m=167479021815637&w=2 ok jca@ --- diff --git a/sys/arch/riscv64/riscv64/clock.c b/sys/arch/riscv64/riscv64/clock.c index d681b669205..44459d35758 100644 --- a/sys/arch/riscv64/riscv64/clock.c +++ b/sys/arch/riscv64/riscv64/clock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clock.c,v 1.7 2022/12/03 15:03:49 jca Exp $ */ +/* $OpenBSD: clock.c,v 1.8 2023/01/27 15:37:16 cheloha Exp $ */ /* * Copyright (c) 2020 Mark Kettenis @@ -92,8 +92,8 @@ cpu_initclocks(void) timer_nsec_cycle_ratio = tb_freq * (1ULL << 32) / 1000000000; timer_nsec_max = UINT64_MAX / timer_nsec_cycle_ratio; - stathz = 100; - profhz = 1000; /* must be a multiple of stathz */ + stathz = hz; + profhz = stathz * 10; clockintr_init(CL_RNDSTAT); riscv_intc_intr_establish(IRQ_TIMER_SUPERVISOR, 0,