您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ unhandled_signal函数代码示例

51自学网 2021-06-03 09:09:41
  C++
这篇教程C++ unhandled_signal函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中unhandled_signal函数的典型用法代码示例。如果您正苦于以下问题:C++ unhandled_signal函数的具体用法?C++ unhandled_signal怎么用?C++ unhandled_signal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了unhandled_signal函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: force_signal_inject

static void force_signal_inject(int signal, int code, struct pt_regs *regs,				unsigned long address){	siginfo_t info;	void __user *pc = (void __user *)instruction_pointer(regs);	const char *desc;	switch (signal) {	case SIGILL:		desc = "undefined instruction";		break;	case SIGSEGV:		desc = "illegal memory access";		break;	default:		desc = "bad mode";		break;	}	if (unhandled_signal(current, signal) &&	    show_unhandled_signals_ratelimited()) {		pr_info("%s[%d]: %s: pc=%p/n",			current->comm, task_pid_nr(current), desc, pc);		dump_instr(KERN_INFO, regs);	}	info.si_signo = signal;	info.si_errno = 0;	info.si_code  = code;	info.si_addr  = pc;	arm64_notify_die(desc, regs, &info, 0);}
开发者ID:MISL-EBU-System-SW,项目名称:mainline-public,代码行数:33,


示例2: __do_user_fault

/* * Something tried to access memory that isn't in our memory map. User mode * accesses just cause a SIGSEGV */static void __do_user_fault(struct task_struct *tsk, unsigned long addr,                            unsigned int esr, unsigned int sig, int code,                            struct pt_regs *regs){    struct siginfo si;    trace_user_fault(tsk, addr, esr);    if (show_unhandled_signals && unhandled_signal(tsk, sig) &&            printk_ratelimit()) {        pr_info("%s[%d]: unhandled %s (%d) at 0x%08lx, esr 0x%03x/n",                tsk->comm, task_pid_nr(tsk), fault_name(esr), sig,                addr, esr);        show_pte(tsk->mm, addr);        show_regs(regs);    }    tsk->thread.fault_address = addr;    tsk->thread.fault_code = esr;    si.si_signo = sig;    si.si_errno = 0;    si.si_code = code;    si.si_addr = (void __user *)addr;    force_sig_info(sig, &si, tsk);}
开发者ID:pranav01,项目名称:android_kernel_cyanogen_msm8916,代码行数:29,


示例3: do_undefinstr

