ia64/xen-unstable

view unmodified_drivers/linux-2.6/platform-pci/panic-handler.c @ 18824:0b8c6c91c5a4

pv-on-hvm drivers: build fixes for Linux 2.6.27+

Make the drivers build properly in a 2.6.27 environment as well as
against a kernel with pv-ops Xen configured on (in the latter case
more work would be needed to also make the drivers work, as there's a
large number of duplicate exports).

Portions from Charles Arnold <carnold@novell.com>.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Nov 24 11:11:20 2008 +0000 (2008-11-24)
parents a88e19526770
children
line source
1 #include <linux/module.h>
2 #include <linux/init.h>
3 #include <linux/notifier.h>
4 #include <asm/hypervisor.h>
6 #ifdef HAVE_XEN_PLATFORM_COMPAT_H
7 #include <xen/platform-compat.h>
8 #endif
10 MODULE_LICENSE("GPL");
12 #ifdef __ia64__
13 static void
14 xen_panic_hypercall(struct unw_frame_info *info, void *arg)
15 {
16 current->thread.ksp = (__u64)info->sw - 16;
17 HYPERVISOR_shutdown(SHUTDOWN_crash);
18 /* we're never actually going to get here... */
19 }
20 #endif
22 static int
23 xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
24 {
25 #ifdef __ia64__
26 unw_init_running(xen_panic_hypercall, NULL);
27 #else /* !__ia64__ */
28 HYPERVISOR_shutdown(SHUTDOWN_crash);
29 #endif
30 /* we're never actually going to get here... */
31 return NOTIFY_DONE;
32 }
34 static struct notifier_block xen_panic_block = {
35 .notifier_call = xen_panic_event
36 };
38 int xen_panic_handler_init(void)
39 {
40 atomic_notifier_chain_register(&panic_notifier_list, &xen_panic_block);
41 return 0;
42 }