Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/pmax/pmax Fix pmax timecounters for mips3-class mac...
details: https://anonhg.NetBSD.org/src/rev/b06196850b9e
branches: trunk
changeset: 763754:b06196850b9e
user: mhitch <mhitch%NetBSD.org@localhost>
date: Sun Apr 03 03:19:52 2011 +0000
description:
Fix pmax timecounters for mips3-class machines. Apparently no one else
has run a 5000/150 with 5.0 or later - I booted 5.0 a couple of time, but
clamd caused a hard hang. Now that I've given up trying to run clamd on
my 5000/150, I noticed that time ran too fast while using the
mips3_cp0_counter source. The cpu_mhz computed in mc_cpuspeed is the
CP0 clock speed, not the doubled CPU clock. Also add the mips3_cp0_counter
timecounters for the 5000/50 (maxine) and 5000/260 (3maxplus).
diffstat:
sys/arch/pmax/pmax/dec_3maxplus.c | 20 ++++++++++++++++++--
sys/arch/pmax/pmax/dec_3min.c | 7 ++-----
sys/arch/pmax/pmax/dec_maxine.c | 20 ++++++++++++++++++--
3 files changed, 38 insertions(+), 9 deletions(-)
diffs (120 lines):
diff -r 89dbe8f0be36 -r b06196850b9e sys/arch/pmax/pmax/dec_3maxplus.c
--- a/sys/arch/pmax/pmax/dec_3maxplus.c Sun Apr 03 01:20:23 2011 +0000
+++ b/sys/arch/pmax/pmax/dec_3maxplus.c Sun Apr 03 03:19:52 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_3maxplus.c,v 1.66 2011/02/20 07:50:25 matt Exp $ */
+/* $NetBSD: dec_3maxplus.c,v 1.67 2011/04/03 03:19:52 mhitch Exp $ */
/*
* Copyright (c) 1998 Jonathan Stone. All rights reserved.
@@ -70,7 +70,7 @@
#define __INTR_PRIVATE
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dec_3maxplus.c,v 1.66 2011/02/20 07:50:25 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_3maxplus.c,v 1.67 2011/04/03 03:19:52 mhitch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -433,6 +433,14 @@
static void
dec_3maxplus_tc_init(void)
{
+#if defined(MIPS3)
+ static struct timecounter tc3 = {
+ .tc_get_timecount = (timecounter_get_t *)mips3_cp0_count_read,
+ .tc_counter_mask = ~0u,
+ .tc_name = "mips3_cp0_counter",
+ .tc_quality = 200,
+ };
+#endif
static struct timecounter tc = {
.tc_get_timecount = dec_3maxplus_get_timecount,
.tc_quality = 100,
@@ -442,4 +450,12 @@
};
tc_init(&tc);
+
+#if defined(MIPS3)
+ if (MIPS_HAS_CLOCK) {
+ tc3.tc_frequency = mips_options.mips_cpu_mhz * 1000000;
+
+ tc_init(&tc3);
+ }
+#endif
}
diff -r 89dbe8f0be36 -r b06196850b9e sys/arch/pmax/pmax/dec_3min.c
--- a/sys/arch/pmax/pmax/dec_3min.c Sun Apr 03 01:20:23 2011 +0000
+++ b/sys/arch/pmax/pmax/dec_3min.c Sun Apr 03 03:19:52 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_3min.c,v 1.69 2011/03/10 17:13:13 tsutsui Exp $ */
+/* $NetBSD: dec_3min.c,v 1.70 2011/04/03 03:19:52 mhitch Exp $ */
/*
* Copyright (c) 1998 Jonathan Stone. All rights reserved.
@@ -70,7 +70,7 @@
#define __INTR_PRIVATE
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dec_3min.c,v 1.69 2011/03/10 17:13:13 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_3min.c,v 1.70 2011/04/03 03:19:52 mhitch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -469,9 +469,6 @@
if (MIPS_HAS_CLOCK) {
tc.tc_frequency = mips_options.mips_cpu_mhz * 1000000;
- if (mips_options.mips_cpu_flags & CPU_MIPS_DOUBLE_COUNT) {
- tc.tc_frequency /= 2;
- }
tc_init(&tc);
}
diff -r 89dbe8f0be36 -r b06196850b9e sys/arch/pmax/pmax/dec_maxine.c
--- a/sys/arch/pmax/pmax/dec_maxine.c Sun Apr 03 01:20:23 2011 +0000
+++ b/sys/arch/pmax/pmax/dec_maxine.c Sun Apr 03 03:19:52 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_maxine.c,v 1.61 2011/02/20 07:50:25 matt Exp $ */
+/* $NetBSD: dec_maxine.c,v 1.62 2011/04/03 03:19:52 mhitch Exp $ */
/*
* Copyright (c) 1998 Jonathan Stone. All rights reserved.
@@ -70,7 +70,7 @@
#define __INTR_PRIVATE
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dec_maxine.c,v 1.61 2011/02/20 07:50:25 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_maxine.c,v 1.62 2011/04/03 03:19:52 mhitch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -380,6 +380,14 @@
static void
dec_maxine_tc_init(void)
{
+#if defined(MIPS3)
+ static struct timecounter tc3 = {
+ .tc_get_timecount = (timecounter_get_t *)mips3_cp0_count_read,
+ .tc_counter_mask = ~0u,
+ .tc_name = "mips3_cp0_counter",
+ .tc_quality = 200,
+ };
+#endif
static struct timecounter tc = {
.tc_get_timecount = dec_maxine_get_timecount,
.tc_quality = 100,
@@ -389,4 +397,12 @@
};
tc_init(&tc);
+
+#if defined(MIPS3)
+ if (MIPS_HAS_CLOCK) {
+ tc3.tc_frequency = mips_options.mips_cpu_mhz * 1000000;
+
+ tc_init(&tc3);
+ }
+#endif
}
Home |
Main Index |
Thread Index |
Old Index