summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorTakuya ASADA <syuu@cvs.openbsd.org>2010-09-12 12:05:38 +0000
committerTakuya ASADA <syuu@cvs.openbsd.org>2010-09-12 12:05:38 +0000
commit02723f0de9100c40e75c482202ba0fc83614f121 (patch)
tree5ecf59ea222fa0c2763d5e5bd663aa6a75576c9c /sys/arch/mips64
parent84cf42af2eec4a8c356dbdda0af212242e93a196 (diff)
Avoid machine-check exception on OCTEON. ok miod@
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/mips64/tlbhandler.S15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/arch/mips64/mips64/tlbhandler.S b/sys/arch/mips64/mips64/tlbhandler.S
index f1ee520ed40..d96e343d765 100644
--- a/sys/arch/mips64/mips64/tlbhandler.S
+++ b/sys/arch/mips64/mips64/tlbhandler.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: tlbhandler.S,v 1.31 2010/02/13 14:07:30 miod Exp $ */
+/* $OpenBSD: tlbhandler.S,v 1.32 2010/09/12 12:05:37 syuu Exp $ */
/*
* Copyright (c) 1995-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -403,7 +403,12 @@ LEAF(tlb_flush, 0)
LA v0, CKSEG0_BASE # invalid address
dmfc0 ta0, COP_0_TLB_HI # Save the PID
+#ifdef CPU_OCTEON
+ mul ta2, ta1, 2 * PAGE_SIZE
+ addu v0, v0, ta2
+#else
dmtc0 v0, COP_0_TLB_HI # Mark entry high as invalid
+#endif
dmtc0 zero, COP_0_TLB_LO0 # Zero out low entry0.
dmtc0 zero, COP_0_TLB_LO1 # Zero out low entry1.
mtc0 zero, COP_0_TLB_PG_MASK # Zero out mask entry.
@@ -412,6 +417,10 @@ LEAF(tlb_flush, 0)
*/
1:
mtc0 ta1, COP_0_TLB_INDEX # Set the index register.
+#ifdef CPU_OCTEON
+ dmtc0 v0, COP_0_TLB_HI # Mark entry high as invalid
+ addu v0, v0, 2 * PAGE_SIZE
+#endif
addu ta1, ta1, 1 # Increment index.
nop
nop
@@ -461,6 +470,10 @@ LEAF(tlb_flush_addr, 0)
mfc0 v0, COP_0_TLB_INDEX # See what we got
bltz v0, 1f # index < 0 => !found
nop
+#ifdef CPU_OCTEON
+ mul ta2, v0, 2 * PAGE_SIZE
+ addu ta1, ta1, ta2
+#endif
dmtc0 ta1, COP_0_TLB_HI # Mark entry high as invalid
dmtc0 zero, COP_0_TLB_LO0 # Zero out low entry.