diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-03 17:31:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-03 17:31:24 -0400 |
commit | be82ae0238b0453afcf4a76f0512b7dde34ba500 (patch) | |
tree | aaa3f5f11fd51fd73365ee1a2164aad9a03de060 /arch/arm/kernel/process.c | |
parent | 4b4fd27c0b5ec638a1f06ced9226fd95229dbbf0 (diff) | |
parent | 7b70c4275f28702b76b273c8534c38f8313812e9 (diff) |
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (291 commits)
ARM: AMBA: Add pclk support to AMBA bus infrastructure
ARM: 6278/2: fix regression in RealView after the introduction of pclk
ARM: 6277/1: mach-shmobile: Allow users to select HZ, default to 128
ARM: 6276/1: mach-shmobile: remove duplicate NR_IRQS_LEGACY
ARM: 6246/1: mmci: support larger MMCIDATALENGTH register
ARM: 6245/1: mmci: enable hardware flow control on Ux500 variants
ARM: 6244/1: mmci: add variant data and default MCICLOCK support
ARM: 6243/1: mmci: pass power_mode to the translate_vdd callback
ARM: 6274/1: add global control registers definition header file for nuc900
mx2_camera: fix type of dma buffer virtual address pointer
mx2_camera: Add soc_camera support for i.MX25/i.MX27
arm/imx/gpio: add spinlock protection
ARM: Add support for the LPC32XX arch
ARM: LPC32XX: Arch config menu supoport and makefiles
ARM: LPC32XX: Phytec 3250 platform support
ARM: LPC32XX: Misc support functions
ARM: LPC32XX: Serial support code
ARM: LPC32XX: System suspend support
ARM: LPC32XX: GPIO, timer, and IRQ drivers
ARM: LPC32XX: Clock driver
...
Diffstat (limited to 'arch/arm/kernel/process.c')
-rw-r--r-- | arch/arm/kernel/process.c | 42 |
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> | ||
43 | unsigned long __stack_chk_guard __read_mostly; | ||
44 | EXPORT_SYMBOL(__stack_chk_guard); | ||
45 | #endif | ||
46 | |||
39 | static const char *processor_modes[] = { | 47 | static 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 | ||
85 | void arm_machine_restart(char mode, const char *cmd) | 93 | void 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 | ||
192 | void machine_halt(void) | 208 | void machine_shutdown(void) |
193 | { | 209 | { |
210 | #ifdef CONFIG_SMP | ||
211 | smp_send_stop(); | ||
212 | #endif | ||
194 | } | 213 | } |
195 | 214 | ||
215 | void machine_halt(void) | ||
216 | { | ||
217 | machine_shutdown(); | ||
218 | while (1); | ||
219 | } | ||
196 | 220 | ||
197 | void machine_power_off(void) | 221 | void 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 | ||
203 | void machine_restart(char *cmd) | 228 | void 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 | |||
456 | unsigned 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 | } | ||