]> err.no Git - linux-2.6/blobdiff - include/asm-mips/interrupt.h
Merge branch 'upstream'
[linux-2.6] / include / asm-mips / interrupt.h
index 0ba99f019be95e556edd1789915ca6b090ee650a..774348734fa0b38a8fbe916972a966a59302be17 100644 (file)
@@ -19,7 +19,7 @@ __asm__ (
        "       .set    push                                            \n"
        "       .set    reorder                                         \n"
        "       .set    noat                                            \n"
-#if defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)
+#ifdef CONFIG_CPU_MIPSR2
        "       ei                                                      \n"
 #else
        "       mfc0    $1,$12                                          \n"
@@ -47,16 +47,27 @@ static inline void local_irq_enable(void)
  * R4000/R4400 need three nops, the R4600 two nops and the R10000 needs
  * no nops at all.
  */
+/*
+ * For TX49, operating only IE bit is not enough.
+ *
+ * If mfc0 $12 follows store and the mfc0 is last instruction of a
+ * page and fetching the next instruction causes TLB miss, the result
+ * of the mfc0 might wrongly contain EXL bit.
+ *
+ * ERT-TX49H2-027, ERT-TX49H3-012, ERT-TX49HL3-006, ERT-TX49H4-008
+ *
+ * Workaround: mask EXL bit of the result or place a nop before mfc0.
+ */
 __asm__ (
        "       .macro  local_irq_disable\n"
        "       .set    push                                            \n"
        "       .set    noat                                            \n"
-#if defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)
+#ifdef CONFIG_CPU_MIPSR2
        "       di                                                      \n"
 #else
        "       mfc0    $1,$12                                          \n"
-       "       ori     $1,1                                            \n"
-       "       xori    $1,1                                            \n"
+       "       ori     $1,0x1f                                         \n"
+       "       xori    $1,0x1f                                         \n"
        "       .set    noreorder                                       \n"
        "       mtc0    $1,$12                                          \n"
 #endif
@@ -91,12 +102,13 @@ __asm__ (
        "       .set    push                                            \n"
        "       .set    reorder                                         \n"
        "       .set    noat                                            \n"
-#if defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)
+#ifdef CONFIG_CPU_MIPSR2
        "       di      \\result                                        \n"
+       "       andi    \\result, 1                                     \n"
 #else
        "       mfc0    \\result, $12                                   \n"
-       "       ori     $1, \\result, 1                                 \n"
-       "       xori    $1, 1                                           \n"
+       "       ori     $1, \\result, 0x1f                              \n"
+       "       xori    $1, 0x1f                                        \n"
        "       .set    noreorder                                       \n"
        "       mtc0    $1, $12                                         \n"
 #endif
@@ -113,10 +125,10 @@ __asm__ __volatile__(                                                     \
 
 __asm__ (
        "       .macro  local_irq_restore flags                         \n"
+       "       .set    push                                            \n"
        "       .set    noreorder                                       \n"
        "       .set    noat                                            \n"
-#if (defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)) && \
-    defined(CONFIG_IRQ_CPU)
+#if defined(CONFIG_CPU_MIPSR2) && defined(CONFIG_IRQ_CPU)
        /*
         * Slow, but doesn't suffer from a relativly unlikely race
         * condition we're having since days 1.
@@ -125,7 +137,7 @@ __asm__ (
        "        di                                                     \n"
        "       ei                                                      \n"
        "1:                                                             \n"
-#elif defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_CPU_MIPS64_R2)
+#elif defined(CONFIG_CPU_MIPSR2)
        /*
         * Fast, dangerous.  Life is fun, life is good.
         */
@@ -135,14 +147,13 @@ __asm__ (
 #else
        "       mfc0    $1, $12                                         \n"
        "       andi    \\flags, 1                                      \n"
-       "       ori     $1, 1                                           \n"
-       "       xori    $1, 1                                           \n"
+       "       ori     $1, 0x1f                                        \n"
+       "       xori    $1, 0x1f                                        \n"
        "       or      \\flags, $1                                     \n"
        "       mtc0    \\flags, $12                                    \n"
 #endif
        "       irq_disable_hazard                                      \n"
-       "       .set    at                                              \n"
-       "       .set    reorder                                         \n"
+       "       .set    pop                                             \n"
        "       .endm                                                   \n");
 
 #define local_irq_restore(flags)                                       \