Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/mips On mipsNN use trap instructions when inco...



details:   https://anonhg.NetBSD.org/src/rev/4c8e1f2bdb58
branches:  trunk
changeset: 338755:4c8e1f2bdb58
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Jun 06 21:45:40 2015 +0000

description:
On mipsNN use trap instructions when inconsistent status register settings
are found.

diffstat:

 sys/arch/mips/mips/locore_mips3.S |  25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diffs (52 lines):

diff -r 7d13f6a13ce2 -r 4c8e1f2bdb58 sys/arch/mips/mips/locore_mips3.S
--- a/sys/arch/mips/mips/locore_mips3.S Sat Jun 06 21:44:16 2015 +0000
+++ b/sys/arch/mips/mips/locore_mips3.S Sat Jun 06 21:45:40 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore_mips3.S,v 1.106 2015/06/04 22:44:43 matt Exp $  */
+/*     $NetBSD: locore_mips3.S,v 1.107 2015/06/06 21:45:40 matt Exp $  */
 
 /*
  * Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author)
@@ -174,19 +174,42 @@
 LEAF(mips_wait_idle)
        mfc0    v0, MIPS_COP_0_STATUS
        andi    v1, v0, MIPS_SR_INT_IE
+#if __mips >= 32
+       teqi    v1, 0
+#else
        beqz    v1, 1f
         nop
+#endif
        andi    v1, v0, MIPS_INT_MASK
+#if __mips >= 32
+       teqi    v1, 0
+#else
        bnez    v1, 2f
         nop
 1:
        move    a1, v0
        PANIC("mips_wait_idle: interrupts disabled status=%#x")
+#endif
 
 2:     wait
        nop
        nop
        nop
+       mfc0    v0, MIPS_COP_0_STATUS
+       andi    v1, v0, MIPS_SR_INT_IE
+#if __mips >= 32
+       teqi    v1, 0
+#else
+       beqz    v1, 1b
+        nop
+#endif
+       andi    v1, v0, MIPS_INT_MASK
+#if __mips >= 32
+       teqi    v1, 0
+#else
+       bnez    v1, 2b
+        nop
+#endif
        jr      ra
         nop
 END(mips_wait_idle)



Home | Main Index | Thread Index | Old Index