aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-08-04 10:59:22 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-08-04 10:59:22 +0100
commite7c388db06f0e8d040b35a67fa1dc06ab937e939 (patch)
treedfdde5f5f6598f049d476639697f91aa62ba4c86
parent269d43f9a2526321ad71c8f5fc44d3bc14e97f2b (diff)
downloadxen-e7c388db06f0e8d040b35a67fa1dc06ab937e939.tar.gz
xen-e7c388db06f0e8d040b35a67fa1dc06ab937e939.tar.bz2
xen-e7c388db06f0e8d040b35a67fa1dc06ab937e939.zip
Delay 5 seconds on reboot *after* stopping all CPUs.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
-rw-r--r--xen/arch/ia64/xen/domain.c3
-rw-r--r--xen/arch/x86/shutdown.c11
-rw-r--r--xen/common/keyhandler.c2
-rw-r--r--xen/common/shutdown.c5
-rw-r--r--xen/drivers/char/console.c3
-rw-r--r--xen/include/xen/shutdown.h2
6 files changed, 15 insertions, 11 deletions
diff --git a/xen/arch/ia64/xen/domain.c b/xen/arch/ia64/xen/domain.c
index b45d75afd8..23911dd6ce 100644
--- a/xen/arch/ia64/xen/domain.c
+++ b/xen/arch/ia64/xen/domain.c
@@ -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");
diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c
index a65771575f..c53fd3a1bf 100644
--- a/xen/arch/x86/shutdown.c
+++ b/xen/arch/x86/shutdown.c
@@ -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();
}
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index 93caa8ff80..d478db8ad3 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -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)
diff --git a/xen/common/shutdown.c b/xen/common/shutdown.c
index a3d48bf899..a8af94b130 100644
--- a/xen/common/shutdown.c
+++ b/xen/common/shutdown.c
@@ -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 */
}
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 31e73c3201..c326a6fd20 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -939,8 +939,7 @@ void panic(const char *fmt, ...)
else
{
watchdog_disable();
- mdelay(5000);
- machine_restart();
+ machine_restart(5000);
}
}
diff --git a/xen/include/xen/shutdown.h b/xen/include/xen/shutdown.h
index 3f6d0af8db..f29cb7d247 100644
--- a/xen/include/xen/shutdown.h
+++ b/xen/include/xen/shutdown.h
@@ -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);