]> Pileus Git - ~andy/linux/blobdiff - arch/mn10300/kernel/process.c
mn10300: Use generic idle loop
[~andy/linux] / arch / mn10300 / kernel / process.c
index 84f4e97e30745ad4d8e9b5d9e032dae5b775542b..2da39fb8b3b211351b7a4b402ebf7c4796d035d8 100644 (file)
@@ -50,77 +50,19 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
 void (*pm_power_off)(void);
 EXPORT_SYMBOL(pm_power_off);
 
-#if !defined(CONFIG_SMP) || defined(CONFIG_HOTPLUG_CPU)
-/*
- * we use this if we don't have any better idle routine
- */
-static void default_idle(void)
-{
-       local_irq_disable();
-       if (!need_resched())
-               safe_halt();
-       else
-               local_irq_enable();
-}
-
-#else /* !CONFIG_SMP || CONFIG_HOTPLUG_CPU  */
 /*
  * On SMP it's slightly faster (but much more power-consuming!)
  * to poll the ->work.need_resched flag instead of waiting for the
  * cross-CPU IPI to arrive. Use this option with caution.
+ *
+ * tglx: No idea why this depends on HOTPLUG_CPU !?!
  */
-static inline void poll_idle(void)
-{
-       int oldval;
-
-       local_irq_enable();
-
-       /*
-        * Deal with another CPU just having chosen a thread to
-        * run here:
-        */
-       oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED);
-
-       if (!oldval) {
-               set_thread_flag(TIF_POLLING_NRFLAG);
-               while (!need_resched())
-                       cpu_relax();
-               clear_thread_flag(TIF_POLLING_NRFLAG);
-       } else {
-               set_need_resched();
-       }
-}
-#endif /* !CONFIG_SMP || CONFIG_HOTPLUG_CPU */
-
-/*
- * the idle thread
- * - there's no useful work to be done, so just try to conserve power and have
- *   a low exit latency (ie sit in a loop waiting for somebody to say that
- *   they'd like to reschedule)
- */
-void cpu_idle(void)
+#if !defined(CONFIG_SMP) || defined(CONFIG_HOTPLUG_CPU)
+void arch_cpu_idle(void)
 {
-       /* endless idle loop with no priority at all */
-       for (;;) {
-               rcu_idle_enter();
-               while (!need_resched()) {
-                       void (*idle)(void);
-
-                       smp_rmb();
-                       if (!idle) {
-#if defined(CONFIG_SMP) && !defined(CONFIG_HOTPLUG_CPU)
-                               idle = poll_idle;
-#else  /* CONFIG_SMP && !CONFIG_HOTPLUG_CPU */
-                               idle = default_idle;
-#endif /* CONFIG_SMP && !CONFIG_HOTPLUG_CPU */
-                       }
-                       idle();
-               }
-               rcu_idle_exit();
-
-               schedule_preempt_disabled();
-       }
+       safe_halt();
 }
+#endif
 
 void release_segments(struct mm_struct *mm)
 {