bitkeeper revision 1.1236.29.1 (423473c16t30SQy1wWe3VG5fgnCn0Q)
authoriap10@freefall.cl.cam.ac.uk <iap10@freefall.cl.cam.ac.uk>
Sun, 13 Mar 2005 17:09:21 +0000 (17:09 +0000)
committeriap10@freefall.cl.cam.ac.uk <iap10@freefall.cl.cam.ac.uk>
Sun, 13 Mar 2005 17:09:21 +0000 (17:09 +0000)
Linux panic now calls HYPERVISOR_crash()
Signed-off-by: ian@xensource.com
linux-2.6.11-xen-sparse/arch/xen/i386/kernel/setup.c

index 0096c6b6d5451d71f21c504c802389f9a240e027..8fa31fbfc9e80c991d6cf8a4e5387e5551fef953 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/init.h>
 #include <linux/edd.h>
 #include <linux/percpu.h>
+#include <linux/notifier.h>
 #include <video/edid.h>
 #include <asm/e820.h>
 #include <asm/mpspec.h>
 /* Allows setting of maximum possible memory size  */
 static unsigned long xen_override_max_pfn;
 
+extern struct notifier_block *panic_notifier_list;
+static int xen_panic_event(struct notifier_block *, unsigned long, void *);
+static struct notifier_block xen_panic_block = {
+       xen_panic_event,
+        NULL,
+        0 /* try to go last */
+};
+
+
 int disable_pse __initdata = 0;
 
 /*
@@ -1398,6 +1408,9 @@ void __init setup_arch(char **cmdline_p)
        if ( panic_timeout == 0 )
                panic_timeout = 1;
 
+       /* Register a call for panic conditions. */
+       notifier_chain_register(&panic_notifier_list, &xen_panic_block);
+
        HYPERVISOR_vm_assist(VMASST_CMD_enable,
                             VMASST_TYPE_4gb_segments);
 
@@ -1598,6 +1611,16 @@ void __init setup_arch(char **cmdline_p)
        }
 }
 
+
+static int
+xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
+{
+     HYPERVISOR_crash();    
+     /* we're never actually going to get here... */
+     return NOTIFY_DONE;
+}
+
+
 #include "setup_arch_post.h"
 /*
  * Local Variables: