dmtimer(4): initialize stathz, profhz as other drivers, platforms do
authorcheloha <cheloha@openbsd.org>
Fri, 27 Jan 2023 22:16:52 +0000 (22:16 +0000)
committercheloha <cheloha@openbsd.org>
Fri, 27 Jan 2023 22:16:52 +0000 (22:16 +0000)
Don't hardcode stathz to 100 and profhz to 1000.  Instead, set stathz
to hz and profhz to (stathz * 10).  This is what we do in all other
armv7 clock interrupt drivers and most other platforms.

Link: https://marc.info/?l=openbsd-tech&m=167479021815637&w=2
ok kettenis@

sys/arch/armv7/omap/dmtimer.c

index 33e47bb..7e0436b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dmtimer.c,v 1.16 2023/01/17 02:32:07 cheloha Exp $    */
+/*     $OpenBSD: dmtimer.c,v 1.17 2023/01/27 22:16:52 cheloha Exp $    */
 /*
  * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
  * Copyright (c) 2013 Raphael Graf <r@undefined.ch>
@@ -230,8 +230,8 @@ dmtimer_cpu_initclocks(void)
 {
        struct dmtimer_softc    *sc = dmtimer_cd.cd_devs[1];
 
-       stathz = 100;
-       profhz = 1000;
+       stathz = hz;
+       profhz = stathz * 10;
        clockintr_init(CL_RNDSTAT);
 
        sc->sc_ticks_per_second = TIMER_FREQUENCY; /* 32768 */