summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2012-06-23 21:53:39 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2012-06-23 21:53:39 +0000
commit324f4b04e0878b995b836bdbbb069e524a5b6615 (patch)
treec1a4b055719c43657f274fd1d554f367d6b49ea1 /sys/arch
parentc9fa7acb2556d034f248b0805d6f06c2a364ccdb (diff)
Fix ITLBNOPFIX macro definition on RM7000-capable kernels, and use it
in cp0_set_config() for consistency.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mips64/include/asm.h11
-rw-r--r--sys/arch/mips64/mips64/cp0access.S3
2 files changed, 10 insertions, 4 deletions
diff --git a/sys/arch/mips64/include/asm.h b/sys/arch/mips64/include/asm.h
index 65289dcaf37..bc538953caa 100644
--- a/sys/arch/mips64/include/asm.h
+++ b/sys/arch/mips64/include/asm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asm.h,v 1.14 2011/03/23 16:54:36 pirofti Exp $ */
+/* $OpenBSD: asm.h,v 1.15 2012/06/23 21:53:38 miod Exp $ */
/*
* Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -30,8 +30,13 @@
#include <machine/regdef.h>
-#ifdef NEED_OLD_RM7KFIX
-#define ITLBNOPFIX nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
+/*
+ * Due to a flaw in RM7000 1.x processors a pipeline 'drain' is
+ * required after some mtc0 instructions.
+ * Ten nops in sequence does the trick.
+ */
+#ifdef CPU_RM7000
+#define ITLBNOPFIX nop;nop;nop;nop;nop;nop;nop;nop;nop;nop
#else
#define ITLBNOPFIX nop;nop;nop;nop
#endif
diff --git a/sys/arch/mips64/mips64/cp0access.S b/sys/arch/mips64/mips64/cp0access.S
index 7bb04346f0c..aa2d67f780f 100644
--- a/sys/arch/mips64/mips64/cp0access.S
+++ b/sys/arch/mips64/mips64/cp0access.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cp0access.S,v 1.15 2012/03/28 20:44:23 miod Exp $ */
+/* $OpenBSD: cp0access.S,v 1.16 2012/06/23 21:53:38 miod Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -157,6 +157,7 @@ END(cp0_get_config)
/* WARNING! Needs to be invoked from uncached address. */
LEAF(cp0_set_config, 0)
mtc0 a0, COP_0_CONFIG
+ ITLBNOPFIX
j ra
nop
END(cp0_set_config)