patch-2.4.22 linux-2.4.22/include/asm-arm/arch-ebsa110/system.h

Next file: linux-2.4.22/include/asm-arm/arch-ebsa110/uncompress.h
Previous file: linux-2.4.22/include/asm-arm/arch-ebsa110/memory.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/include/asm-arm/arch-ebsa110/system.h linux-2.4.22/include/asm-arm/arch-ebsa110/system.h
@@ -17,29 +17,22 @@
  * will stop our MCLK signal (which provides the clock for the glue
  * logic, and therefore the timer interrupt).
  *
- * Instead, we spin, waiting for either hlt_counter or need_resched
- * to be set.  If we have been spinning for 2cs, then we drop the
- * core clock down to the memory clock.
+ * Instead, we spin, polling the IRQ_STAT register for the occurrence
+ * of any interrupt with core clock down to the memory clock.
  */
-static void arch_idle(void)
+static inline void arch_idle(void)
 {
-	unsigned long start_idle;
+	const char *irq_stat = (char *)0xff000000;
 
-	start_idle = jiffies;
+	/* disable clock switching */
+	asm volatile ("mcr%? p15, 0, %0, c15, c2, 2" : : "r" (0));
 
-	do {
-		if (current->need_resched || hlt_counter)
-			goto slow_out;
-	} while (time_before(jiffies, start_idle + HZ/50));
+	/* wait for an interrupt to occur */
+	while (!*irq_stat)
+		cpu_relax();
 
-	cpu_do_idle(IDLE_CLOCK_SLOW);
-
-	while (!current->need_resched && !hlt_counter) {
-		/* do nothing slowly */
-	}
-
-	cpu_do_idle(IDLE_CLOCK_FAST);
-slow_out:
+	/* enable clock switching */
+	asm volatile ("mcr%? p15, 0, %0, c15, c1, 2" : : "r" (0));
 }
 
 #define arch_reset(mode)	cpu_reset(0x80000000)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)