From: Kenn H. <ke...@us...> - 2005-04-07 22:36:00
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22898/arch/vax/kernel Modified Files: setup.c Log Message: Implement halt-on-panic via a panic notifier. This returns panic.c to pristine Linus condition Index: setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/kernel/setup.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- setup.c 2 Sep 2004 22:38:46 -0000 1.16 +++ setup.c 7 Apr 2005 22:35:50 -0000 1.17 @@ -20,6 +20,7 @@ #include <linux/major.h> #include <linux/kdev_t.h> #include <linux/root_dev.h> +#include <linux/notifier.h> #include <asm/rpb.h> #include <asm/page.h> @@ -81,6 +82,18 @@ .show = show_cpuinfo, }; +static int vax_panic_notifier(struct notifier_block *this, + unsigned long event, void *ptr) +{ + machine_halt(); + return NOTIFY_DONE; +} + +static struct notifier_block vax_panic_block = { + .notifier_call = vax_panic_notifier, + .priority = INT_MIN /* may not return; must be done last */ +}; + void __init setup_arch(char **cmdline_p) { unsigned long zones_size[MAX_NR_ZONES] = { 0, 0, 0 }; @@ -89,6 +102,8 @@ unsigned long region_start; unsigned long region_len; + notifier_chain_register(&panic_notifier_list, &vax_panic_block); + /* * save the command line from the boot block, before it gets * stomped on. |