aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/process.c')
-rw-r--r--arch/arm/kernel/process.c42
1 files changed, 37 insertions, 5 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index a4a9cc88bec7..401e38be1f78 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -28,7 +28,9 @@
28#include <linux/tick.h> 28#include <linux/tick.h>
29#include <linux/utsname.h> 29#include <linux/utsname.h>
30#include <linux/uaccess.h> 30#include <linux/uaccess.h>
31#include <linux/random.h>
31 32
33#include <asm/cacheflush.h>
32#include <asm/leds.h> 34#include <asm/leds.h>
33#include <asm/processor.h> 35#include <asm/processor.h>
34#include <asm/system.h> 36#include <asm/system.h>
@@ -36,6 +38,12 @@
36#include <asm/stacktrace.h> 38#include <asm/stacktrace.h>
37#include <asm/mach/time.h> 39#include <asm/mach/time.h>
38 40
41#ifdef CONFIG_CC_STACKPROTECTOR
42#include <linux/stackprotector.h>
43unsigned long __stack_chk_guard __read_mostly;
44EXPORT_SYMBOL(__stack_chk_guard);
45#endif
46
39static const char *processor_modes[] = { 47static const char *processor_modes[] = {
40 "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" , 48 "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" ,
41 "UK8_26" , "UK9_26" , "UK10_26", "UK11_26", "UK12_26", "UK13_26", "UK14_26", "UK15_26", 49 "UK8_26" , "UK9_26" , "UK10_26", "UK11_26", "UK12_26", "UK13_26", "UK14_26", "UK15_26",
@@ -84,10 +92,9 @@ __setup("hlt", hlt_setup);
84 92
85void arm_machine_restart(char mode, const char *cmd) 93void arm_machine_restart(char mode, const char *cmd)
86{ 94{
87 /* 95 /* Disable interrupts first */
88 * Clean and disable cache, and turn off interrupts 96 local_irq_disable();
89 */ 97 local_fiq_disable();
90 cpu_proc_fin();
91 98
92 /* 99 /*
93 * Tell the mm system that we are going to reboot - 100 * Tell the mm system that we are going to reboot -
@@ -96,6 +103,15 @@ void arm_machine_restart(char mode, const char *cmd)
96 */ 103 */
97 setup_mm_for_reboot(mode); 104 setup_mm_for_reboot(mode);
98 105
106 /* Clean and invalidate caches */
107 flush_cache_all();
108
109 /* Turn off caching */
110 cpu_proc_fin();
111
112 /* Push out any further dirty data, and ensure cache is empty */
113 flush_cache_all();
114
99 /* 115 /*
100 * Now call the architecture specific reboot code. 116 * Now call the architecture specific reboot code.
101 */ 117 */
@@ -189,19 +205,29 @@ int __init reboot_setup(char *str)
189 205
190__setup("reboot=", reboot_setup); 206__setup("reboot=", reboot_setup);
191 207
192void machine_halt(void) 208void machine_shutdown(void)
193{ 209{
210#ifdef CONFIG_SMP
211 smp_send_stop();
212#endif
194} 213}
195 214
215void machine_halt(void)
216{
217 machine_shutdown();
218 while (1);
219}
196 220
197void machine_power_off(void) 221void machine_power_off(void)
198{ 222{
223 machine_shutdown();
199 if (pm_power_off) 224 if (pm_power_off)
200 pm_power_off(); 225 pm_power_off();
201} 226}
202 227
203void machine_restart(char *cmd) 228void machine_restart(char *cmd)
204{ 229{
230 machine_shutdown();
205 arm_pm_restart(reboot_mode, cmd); 231 arm_pm_restart(reboot_mode, cmd);
206} 232}
207 233
@@ -426,3 +452,9 @@ unsigned long get_wchan(struct task_struct *p)
426 } while (count ++ < 16); 452 } while (count ++ < 16);
427 return 0; 453 return 0;
428} 454}
455
456unsigned long arch_randomize_brk(struct mm_struct *mm)
457{
458 unsigned long range_end = mm->brk + 0x02000000;
459 return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
460}