Delay 5 seconds on reboot *after* stopping all CPUs.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 4 Aug 2008 09:59:22 +0000 (10:59 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 4 Aug 2008 09:59:22 +0000 (10:59 +0100)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/ia64/xen/domain.c
xen/arch/x86/shutdown.c
xen/common/keyhandler.c
xen/common/shutdown.c
xen/drivers/char/console.c
xen/include/xen/shutdown.h

index b45d75afd8d9dbb67fb3acd33321ba7305185283..23911dd6ce7a8a81cd363dc7b190ccdc1a6df842 100644 (file)
@@ -2212,8 +2212,9 @@ int __init construct_dom0(struct domain *d,
        return 0;
 }
 
-void machine_restart(void)
+void machine_restart(unsigned int delay_millisecs)
 {
+       mdelay(delay_millisecs);
        console_start_sync();
        if (running_on_sim)
                printk ("machine_restart called.  spinning...\n");
index a65771575f518540eeb57dacd528e3abde2e953c..c53fd3a1bf787d47eb20bd5677fb9c0b28cfb1bd 100644 (file)
@@ -291,7 +291,12 @@ __initcall(reboot_init);
 
 #endif
 
-void machine_restart(void)
+static void __machine_restart(void *pdelay)
+{
+    machine_restart(*(unsigned int *)pdelay);
+}
+
+void machine_restart(unsigned int delay_millisecs)
 {
     int i;
 
@@ -304,8 +309,8 @@ void machine_restart(void)
     if ( get_apic_id() != boot_cpu_physical_apicid )
     {
         /* Send IPI to the boot CPU (logical cpu 0). */
-        on_selected_cpus(cpumask_of_cpu(0), (void *)machine_restart,
-                         NULL, 1, 0);
+        on_selected_cpus(cpumask_of_cpu(0), __machine_restart,
+                         &delay_millisecs, 1, 0);
         for ( ; ; )
             halt();
     }
index 93caa8ff80a8f46c23c5b1c4af7c15b141b0912b..d478db8ad3c3d75c8c82e0fbf5536d28a3d5b127 100644 (file)
@@ -143,7 +143,7 @@ static void dump_dom0_registers(unsigned char key)
 static void halt_machine(unsigned char key, struct cpu_user_regs *regs)
 {
     printk("'%c' pressed -> rebooting machine\n", key);
-    machine_restart();
+    machine_restart(0);
 }
 
 static void cpuset_print(char *set, int size, cpumask_t mask)
index a3d48bf899e9c91b98996c2e6c96adebb30023c0..a8af94b130782a899296f45db8eef2666c127560 100644 (file)
@@ -23,8 +23,7 @@ static void maybe_reboot(void)
     {
         printk("rebooting machine in 5 seconds.\n");
         watchdog_disable();
-        mdelay(5000);
-        machine_restart();
+        machine_restart(5000);
     }
 }
 
@@ -50,7 +49,7 @@ void dom0_shutdown(u8 reason)
     case SHUTDOWN_reboot:
     {
         printk("Domain 0 shutdown: rebooting machine.\n");
-        machine_restart();
+        machine_restart(0);
         break; /* not reached */
     }
 
index 31e73c3201eb6784491e18f4124e68c3728dc490..c326a6fd2028f46b17654093bcab32e5c4f2427c 100644 (file)
@@ -939,8 +939,7 @@ void panic(const char *fmt, ...)
     else
     {
         watchdog_disable();
-        mdelay(5000);
-        machine_restart();
+        machine_restart(5000);
     }
 }
 
index 3f6d0af8db33dd0d7e8423c9d6ae005d4ff1b963..f29cb7d247657164b366417bc4ef321dc048fc16 100644 (file)
@@ -6,7 +6,7 @@ extern int opt_noreboot;
 
 void dom0_shutdown(u8 reason);
 
-void machine_restart(void);
+void machine_restart(unsigned int delay_millisecs);
 void machine_halt(void);
 void machine_power_off(void);