diff options
author | Richard Weinberger <richard@nod.at> | 2013-04-16 17:53:29 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2013-04-17 04:39:38 -0400 |
commit | 8198c1696a2cd15d436ade172bfd8085f5f818d3 (patch) | |
tree | caece15784505f1a19b49b643e6eef6c973af63a /arch/um | |
parent | 2412aa1293a4159c610616305c17efd237c8208d (diff) |
um: Use generic idle loop
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>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/Kconfig.common | 1 | ||||
-rw-r--r-- | arch/um/kernel/process.c | 27 |
2 files changed, 5 insertions, 23 deletions
diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common index bceee6623b00..57834067a511 100644 --- a/arch/um/Kconfig.common +++ b/arch/um/Kconfig.common | |||
@@ -12,6 +12,7 @@ config UML | |||
12 | select GENERIC_CPU_DEVICES | 12 | select GENERIC_CPU_DEVICES |
13 | select GENERIC_IO | 13 | select GENERIC_IO |
14 | select GENERIC_CLOCKEVENTS | 14 | select GENERIC_CLOCKEVENTS |
15 | select GENERIC_IDLE_LOOP | ||
15 | select TTY # Needed for line.c | 16 | select TTY # Needed for line.c |
16 | 17 | ||
17 | config MMU | 18 | config MMU |
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index b462b13c5bae..bbcef522bcb1 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c | |||
@@ -210,33 +210,14 @@ void initial_thread_cb(void (*proc)(void *), void *arg) | |||
210 | kmalloc_ok = save_kmalloc_ok; | 210 | kmalloc_ok = save_kmalloc_ok; |
211 | } | 211 | } |
212 | 212 | ||
213 | void default_idle(void) | 213 | void arch_cpu_idle(void) |
214 | { | 214 | { |
215 | unsigned long long nsecs; | 215 | unsigned long long nsecs; |
216 | 216 | ||
217 | while (1) { | ||
218 | /* endless idle loop with no priority at all */ | ||
219 | |||
220 | /* | ||
221 | * although we are an idle CPU, we do not want to | ||
222 | * get into the scheduler unnecessarily. | ||
223 | */ | ||
224 | if (need_resched()) | ||
225 | schedule(); | ||
226 | |||
227 | tick_nohz_idle_enter(); | ||
228 | rcu_idle_enter(); | ||
229 | nsecs = disable_timer(); | ||
230 | idle_sleep(nsecs); | ||
231 | rcu_idle_exit(); | ||
232 | tick_nohz_idle_exit(); | ||
233 | } | ||
234 | } | ||
235 | |||
236 | void cpu_idle(void) | ||
237 | { | ||
238 | cpu_tasks[current_thread_info()->cpu].pid = os_getpid(); | 217 | cpu_tasks[current_thread_info()->cpu].pid = os_getpid(); |
239 | default_idle(); | 218 | nsecs = disable_timer(); |
219 | idle_sleep(nsecs); | ||
220 | local_irq_enable(); | ||
240 | } | 221 | } |
241 | 222 | ||
242 | int __cant_sleep(void) { | 223 | int __cant_sleep(void) { |