process.c (7eca30aef7961e68ad74c0ef920546c2be7f6579) process.c (bd2f55361f18347e890d52ff9cfd8895455ec11b)
1/*
2 * linux/arch/arm/kernel/process.c
3 *
4 * Copyright (C) 1996-2000 Russell King - Converted to ARM.
5 * Original Copyright (C) 1995 Linus Torvalds
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 47 unchanged lines hidden (view full) ---

56static const char *isa_modes[] = {
57 "ARM" , "Thumb" , "Jazelle", "ThumbEE"
58};
59
60extern void setup_mm_for_reboot(void);
61
62static volatile int hlt_counter;
63
1/*
2 * linux/arch/arm/kernel/process.c
3 *
4 * Copyright (C) 1996-2000 Russell King - Converted to ARM.
5 * Original Copyright (C) 1995 Linus Torvalds
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 47 unchanged lines hidden (view full) ---

56static const char *isa_modes[] = {
57 "ARM" , "Thumb" , "Jazelle", "ThumbEE"
58};
59
60extern void setup_mm_for_reboot(void);
61
62static volatile int hlt_counter;
63
64#include <mach/system.h>
65
64void disable_hlt(void)
65{
66 hlt_counter++;
67}
68
69EXPORT_SYMBOL(disable_hlt);
70
71void enable_hlt(void)

--- 102 unchanged lines hidden (view full) ---

174{
175 smp_mb();
176 /* kick all the CPUs so that they exit out of pm_idle */
177 smp_call_function(do_nothing, NULL, 1);
178}
179EXPORT_SYMBOL_GPL(cpu_idle_wait);
180
181/*
66void disable_hlt(void)
67{
68 hlt_counter++;
69}
70
71EXPORT_SYMBOL(disable_hlt);
72
73void enable_hlt(void)

--- 102 unchanged lines hidden (view full) ---

176{
177 smp_mb();
178 /* kick all the CPUs so that they exit out of pm_idle */
179 smp_call_function(do_nothing, NULL, 1);
180}
181EXPORT_SYMBOL_GPL(cpu_idle_wait);
182
183/*
182 * This is our default idle handler.
184 * This is our default idle handler. We need to disable
185 * interrupts here to ensure we don't miss a wakeup call.
183 */
186 */
184
185void (*arm_pm_idle)(void);
186
187static void default_idle(void)
188{
187static void default_idle(void)
188{
189 if (arm_pm_idle)
190 arm_pm_idle();
191 else
192 cpu_do_idle();
189 if (!need_resched())
190 arch_idle();
193 local_irq_enable();
194}
195
196void (*pm_idle)(void) = default_idle;
197EXPORT_SYMBOL(pm_idle);
198
199/*
200 * The idle thread, has rather strange semantics for calling pm_idle,

--- 11 unchanged lines hidden (view full) ---

212 rcu_idle_enter();
213 leds_event(led_idle_start);
214 while (!need_resched()) {
215#ifdef CONFIG_HOTPLUG_CPU
216 if (cpu_is_offline(smp_processor_id()))
217 cpu_die();
218#endif
219
191 local_irq_enable();
192}
193
194void (*pm_idle)(void) = default_idle;
195EXPORT_SYMBOL(pm_idle);
196
197/*
198 * The idle thread, has rather strange semantics for calling pm_idle,

--- 11 unchanged lines hidden (view full) ---

210 rcu_idle_enter();
211 leds_event(led_idle_start);
212 while (!need_resched()) {
213#ifdef CONFIG_HOTPLUG_CPU
214 if (cpu_is_offline(smp_processor_id()))
215 cpu_die();
216#endif
217
220 /*
221 * We need to disable interrupts here
222 * to ensure we don't miss a wakeup call.
223 */
224 local_irq_disable();
225#ifdef CONFIG_PL310_ERRATA_769419
226 wmb();
227#endif
228 if (hlt_counter) {
229 local_irq_enable();
230 cpu_relax();
218 local_irq_disable();
219#ifdef CONFIG_PL310_ERRATA_769419
220 wmb();
221#endif
222 if (hlt_counter) {
223 local_irq_enable();
224 cpu_relax();
231 } else if (!need_resched()) {
225 } else {
232 stop_critical_timings();
233 if (cpuidle_idle_call())
234 pm_idle();
235 start_critical_timings();
236 /*
226 stop_critical_timings();
227 if (cpuidle_idle_call())
228 pm_idle();
229 start_critical_timings();
230 /*
237 * pm_idle functions must always
238 * return with IRQs enabled.
231 * This will eventually be removed - pm_idle
232 * functions should always return with IRQs
233 * enabled.
239 */
240 WARN_ON(irqs_disabled());
234 */
235 WARN_ON(irqs_disabled());
241 } else
242 local_irq_enable();
236 local_irq_enable();
237 }
243 }
244 leds_event(led_idle_end);
245 rcu_idle_exit();
246 tick_nohz_idle_exit();
238 }
239 leds_event(led_idle_end);
240 rcu_idle_exit();
241 tick_nohz_idle_exit();
247 preempt_enable_no_resched();
248 schedule();
249 preempt_disable();
242 schedule_preempt_disabled();
250 }
251}
252
253static char reboot_mode = 'h';
254
255int __init reboot_setup(char *str)
256{
257 reboot_mode = str[0];

--- 295 unchanged lines hidden ---
243 }
244}
245
246static char reboot_mode = 'h';
247
248int __init reboot_setup(char *str)
249{
250 reboot_mode = str[0];

--- 295 unchanged lines hidden ---