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 Add missing nops after mfc0 on mips1-3. M...



details:   https://anonhg.NetBSD.org/src/rev/e66bf484d22e
branches:  trunk
changeset: 816024:e66bf484d22e
user:      dholland <dholland%NetBSD.org@localhost>
date:      Mon Jun 13 01:14:29 2016 +0000

description:
Add missing nops after mfc0 on mips1-3. Mostly from coypu; should fix
an issue posted a month ago or so on port-pmax.

diffstat:

 sys/arch/mips/mips/locore.S |  14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diffs (66 lines):

diff -r 4066ae94f421 -r e66bf484d22e sys/arch/mips/mips/locore.S
--- a/sys/arch/mips/mips/locore.S       Mon Jun 13 00:04:40 2016 +0000
+++ b/sys/arch/mips/mips/locore.S       Mon Jun 13 01:14:29 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.197 2015/06/11 07:30:10 matt Exp $        */
+/*     $NetBSD: locore.S,v 1.198 2016/06/13 01:14:29 dholland Exp $    */
 
 /*
  * Copyright (c) 1992, 1993
@@ -70,6 +70,12 @@
 #define        NOP_L           /* nothing */
 #endif
 
+#if defined(MIPS1) || defined(MIPS2) || defined(MIPS3)
+#define MFC0_HAZARD    nop
+#else
+#define MFC0_HAZARD    /* nothing */
+#endif
+
        .set    noreorder
 
        .globl  start
@@ -187,6 +193,7 @@
        ei
 #else
        mfc0    v0, MIPS_COP_0_STATUS
+       MFC0_HAZARD
        or      v0, MIPS_SR_INT_IE
        mtc0    v0, MIPS_COP_0_STATUS
 #endif
@@ -226,6 +233,7 @@
 #endif
 
        mfc0    t0, MIPS_COP_0_STATUS
+       MFC0_HAZARD
        and     t0, MIPS_SR_INT_IE
 #if __mips >= 32
        teqi    t0, 0
@@ -350,6 +358,7 @@
 softint_cleanup:
 #ifdef PARANOIA
        mfc0    t1, MIPS_COP_0_STATUS
+       MFC0_HAZARD
        and     v0, t1, MIPS_SR_INT_IE
 #if __mips >= 32
        teqi    v0, 0
@@ -393,9 +402,11 @@
         */
        mfc0    t1, MIPS_COP_0_STATUS
 #if defined(PARANOIA) && __mips >= 32
+       MFC0_HAZARD
        and     v0, t1, MIPS_SR_INT_IE          # assert interrupts are on
        teqi    v0, 0
 #elif defined(PARANOID_LOOP)
+       MFC0_HAZARD
        and     v0, t1, MIPS_SR_INT_IE          # assert interrupts are on
 1:     beqz    v0, 1b
         nop
@@ -488,6 +499,7 @@
 LEAF(savectx)
 #ifdef PARANOIA
        mfc0    v0, MIPS_COP_0_STATUS
+       MFC0_HAZARD
        and     t0, v0, MIPS_SR_INT_IE
 #if __mips >= 32
        teqi    t0, 0



Home | Main Index | Thread Index | Old Index