panic-handler.c

来自「xen虚拟机源代码安装包」· C语言 代码 · 共 43 行

C
43
字号
#include <linux/module.h>#include <linux/init.h>#include <linux/notifier.h>#include <asm/hypervisor.h>#ifdef HAVE_XEN_PLATFORM_COMPAT_H#include <xen/platform-compat.h>#endifMODULE_LICENSE("GPL");#ifdef __ia64__static voidxen_panic_hypercall(struct unw_frame_info *info, void *arg){	current->thread.ksp = (__u64)info->sw - 16;	HYPERVISOR_shutdown(SHUTDOWN_crash);	/* we're never actually going to get here... */}#endifstatic intxen_panic_event(struct notifier_block *this, unsigned long event, void *ptr){#ifdef __ia64__	unw_init_running(xen_panic_hypercall, NULL);#else /* !__ia64__ */	HYPERVISOR_shutdown(SHUTDOWN_crash);#endif	/* we're never actually going to get here... */	return NOTIFY_DONE;}static struct notifier_block xen_panic_block = {	.notifier_call = xen_panic_event};int xen_panic_handler_init(void){	atomic_notifier_chain_register(&panic_notifier_list, &xen_panic_block);	return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?