]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-mips/irqflags.h
[MIPS] SMTC: Fix SMTC dyntick support.
[linux-2.6-omap-h63xx.git] / include / asm-mips / irqflags.h
index e459fa05db83ca5e0c82040ef7e664a34e095880..701ec0ba8fa9cdd596369b9de3825b284bae1ec9 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/compiler.h>
 #include <asm/hazards.h>
 
-__asm__ (
+__asm__(
        "       .macro  raw_local_irq_enable                            \n"
        "       .set    push                                            \n"
        "       .set    reorder                                         \n"
@@ -38,8 +38,17 @@ __asm__ (
        "       .set    pop                                             \n"
        "       .endm");
 
+extern void smtc_ipi_replay(void);
+
 static inline void raw_local_irq_enable(void)
 {
+#ifdef CONFIG_MIPS_MT_SMTC
+       /*
+        * SMTC kernel needs to do a software replay of queued
+        * IPIs, at the cost of call overhead on each local_irq_enable()
+        */
+       smtc_ipi_replay();
+#endif
        __asm__ __volatile__(
                "raw_local_irq_enable"
                : /* no outputs */
@@ -47,6 +56,7 @@ static inline void raw_local_irq_enable(void)
                : "memory");
 }
 
+
 /*
  * For cli() we have to insert nops to make sure that the new value
  * has actually arrived in the status register before the end of this
@@ -65,7 +75,7 @@ static inline void raw_local_irq_enable(void)
  *
  * Workaround: mask EXL bit of the result or place a nop before mfc0.
  */
-__asm__ (
+__asm__(
        "       .macro  raw_local_irq_disable\n"
        "       .set    push                                            \n"
        "       .set    noat                                            \n"
@@ -96,7 +106,7 @@ static inline void raw_local_irq_disable(void)
                : "memory");
 }
 
-__asm__ (
+__asm__(
        "       .macro  raw_local_save_flags flags                      \n"
        "       .set    push                                            \n"
        "       .set    reorder                                         \n"
@@ -113,7 +123,7 @@ __asm__ __volatile__(                                                       \
        "raw_local_save_flags %0"                                       \
        : "=r" (x))
 
-__asm__ (
+__asm__(
        "       .macro  raw_local_irq_save result                       \n"
        "       .set    push                                            \n"
        "       .set    reorder                                         \n"
@@ -145,7 +155,7 @@ __asm__ __volatile__(                                                       \
        : /* no inputs */                                               \
        : "memory")
 
-__asm__ (
+__asm__(
        "       .macro  raw_local_irq_restore flags                     \n"
        "       .set    push                                            \n"
        "       .set    noreorder                                       \n"
@@ -185,15 +195,14 @@ __asm__ (
        "       .set    pop                                             \n"
        "       .endm                                                   \n");
 
-extern void smtc_ipi_replay(void);
 
 static inline void raw_local_irq_restore(unsigned long flags)
 {
        unsigned long __tmp1;
 
-#ifdef CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY
+#ifdef CONFIG_MIPS_MT_SMTC
        /*
-        * CONFIG_MIPS_MT_SMTC_INSTANT_REPLAY does prompt replay of deferred
+        * SMTC kernel needs to do a software replay of queued
         * IPIs, at the cost of branch and call overhead on each
         * local_irq_restore()
         */
@@ -208,6 +217,17 @@ static inline void raw_local_irq_restore(unsigned long flags)
                : "memory");
 }
 
+static inline void __raw_local_irq_restore(unsigned long flags)
+{
+       unsigned long __tmp1;
+
+       __asm__ __volatile__(
+               "raw_local_irq_restore\t%0"
+               : "=r" (__tmp1)
+               : "0" (flags)
+               : "memory");
+}
+
 static inline int raw_irqs_disabled_flags(unsigned long flags)
 {
 #ifdef CONFIG_MIPS_MT_SMTC