ARC: create cpu specific version of arch_cpu_idle()
[linux-2.6-block.git] / arch / arc / kernel / process.c
index 2a018de6d6cdbce2abc9f02b9671c41136c9ffb7..fd5b2190a957fcbb0e96990dc9c1682a6d6739f9 100644 (file)
@@ -79,15 +79,29 @@ done:
        return uval;
 }
 
+#ifdef CONFIG_ISA_ARCV2
+
 void arch_cpu_idle(void)
 {
-       /* sleep, but enable all interrupts before committing */
+       /* Re-enable interrupts <= default irq priority before commiting SLEEP */
+       const unsigned int arg = 0x10 | ARCV2_IRQ_DEF_PRIO;
+
        __asm__ __volatile__(
                "sleep %0       \n"
                :
-               :"I"(ISA_SLEEP_ARG)); /* can't be "r" has to be embedded const */
+               :"I"(arg)); /* can't be "r" has to be embedded const */
+}
+
+#else
+
+void arch_cpu_idle(void)
+{
+       /* sleep, but enable both set E1/E2 (levels of interrutps) before committing */
+       __asm__ __volatile__("sleep 0x3 \n");
 }
 
+#endif
+
 asmlinkage void ret_from_fork(void);
 
 /*