ia64/xen-unstable
changeset 17865:a88e19526770
pv-on-hvm: Fix panic-handler code to work on wider range of kernels.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Fri Jun 13 15:31:35 2008 +0100 (2008-06-13) |
parents | d4dcd4d39952 |
children | ac745ad5f018 |
files | unmodified_drivers/linux-2.6/platform-pci/panic-handler.c |
line diff
1.1 --- a/unmodified_drivers/linux-2.6/platform-pci/panic-handler.c Fri Jun 13 14:15:00 2008 +0100 1.2 +++ b/unmodified_drivers/linux-2.6/platform-pci/panic-handler.c Fri Jun 13 15:31:35 2008 +0100 1.3 @@ -3,6 +3,10 @@ 1.4 #include <linux/notifier.h> 1.5 #include <asm/hypervisor.h> 1.6 1.7 +#ifdef HAVE_XEN_PLATFORM_COMPAT_H 1.8 +#include <xen/platform-compat.h> 1.9 +#endif 1.10 + 1.11 MODULE_LICENSE("GPL"); 1.12 1.13 #ifdef __ia64__ 1.14 @@ -26,29 +30,13 @@ xen_panic_event(struct notifier_block *t 1.15 /* we're never actually going to get here... */ 1.16 return NOTIFY_DONE; 1.17 } 1.18 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) 1.19 + 1.20 static struct notifier_block xen_panic_block = { 1.21 - xen_panic_event, NULL, 0 /* try to go last */ 1.22 -}; 1.23 -#else 1.24 -static struct notifier_block xen_panic_block = { 1.25 - .notifier_call= xen_panic_event, 1.26 - .next= NULL, 1.27 - .priority= 0/* try to go last */ 1.28 + .notifier_call = xen_panic_event 1.29 }; 1.30 -#endif /*LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)*/ 1.31 - 1.32 -static int __init setup_panic_event(void) 1.33 -{ 1.34 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) 1.35 - notifier_chain_register(&panic_notifier_list, &xen_panic_block); 1.36 -#else 1.37 - atomic_notifier_chain_register(&panic_notifier_list, &xen_panic_block); 1.38 -#endif /*LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)*/ 1.39 - return 0; 1.40 -} 1.41 1.42 int xen_panic_handler_init(void) 1.43 { 1.44 - return setup_panic_event(); 1.45 + atomic_notifier_chain_register(&panic_notifier_list, &xen_panic_block); 1.46 + return 0; 1.47 }