]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - arch/arm/kernel/process.c
Merge branch 'devel-stable' into devel
[karo-tx-linux.git] / arch / arm / kernel / process.c
index 43557a1eb6109d3f878fa58e882e10b97a534ab4..401e38be1f787c16e7b36d6429406a05229d83da 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/uaccess.h>
 #include <linux/random.h>
 
+#include <asm/cacheflush.h>
 #include <asm/leds.h>
 #include <asm/processor.h>
 #include <asm/system.h>
@@ -91,10 +92,9 @@ __setup("hlt", hlt_setup);
 
 void arm_machine_restart(char mode, const char *cmd)
 {
-       /*
-        * Clean and disable cache, and turn off interrupts
-        */
-       cpu_proc_fin();
+       /* Disable interrupts first */
+       local_irq_disable();
+       local_fiq_disable();
 
        /*
         * Tell the mm system that we are going to reboot -
@@ -103,6 +103,15 @@ void arm_machine_restart(char mode, const char *cmd)
         */
        setup_mm_for_reboot(mode);
 
+       /* Clean and invalidate caches */
+       flush_cache_all();
+
+       /* Turn off caching */
+       cpu_proc_fin();
+
+       /* Push out any further dirty data, and ensure cache is empty */
+       flush_cache_all();
+
        /*
         * Now call the architecture specific reboot code.
         */
@@ -196,19 +205,29 @@ int __init reboot_setup(char *str)
 
 __setup("reboot=", reboot_setup);
 
-void machine_halt(void)
+void machine_shutdown(void)
 {
+#ifdef CONFIG_SMP
+       smp_send_stop();
+#endif
 }
 
+void machine_halt(void)
+{
+       machine_shutdown();
+       while (1);
+}
 
 void machine_power_off(void)
 {
+       machine_shutdown();
        if (pm_power_off)
                pm_power_off();
 }
 
 void machine_restart(char *cmd)
 {
+       machine_shutdown();
        arm_pm_restart(reboot_mode, cmd);
 }