Module Name: src
Committed By: mhitch
Date: Sun Apr 3 03:19:52 UTC 2011
Modified Files:
src/sys/arch/pmax/pmax: dec_3maxplus.c dec_3min.c dec_maxine.c
Log Message:
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).
To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/pmax/pmax/dec_3maxplus.c
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/pmax/pmax/dec_3min.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/pmax/pmax/dec_maxine.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/pmax/pmax/dec_3maxplus.c
diff -u src/sys/arch/pmax/pmax/dec_3maxplus.c:1.66 src/sys/arch/pmax/pmax/dec_3maxplus.c:1.67
--- src/sys/arch/pmax/pmax/dec_3maxplus.c:1.66 Sun Feb 20 07:50:25 2011
+++ src/sys/arch/pmax/pmax/dec_3maxplus.c Sun Apr 3 03:19:52 2011
@@ -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
}
Index: src/sys/arch/pmax/pmax/dec_3min.c
diff -u src/sys/arch/pmax/pmax/dec_3min.c:1.69 src/sys/arch/pmax/pmax/dec_3min.c:1.70
--- src/sys/arch/pmax/pmax/dec_3min.c:1.69 Thu Mar 10 17:13:13 2011
+++ src/sys/arch/pmax/pmax/dec_3min.c Sun Apr 3 03:19:52 2011
@@ -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);
}
Index: src/sys/arch/pmax/pmax/dec_maxine.c
diff -u src/sys/arch/pmax/pmax/dec_maxine.c:1.61 src/sys/arch/pmax/pmax/dec_maxine.c:1.62
--- src/sys/arch/pmax/pmax/dec_maxine.c:1.61 Sun Feb 20 07:50:25 2011
+++ src/sys/arch/pmax/pmax/dec_maxine.c Sun Apr 3 03:19:52 2011
@@ -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
}