process.c (6546327ad187238ac63d2429701b32becb096fd8) | process.c (f7b861b7a6d9d1838cbbb5f4053e61578b86d134) |
---|---|
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 --- 43 unchanged lines hidden (view full) --- 52 "USER_32", "FIQ_32" , "IRQ_32" , "SVC_32" , "UK4_32" , "UK5_32" , "UK6_32" , "ABT_32" , 53 "UK8_32" , "UK9_32" , "UK10_32", "UND_32" , "UK12_32", "UK13_32", "UK14_32", "SYS_32" 54}; 55 56static const char *isa_modes[] = { 57 "ARM" , "Thumb" , "Jazelle", "ThumbEE" 58}; 59 | 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 --- 43 unchanged lines hidden (view full) --- 52 "USER_32", "FIQ_32" , "IRQ_32" , "SVC_32" , "UK4_32" , "UK5_32" , "UK6_32" , "ABT_32" , 53 "UK8_32" , "UK9_32" , "UK10_32", "UND_32" , "UK12_32", "UK13_32", "UK14_32", "SYS_32" 54}; 55 56static const char *isa_modes[] = { 57 "ARM" , "Thumb" , "Jazelle", "ThumbEE" 58}; 59 |
60static volatile int hlt_counter; 61 62void disable_hlt(void) 63{ 64 hlt_counter++; 65} 66 67void enable_hlt(void) 68{ 69 hlt_counter--; 70 BUG_ON(hlt_counter < 0); 71} 72 73static int __init nohlt_setup(char *__unused) 74{ 75 hlt_counter = 1; 76 return 1; 77} 78 79static int __init hlt_setup(char *__unused) 80{ 81 hlt_counter = 0; 82 return 1; 83} 84 85__setup("nohlt", nohlt_setup); 86__setup("hlt", hlt_setup); 87 | |
88extern void call_with_stack(void (*fn)(void *), void *arg, void *sp); 89typedef void (*phys_reset_t)(unsigned long); 90 91/* 92 * A temporary stack to use for CPU reset. This is static so that we 93 * don't clobber it with the identity mapping. When running with this 94 * stack, any references to the current task *will not work* so you 95 * should really do as little as possible before jumping to your reset --- 67 unchanged lines hidden (view full) --- 163{ 164 if (arm_pm_idle) 165 arm_pm_idle(); 166 else 167 cpu_do_idle(); 168 local_irq_enable(); 169} 170 | 60extern void call_with_stack(void (*fn)(void *), void *arg, void *sp); 61typedef void (*phys_reset_t)(unsigned long); 62 63/* 64 * A temporary stack to use for CPU reset. This is static so that we 65 * don't clobber it with the identity mapping. When running with this 66 * stack, any references to the current task *will not work* so you 67 * should really do as little as possible before jumping to your reset --- 67 unchanged lines hidden (view full) --- 135{ 136 if (arm_pm_idle) 137 arm_pm_idle(); 138 else 139 cpu_do_idle(); 140 local_irq_enable(); 141} 142 |
171/* 172 * The idle thread. 173 * We always respect 'hlt_counter' to prevent low power idle. 174 */ 175void cpu_idle(void) | 143void arch_cpu_idle_prepare(void) |
176{ 177 local_fiq_enable(); | 144{ 145 local_fiq_enable(); |
146} |
|
178 | 147 |
179 /* endless idle loop with no priority at all */ 180 while (1) { 181 tick_nohz_idle_enter(); 182 rcu_idle_enter(); 183 ledtrig_cpu(CPU_LED_IDLE_START); 184 while (!need_resched()) { 185#ifdef CONFIG_HOTPLUG_CPU 186 if (cpu_is_offline(smp_processor_id())) 187 cpu_die(); | 148void arch_cpu_idle_enter(void) 149{ 150 ledtrig_cpu(CPU_LED_IDLE_START); 151#ifdef CONFIG_PL310_ERRATA_769419 152 wmb(); |
188#endif | 153#endif |
154} |
|
189 | 155 |
190 /* 191 * We need to disable interrupts here 192 * to ensure we don't miss a wakeup call. 193 */ 194 local_irq_disable(); 195#ifdef CONFIG_PL310_ERRATA_769419 196 wmb(); | 156void arch_cpu_idle_exit(void) 157{ 158 ledtrig_cpu(CPU_LED_IDLE_END); 159} 160 161#ifdef CONFIG_HOTPLUG_CPU 162void arch_cpu_idle_dead(void) 163{ 164 cpu_die(); 165} |
197#endif | 166#endif |
198 if (hlt_counter) { 199 local_irq_enable(); 200 cpu_relax(); 201 } else if (!need_resched()) { 202 stop_critical_timings(); 203 if (cpuidle_idle_call()) 204 default_idle(); 205 start_critical_timings(); 206 /* 207 * default_idle functions must always 208 * return with IRQs enabled. 209 */ 210 WARN_ON(irqs_disabled()); 211 } else 212 local_irq_enable(); 213 } 214 ledtrig_cpu(CPU_LED_IDLE_END); 215 rcu_idle_exit(); 216 tick_nohz_idle_exit(); 217 schedule_preempt_disabled(); 218 } | 167 168/* 169 * Called from the core idle loop. 170 */ 171void arch_cpu_idle(void) 172{ 173 if (cpuidle_idle_call()) 174 default_idle(); |
219} 220 221static char reboot_mode = 'h'; 222 223int __init reboot_setup(char *str) 224{ 225 reboot_mode = str[0]; 226 return 1; --- 264 unchanged lines hidden --- | 175} 176 177static char reboot_mode = 'h'; 178 179int __init reboot_setup(char *str) 180{ 181 reboot_mode = str[0]; 182 return 1; --- 264 unchanged lines hidden --- |