# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1217844103 -3600
# Node ID 609d857d2f104aef335cd135dd1187850c93f49c
# Parent 39fec85f422123f39c9b4b42b9c73bc593f139e5
Delay 5 seconds on reboot *after* stopping all CPUs.
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
xen-unstable changeset: 18213:0c857419d354804ec4cf1548c4fd06bc4e26047e
xen-unstable date: Mon Aug 04 10:59:22 2008 +0100
---
xen/arch/ia64/xen/domain.c | 5 +++--
xen/arch/powerpc/domain.c | 6 ++++--
xen/arch/x86/shutdown.c | 11 ++++++++---
xen/common/keyhandler.c | 2 +-
xen/common/shutdown.c | 5 ++---
xen/drivers/char/console.c | 3 +--
xen/include/xen/shutdown.h | 2 +-
7 files changed, 20 insertions(+), 14 deletions(-)
diff -r 39fec85f4221 -r 609d857d2f10 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c Thu Jul 31 15:35:46 2008 +0100
+++ b/xen/arch/ia64/xen/domain.c Mon Aug 04 11:01:43 2008 +0100
@@ -2198,8 +2198,9 @@ int __init construct_dom0(struct domain
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 -r 39fec85f4221 -r 609d857d2f10 xen/arch/powerpc/domain.c
--- a/xen/arch/powerpc/domain.c Thu Jul 31 15:35:46 2008 +0100
+++ b/xen/arch/powerpc/domain.c Mon Aug 04 11:01:43 2008 +0100
@@ -24,6 +24,7 @@
#include <xen/config.h>
#include <xen/lib.h>
#include <xen/sched.h>
+#include <xen/delay.h>
#include <xen/mm.h>
#include <xen/serial.h>
#include <xen/domain.h>
@@ -119,8 +120,9 @@ void machine_halt(void)
machine_fail(__func__);
}
-void machine_restart(void)
-{
+void machine_restart(unsigned int delay_millisecs)
+{
+ mdelay(delay_millisecs);
console_start_sync();
printk("%s called\n", __func__);
rtas_reboot();
diff -r 39fec85f4221 -r 609d857d2f10 xen/arch/x86/shutdown.c
--- a/xen/arch/x86/shutdown.c Thu Jul 31 15:35:46 2008 +0100
+++ b/xen/arch/x86/shutdown.c Mon Aug 04 11:01:43 2008 +0100
@@ -200,7 +200,12 @@ static void machine_real_restart(const u
#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;
@@ -213,8 +218,8 @@ void machine_restart(void)
if ( GET_APIC_ID(apic_read(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 -r 39fec85f4221 -r 609d857d2f10 xen/common/keyhandler.c
--- a/xen/common/keyhandler.c Thu Jul 31 15:35:46 2008 +0100
+++ b/xen/common/keyhandler.c Mon Aug 04 11:01:43 2008 +0100
@@ -123,7 +123,7 @@ static void halt_machine(unsigned char k
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 -r 39fec85f4221 -r 609d857d2f10 xen/common/shutdown.c
--- a/xen/common/shutdown.c Thu Jul 31 15:35:46 2008 +0100
+++ b/xen/common/shutdown.c Mon Aug 04 11:01:43 2008 +0100
@@ -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 -r 39fec85f4221 -r 609d857d2f10 xen/drivers/char/console.c
--- a/xen/drivers/char/console.c Thu Jul 31 15:35:46 2008 +0100
+++ b/xen/drivers/char/console.c Mon Aug 04 11:01:43 2008 +0100
@@ -937,8 +937,7 @@ void panic(const char *fmt, ...)
else
{
watchdog_disable();
- mdelay(5000);
- machine_restart();
+ machine_restart(5000);
}
}
diff -r 39fec85f4221 -r 609d857d2f10 xen/include/xen/shutdown.h
--- a/xen/include/xen/shutdown.h Thu Jul 31 15:35:46 2008 +0100
+++ b/xen/include/xen/shutdown.h Mon Aug 04 11:01:43 2008 +0100
@@ -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);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|