asmlinkage void __exception do_undefinstr(struct pt_regs *regs){	siginfo_t info;	void __user *pc = (void __user *)instruction_pointer(regs);	/* check for AArch32 breakpoint instructions */	if (!aarch32_break_handler(regs))		return;	if (call_undef_hook(regs) == 0)		return;	if (unhandled_signal(current, SIGILL) && show_unhandled_signals_ratelimited()) {#ifdef CONFIG_HUAWEI_PRINTK_CTRL		printk_level_setup(LOGLEVEL_DEBUG);#endif		pr_info("%s[%d]: undefined instruction: pc=%p/n",			current->comm, task_pid_nr(current), pc);		dump_instr(KERN_INFO, regs);#ifdef CONFIG_HUAWEI_PRINTK_CTRL		printk_level_setup(sysctl_printk_level);#endif	}	info.si_signo = SIGILL;	info.si_errno = 0;	info.si_code  = ILL_ILLOPC;	info.si_addr  = pc;	arm64_notify_die("Oops - undefined instruction", regs, &info, 0);}
开发者ID:fromfuture,项目名称:Elizium,代码行数:31,


示例4: do_general_protection

asmlinkage void __kprobes do_general_protection(struct pt_regs * regs,						long error_code){	conditional_sti(regs);	if (user_mode(regs)) {		struct task_struct *tsk = current;		if (exception_trace && unhandled_signal(tsk, SIGSEGV))			printk(KERN_INFO		       "%s[%d] general protection rip:%lx rsp:%lx error:%lx/n",			       tsk->comm, tsk->pid,			       regs->rip,regs->rsp,error_code); 		tsk->thread.error_code = error_code;		tsk->thread.trap_no = 13;		force_sig(SIGSEGV, tsk);		return;	} 	/* kernel gp */	{		const struct exception_table_entry *fixup;		fixup = search_exception_tables(regs->rip);		if (fixup) {			regs->rip = fixup->fixup;			return;		}		if (notify_die(DIE_GPF, "general protection fault", regs,					error_code, 13, SIGSEGV) == NOTIFY_STOP)			return;		die("general protection fault", regs, error_code);	}}
开发者ID:gnensis,项目名称:linux-2.6.15,代码行数:34,


示例5: do_undefinstr

asmlinkage void __exception do_undefinstr(struct pt_regs *regs){	siginfo_t info;	void __user *pc = (void __user *)instruction_pointer(regs);	/* check for AArch32 breakpoint instructions */	if (!aarch32_break_handler(regs))		return;	if (call_undef_hook(regs) == 0)		return;	if (show_unhandled_signals && unhandled_signal(current, SIGILL) &&	    printk_ratelimit()) {		pr_info("%s[%d]: undefined instruction: pc=%p/n",			current->comm, task_pid_nr(current), pc);		dump_instr(KERN_INFO, regs);	}	info.si_signo = SIGILL;	info.si_errno = 0;	info.si_code  = ILL_ILLOPC;	info.si_addr  = pc;	arm64_notify_die("Oops - undefined instruction", regs, &info, 0);}
开发者ID:Goshin,项目名称:android_kernel_mediatek,代码行数:26,


示例6: do_general_protection

dotraplinkage void __kprobesdo_general_protection(struct pt_regs *regs, long error_code){	struct task_struct *tsk;	conditional_sti(regs);#ifdef CONFIG_X86_32	if (lazy_iobitmap_copy()) {		/* restart the faulting instruction */		return;	}	if (regs->flags & X86_VM_MASK)		goto gp_in_vm86;#endif	tsk = current;	if (!user_mode(regs))		goto gp_in_kernel;	tsk->thread.error_code = error_code;	tsk->thread.trap_no = 13;	if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&			printk_ratelimit()) {		printk(KERN_INFO			"%s[%d] general protection ip:%lx sp:%lx error:%lx",			tsk->comm, task_pid_nr(tsk),			regs->ip, regs->sp, error_code);		print_vma_addr(" in ", regs->ip);		printk("/n");	}	force_sig(SIGSEGV, tsk);	return;#ifdef CONFIG_X86_32gp_in_vm86:	local_irq_enable();	handle_vm86_fault((struct kernel_vm86_regs *) regs, error_code);	return;#endifgp_in_kernel:	if (fixup_exception(regs))		return;	tsk->thread.error_code = error_code;	tsk->thread.trap_no = 13;	if (notify_die(DIE_GPF, "general protection fault", regs,				error_code, 13, SIGSEGV) == NOTIFY_STOP)		return;	die("general protection fault", regs, error_code);}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:55,


示例7: report_user_fault

static inline void report_user_fault(struct pt_regs *regs, int signr){    if ((task_pid_nr(current) > 1) && !show_unhandled_signals)        return;    if (!unhandled_signal(current, signr))        return;    if (!printk_ratelimit())        return;    printk("User process fault: interruption code %04x ilc:%d ",           regs->int_code & 0xffff, regs->int_code >> 17);    print_vma_addr("in ", regs->psw.addr & PSW_ADDR_INSN);    printk("/n");    show_regs(regs);}
开发者ID:lilinj2000,项目名称:linux-4.3.3,代码行数:14,


示例8: report_user_fault

static inline void report_user_fault(struct pt_regs *regs, long int_code,				     int signr, unsigned long address){	if ((task_pid_nr(current) > 1) && !show_unhandled_signals)		return;	if (!unhandled_signal(current, signr))		return;	if (!printk_ratelimit())		return;	printk("User process fault: interruption code 0x%lX ", int_code);	print_vma_addr(KERN_CONT "in ", regs->psw.addr & PSW_ADDR_INSN);	printk("/n");	printk("failing address: %lX/n", address);	show_regs(regs);}
开发者ID:AmeriCanAndroid,项目名称:aca-evo3d-gsm-omega-3.0-mdj,代码行数:15,


示例9: report_user_fault

static inline void report_user_fault(struct pt_regs *regs, long signr){	if ((task_pid_nr(current) > 1) && !show_unhandled_signals)		return;	if (!unhandled_signal(current, signr))		return;	if (!printk_ratelimit())		return;	printk(KERN_ALERT "User process fault: interruption code 0x%X ",	       regs->int_code);	print_vma_addr(KERN_CONT "in ", regs->psw.addr & PSW_ADDR_INSN);	printk(KERN_CONT "/n");	printk(KERN_ALERT "failing address: %lX/n",	       regs->int_parm_long & __FAIL_ADDR_MASK);	show_regs(regs);}
开发者ID:turter99,项目名称:android_kernel_samsung_jaltektt_perseus_4.2.2,代码行数:16,


示例10: report_user_fault

void report_user_fault(struct pt_regs *regs, long signr, int is_mm_fault){	if ((task_pid_nr(current) > 1) && !show_unhandled_signals)		return;	if (!unhandled_signal(current, signr))		return;	if (!printk_ratelimit())		return;	printk(KERN_ALERT "User process fault: interruption code %04x ilc:%d ",	       regs->int_code & 0xffff, regs->int_code >> 17);	print_vma_addr(KERN_CONT "in ", regs->psw.addr);	printk(KERN_CONT "/n");	if (is_mm_fault)		dump_fault_info(regs);	show_regs(regs);}
开发者ID:Daniel-Abrecht,项目名称:linux,代码行数:16,


示例11: do_undefinstr

asmlinkage void __exception do_undefinstr(struct pt_regs *regs){	u32 instr;	siginfo_t info;	void __user *pc = (void __user *)instruction_pointer(regs);	struct thread_info *thread = current_thread_info();	/* check for AArch32 breakpoint instructions */	if (!aarch32_break_handler(regs))		return;	if (user_mode(regs)) {		if (compat_thumb_mode(regs)) {			if (get_user(instr, (u16 __user *)pc))				goto die_sig;			if (is_wide_instruction(instr)) {				u32 instr2;				if (get_user(instr2, (u16 __user *)pc+1))					goto die_sig;				instr <<= 16;				instr |= instr2;			}		} else if (get_user(instr, (u32 __user *)pc)) {			goto die_sig;		}	} else {		/* kernel mode */		instr = *((u32 *)pc);	}	if (call_undef_hook(regs, instr) == 0)		return;die_sig:	if (show_unhandled_signals && unhandled_signal(current, SIGILL) &&	    printk_ratelimit()) {		pr_info("%s[%d]: undefined instruction: pc=%p/n",			current->comm, task_pid_nr(current), pc);		dump_instr(KERN_INFO, regs);	}	info.si_signo = SIGILL;	info.si_errno = 0;	info.si_code  = ILL_ILLOPC;	info.si_addr  = pc;	arm64_notify_die("Oops - undefined instruction", regs, &info, 0);}
开发者ID:Duiesel,项目名称:ZTE_Blade_L5,代码行数:47,


示例12: do_sp_pc_abort

/* * Handle stack alignment exceptions. */asmlinkage void __exception do_sp_pc_abort(unsigned long addr,					   unsigned int esr,					   struct pt_regs *regs){	struct siginfo info;	struct task_struct *tsk = current;	if (show_unhandled_signals && unhandled_signal(tsk, SIGBUS))		pr_info_ratelimited("%s[%d]: %s exception: pc=%p sp=%p/n",				    tsk->comm, task_pid_nr(tsk),				    esr_get_class_string(esr), (void *)regs->pc,				    (void *)regs->sp);	info.si_signo = SIGBUS;	info.si_errno = 0;	info.si_code  = BUS_ADRALN;	info.si_addr  = (void __user *)addr;	arm64_notify_die("Oops - SP/PC alignment exception", regs, &info, esr);}
开发者ID:apinski-cavium,项目名称:linux,代码行数:22,


示例13: show_segv_info

static void show_segv_info(struct uml_pt_regs *regs){	struct task_struct *tsk = current;	struct faultinfo *fi = UPT_FAULTINFO(regs);	if (!unhandled_signal(tsk, SIGSEGV))		return;	if (!printk_ratelimit())		return;	printk("%s%s[%d]: segfault at %lx ip %p sp %p error %x",		task_pid_nr(tsk) > 1 ? KERN_INFO : KERN_EMERG,		tsk->comm, task_pid_nr(tsk), FAULT_ADDRESS(*fi),		(void *)UPT_IP(regs), (void *)UPT_SP(regs),		fi->error_code);	print_vma_addr(KERN_CONT " in ", UPT_IP(regs));	printk(KERN_CONT "/n");}
开发者ID:18712886438,项目名称:android_kernel_motorola_quark,代码行数:20,


示例14: arm64_show_signal

static void arm64_show_signal(int signo, const char *str){	static DEFINE_RATELIMIT_STATE(rs, DEFAULT_RATELIMIT_INTERVAL,				      DEFAULT_RATELIMIT_BURST);	struct task_struct *tsk = current;	unsigned int esr = tsk->thread.fault_code;	struct pt_regs *regs = task_pt_regs(tsk);	/* Leave if the signal won't be shown */	if (!show_unhandled_signals ||	    !unhandled_signal(tsk, signo) ||	    !__ratelimit(&rs))		return;	pr_info("%s[%d]: unhandled exception: ", tsk->comm, task_pid_nr(tsk));	if (esr)		pr_cont("%s, ESR 0x%08x, ", esr_get_class_string(esr), esr);	pr_cont("%s", str);	print_vma_addr(KERN_CONT " in ", regs->pc);	pr_cont("/n");	__show_regs(regs);}
开发者ID:150balbes,项目名称:Amlogic_s905-kernel,代码行数:23,


示例15: do_trap

static void __kprobes do_trap(int trapnr, int signr, char *str,			      struct pt_regs * regs, long error_code,			      siginfo_t *info){	conditional_sti(regs);	if (user_mode(regs)) {		struct task_struct *tsk = current;		if (exception_trace && unhandled_signal(tsk, signr))			printk(KERN_INFO			       "%s[%d] trap %s rip:%lx rsp:%lx error:%lx/n",			       tsk->comm, tsk->pid, str,			       regs->rip,regs->rsp,error_code); 		tsk->thread.error_code = error_code;		tsk->thread.trap_no = trapnr;		if (info)			force_sig_info(signr, info, tsk);		else			force_sig(signr, tsk);		return;	}	/* kernel trap */ 	{	     		const struct exception_table_entry *fixup;		fixup = search_exception_tables(regs->rip);		if (fixup) {			regs->rip = fixup->fixup;		} else				die(str, regs, error_code);		return;	}}
开发者ID:gnensis,项目名称:linux-2.6.15,代码行数:36,


示例16: do_trap

static void __kprobesdo_trap(int trapnr, int signr, const char *str, struct pt_regs *regs,	long error_code, siginfo_t *info){	struct task_struct *tsk = current;#ifdef CONFIG_X86_32	if (v8086_mode(regs)) {		/*		 * traps 0, 1, 3, 4, and 5 should be forwarded to vm86.		 * On nmi (interrupt 2), do_trap should not be called.		 */		if (trapnr < 6)			goto vm86_trap;		goto trap_signal;	}#endif	if (!user_mode_novm(regs))		goto kernel_trap;#ifdef CONFIG_X86_32trap_signal:#endif	/*	 * We want error_code and trap_no set for userspace faults and	 * kernelspace faults which result in die(), but not	 * kernelspace faults which are fixed up.  die() gives the	 * process no chance to handle the signal and notice the	 * kernel fault information, so that won't result in polluting	 * the information about previously queued, but not yet	 * delivered, faults.  See also do_general_protection below.	 */	tsk->thread.error_code = error_code;	tsk->thread.trap_no = trapnr;#ifdef CONFIG_X86_64	if (show_unhandled_signals && unhandled_signal(tsk, signr) &&	    printk_ratelimit()) {		printk(KERN_INFO		       "%s[%d] trap %s ip:%lx sp:%lx error:%lx",		       tsk->comm, task_pid_nr(tsk), str,		       regs->ip, regs->sp, error_code);		print_vma_addr(" in ", regs->ip);		printk("/n");	}#endif	if (info)		force_sig_info(signr, info, tsk);	else		force_sig(signr, tsk);	return;kernel_trap:	if (!fixup_exception(regs)) {		tsk->thread.error_code = error_code;		tsk->thread.trap_no = trapnr;#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC)		if (trapnr == 12 && ((regs->cs & 0xFFFF) == __KERNEL_CS || (regs->cs & 0xFFFF) == __KERNEXEC_KERNEL_CS))			str = "PAX: suspicious stack segment fault";#endif		die(str, regs, error_code);	}#ifdef CONFIG_PAX_REFCOUNT	if (trapnr == 4)		pax_report_refcount_overflow(regs);#endif	return;#ifdef CONFIG_X86_32vm86_trap:	if (handle_vm86_trap((struct kernel_vm86_regs *) regs,						error_code, trapnr))		goto trap_signal;	return;#endif}
开发者ID:mikeberkelaar,项目名称:grhardened,代码行数:82,


示例17: do_trap

static void __kprobesdo_trap(int trapnr, int signr, char *str, struct pt_regs *regs,	long error_code, siginfo_t *info){	struct task_struct *tsk = current;#ifdef CONFIG_X86_32	if (regs->flags & X86_VM_MASK) {		/*		 * traps 0, 1, 3, 4, and 5 should be forwarded to vm86.		 * On nmi (interrupt 2), do_trap should not be called.		 */		if (trapnr < 6)			goto vm86_trap;		goto trap_signal;	}#endif	if (!user_mode(regs))		goto kernel_trap;#ifdef CONFIG_X86_32trap_signal:#endif	/*	 * We want error_code and trap_no set for userspace faults and	 * kernelspace faults which result in die(), but not	 * kernelspace faults which are fixed up.  die() gives the	 * process no chance to handle the signal and notice the	 * kernel fault information, so that won't result in polluting	 * the information about previously queued, but not yet	 * delivered, faults.  See also do_general_protection below.	 */	tsk->thread.error_code = error_code;	tsk->thread.trap_no = trapnr;#ifdef CONFIG_X86_64	if (show_unhandled_signals && unhandled_signal(tsk, signr) &&	    printk_ratelimit()) {		printk(KERN_INFO		       "%s[%d] trap %s ip:%lx sp:%lx error:%lx",		       tsk->comm, tsk->pid, str,		       regs->ip, regs->sp, error_code);		print_vma_addr(" in ", regs->ip);		printk("/n");	}#endif	if (info)		force_sig_info(signr, info, tsk);	else		force_sig(signr, tsk);	return;kernel_trap:	if (!fixup_exception(regs)) {		tsk->thread.error_code = error_code;		tsk->thread.trap_no = trapnr;		die(str, regs, error_code);	}	return;#ifdef CONFIG_X86_32vm86_trap:	if (handle_vm86_trap((struct kernel_vm86_regs *) regs,						error_code, trapnr))		goto trap_signal;	return;#endif}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:70,


示例18: do_general_protection

dotraplinkage void __kprobesdo_general_protection(struct pt_regs *regs, long error_code){	struct task_struct *tsk;	conditional_sti(regs);#ifdef CONFIG_X86_32	if (v8086_mode(regs))		goto gp_in_vm86;#endif	tsk = current;	if (!user_mode_novm(regs))		goto gp_in_kernel;#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_PAGEEXEC)	if (!nx_enabled && tsk->mm && (tsk->mm->pax_flags & MF_PAX_PAGEEXEC)) {		struct mm_struct *mm = tsk->mm;		unsigned long limit;		down_write(&mm->mmap_sem);		limit = mm->context.user_cs_limit;		if (limit < TASK_SIZE) {			track_exec_limit(mm, limit, TASK_SIZE, VM_EXEC);			up_write(&mm->mmap_sem);			return;		}		up_write(&mm->mmap_sem);	}#endif	tsk->thread.error_code = error_code;	tsk->thread.trap_no = 13;	if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&			printk_ratelimit()) {		printk(KERN_INFO			"%s[%d] general protection ip:%lx sp:%lx error:%lx",			tsk->comm, task_pid_nr(tsk),			regs->ip, regs->sp, error_code);		print_vma_addr(" in ", regs->ip);		printk("/n");	}	force_sig(SIGSEGV, tsk);	return;#ifdef CONFIG_X86_32gp_in_vm86:	local_irq_enable();	handle_vm86_fault((struct kernel_vm86_regs *) regs, error_code);	return;#endifgp_in_kernel:	if (fixup_exception(regs))		return;	tsk->thread.error_code = error_code;	tsk->thread.trap_no = 13;	if (notify_die(DIE_GPF, "general protection fault", regs,				error_code, 13, SIGSEGV) == NOTIFY_STOP)		return;#if defined(CONFIG_X86_32) && defined(CONFIG_PAX_KERNEXEC)	if ((regs->cs & 0xFFFF) == __KERNEL_CS)		die("PAX: suspicious general protection fault", regs, error_code);	else#endif	die("general protection fault", regs, error_code);}
开发者ID:mikeberkelaar,项目名称:grhardened,代码行数:73,


示例19: do_general_protection

dotraplinkage void __kprobesdo_general_protection(struct pt_regs *regs, long error_code){	struct task_struct *tsk;	conditional_sti(regs);#ifdef CONFIG_X86_32	if (regs->flags & X86_VM_MASK)		goto gp_in_vm86;#endif	tsk = current;	if (!user_mode(regs))		goto gp_in_kernel;#ifdef CONFIG_X86_32{	int cpu;	int ok;	cpu = get_cpu();	ok = check_lazy_exec_limit(cpu, regs, error_code);	put_cpu();	if (ok)		return;	if (print_fatal_signals) {		printk(KERN_ERR "#GPF(%ld[seg:%lx]) at %08lx, CPU#%d./n",			error_code, error_code/8, regs->ip, smp_processor_id());		printk(KERN_ERR "exec_limit: %08lx, user_cs: %08x/%08x./n",			current->mm->context.exec_limit,			current->mm->context.user_cs.a,			current->mm->context.user_cs.b);	}}#endif /*CONFIG_X86_32*/	tsk->thread.error_code = error_code;	tsk->thread.trap_no = 13;	if (show_unhandled_signals && unhandled_signal(tsk, SIGSEGV) &&			printk_ratelimit()) {		printk(KERN_INFO			"%s[%d] general protection ip:%lx sp:%lx error:%lx",			tsk->comm, task_pid_nr(tsk),			regs->ip, regs->sp, error_code);		print_vma_addr(" in ", regs->ip);		printk("/n");	}	force_sig(SIGSEGV, tsk);	return;#ifdef CONFIG_X86_32gp_in_vm86:	local_irq_enable();	handle_vm86_fault((struct kernel_vm86_regs *) regs, error_code);	return;#endifgp_in_kernel:	if (fixup_exception(regs))		return;	tsk->thread.error_code = error_code;	tsk->thread.trap_no = 13;	if (notify_die(DIE_GPF, "general protection fault", regs,				error_code, 13, SIGSEGV) == NOTIFY_STOP)		return;	die("general protection fault", regs, error_code);}
开发者ID:285452612,项目名称:ali_kernel,代码行数:73,


示例20: do_page_fault

//.........这里部分代码省略.........		if (fault & VM_FAULT_MAJOR)			current->maj_flt++;		else			current->min_flt++;		if (fault & VM_FAULT_RETRY) {			/* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk			 * of starvation. */			flags &= ~FAULT_FLAG_ALLOW_RETRY;			flags |= FAULT_FLAG_TRIED;			/*			 * No need to up_read(&mm->mmap_sem) as we would			 * have already released it in __lock_page_or_retry			 * in mm/filemap.c.			 */			goto retry;		}	}	up_read(&mm->mmap_sem);	return;/* * Something tried to access memory that isn't in our memory map.. * Fix it, but check if it's kernel or user first.. */bad_area:	up_read(&mm->mmap_sem);bad_area_nosemaphore:	/* User mode accesses just cause a SIGSEGV */	if (user_mode(regs)) {		if (unhandled_signal(current, SIGSEGV) && printk_ratelimit()) {			pr_info("%s: unhandled page fault (%d) at 0x%08lx, "				"cause %ld/n", current->comm, SIGSEGV, address, cause);			show_regs(regs);		}		_exception(SIGSEGV, regs, code, address);		return;	}no_context:	/* Are we prepared to handle this kernel fault? */	if (fixup_exception(regs))		return;	/*	 * Oops. The kernel tried to access some bad page. We'll have to	 * terminate things with extreme prejudice.	 */	bust_spinlocks(1);	pr_alert("Unable to handle kernel %s at virtual address %08lx",		address < PAGE_SIZE ? "NULL pointer dereference" :		"paging request", address);	pr_alert("ea = %08lx, ra = %08lx, cause = %ld/n", regs->ea, regs->ra,		cause);	panic("Oops");	return;/* * We ran out of memory, or some other thing happened to us that made * us unable to handle the page fault gracefully. */out_of_memory:
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:67,



注:本文中的unhandled_signal函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ uni函数代码示例
C++ unguard函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。