um: Use generic idle loop
authorRichard Weinberger <richard@nod.at>
Tue, 16 Apr 2013 21:53:29 +0000 (23:53 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 17 Apr 2013 08:39:38 +0000 (10:39 +0200)
Signed-off-by: Richard Weinberger <richard@nod.at>
Cc: user-mode-linux-devel@lists.sourceforge.net
Link: http://lkml.kernel.org/r/1366149209-24787-1-git-send-email-richard@nod.at
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/um/Kconfig.common
arch/um/kernel/process.c

index bceee6623b00134023918cd5b62ec6144e3c66eb..57834067a5118bb43391c94c8a51cc5c3180efca 100644 (file)
@@ -12,6 +12,7 @@ config UML
        select GENERIC_CPU_DEVICES
        select GENERIC_IO
        select GENERIC_CLOCKEVENTS
+       select GENERIC_IDLE_LOOP
        select TTY # Needed for line.c
 
 config MMU
index b462b13c5bae3e8dd7211e205f2bf14a0347d821..bbcef522bcb18ad468fcb4c0d7738010b5e667ed 100644 (file)
@@ -210,33 +210,14 @@ void initial_thread_cb(void (*proc)(void *), void *arg)
        kmalloc_ok = save_kmalloc_ok;
 }
 
-void default_idle(void)
+void arch_cpu_idle(void)
 {
        unsigned long long nsecs;
 
-       while (1) {
-               /* endless idle loop with no priority at all */
-
-               /*
-                * although we are an idle CPU, we do not want to
-                * get into the scheduler unnecessarily.
-                */
-               if (need_resched())
-                       schedule();
-
-               tick_nohz_idle_enter();
-               rcu_idle_enter();
-               nsecs = disable_timer();
-               idle_sleep(nsecs);
-               rcu_idle_exit();
-               tick_nohz_idle_exit();
-       }
-}
-
-void cpu_idle(void)
-{
        cpu_tasks[current_thread_info()->cpu].pid = os_getpid();
-       default_idle();
+       nsecs = disable_timer();
+       idle_sleep(nsecs);
+       local_irq_enable();
 }
 
 int __cant_sleep(void) {