summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2022-08-18 06:31:37 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2022-08-18 06:31:37 +0000
commitde5e0ddb611f3f4b811481478469f149f2c1bab2 (patch)
tree29b2d658ee6fc47b50f0a7a0709605ad2ba055ae /sys/arch
parent51427ca86eb89c459a311ba74ea63032d69cef01 (diff)
Move recomputation of hz and stathz from glk to glkclk, lets a kernel with
glkclk disabled keep correct values of those. NFC
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/loongson/dev/glx.c9
-rw-r--r--sys/arch/loongson/dev/glxclk.c11
2 files changed, 10 insertions, 10 deletions
diff --git a/sys/arch/loongson/dev/glx.c b/sys/arch/loongson/dev/glx.c
index 86bfb2868d9..e44dc3bd374 100644
--- a/sys/arch/loongson/dev/glx.c
+++ b/sys/arch/loongson/dev/glx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: glx.c,v 1.11 2020/10/20 15:59:17 cheloha Exp $ */
+/* $OpenBSD: glx.c,v 1.12 2022/08/18 06:31:36 miod Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
@@ -120,13 +120,6 @@ glx_init(pci_chipset_tag_t pc, pcitag_t tag, int dev)
msr |= 4 << 24;
msr |= 3 << 28;
wrmsr(PIC_YSEL_HIGH, msr);
-
- /*
- * MFGPT runs on powers of two, adjust the hz value accordingly.
- */
- stathz = hz = 128;
- tick = 1000000 / hz;
- tick_nsec = 1000000000 / hz;
}
uint64_t
diff --git a/sys/arch/loongson/dev/glxclk.c b/sys/arch/loongson/dev/glxclk.c
index c2f1c41ff6c..72a08410c84 100644
--- a/sys/arch/loongson/dev/glxclk.c
+++ b/sys/arch/loongson/dev/glxclk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: glxclk.c,v 1.6 2022/04/06 18:59:26 naddy Exp $ */
+/* $OpenBSD: glxclk.c,v 1.7 2022/08/18 06:31:36 miod Exp $ */
/*
* Copyright (c) 2013 Paul Irofti.
@@ -19,7 +19,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
-#include <sys/proc.h>
+#include <sys/kernel.h>
#include <machine/bus.h>
#include <machine/autoconf.h>
@@ -130,6 +130,13 @@ glxclk_attach(struct device *parent, struct device *self, void *aux)
return;
}
+ /*
+ * MFGPT runs on powers of two, adjust the hz value accordingly.
+ */
+ stathz = hz = 128;
+ tick = 1000000 / hz;
+ tick_nsec = 1000000000 / hz;
+
printf(": clock");
/* Set comparator 2 */