Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/alpha/alpha Don't use the PCC timecunter on emulate...
details: https://anonhg.NetBSD.org/src/rev/d2d4696eedfe
branches: trunk
changeset: 955391:d2d4696eedfe
user: thorpej <thorpej%NetBSD.org@localhost>
date: Sun Sep 27 23:17:36 2020 +0000
description:
Don't use the PCC timecunter on emulated Qemu systems.
diffstat:
sys/arch/alpha/alpha/clock.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diffs (51 lines):
diff -r 735c1c8f6d7c -r d2d4696eedfe sys/arch/alpha/alpha/clock.c
--- a/sys/arch/alpha/alpha/clock.c Sun Sep 27 23:16:10 2020 +0000
+++ b/sys/arch/alpha/alpha/clock.c Sun Sep 27 23:17:36 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: clock.c,v 1.43 2020/09/04 03:41:49 thorpej Exp $ */
+/* $NetBSD: clock.c,v 1.44 2020/09/27 23:17:36 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.43 2020/09/04 03:41:49 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.44 2020/09/27 23:17:36 thorpej Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -47,6 +47,7 @@
#include <sys/device.h>
#include <sys/lwp.h>
+#include <machine/alpha.h>
#include <machine/autoconf.h>
#include <machine/cpuconf.h>
#include <machine/cpu_counter.h>
@@ -78,7 +79,6 @@
void
cpu_initclocks(void)
{
- uint64_t pcc_freq;
if (clock_init == NULL)
panic("cpu_initclocks: no clock attached");
@@ -99,10 +99,13 @@
schedhz = 16;
/*
- * Initialize PCC timecounter.
+ * Initialize PCC timecounter, unless we're running in Qemu
+ * (we will use a different timecounter in that case).
*/
- pcc_freq = cpu_frequency(curcpu());
- cc_init(NULL, pcc_freq, "PCC", PCC_QUAL);
+ if (! alpha_is_qemu) {
+ const uint64_t pcc_freq = cpu_frequency(curcpu());
+ cc_init(NULL, pcc_freq, "PCC", PCC_QUAL);
+ }
/*
* Get the clock started.
Home |
Main Index |
Thread Index |
Old Index