traps.c (334d0dd8b660557608142f0f77abc6812b48f08b) | traps.c (1eeb66a1bb973534dc3d064920a5ca683823372e) |
---|---|
1/* 2 * linux/arch/arm/kernel/traps.c 3 * 4 * Copyright (C) 1995-2002 Russell King 5 * Fragments that appear the same as linux/arch/i386/kernel/traps.c (C) Linus Torvalds 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 231 unchanged lines hidden (view full) --- 240 spin_unlock_irq(&die_lock); 241 242 if (panic_on_oops) 243 panic("Fatal exception"); 244 245 do_exit(SIGSEGV); 246} 247 | 1/* 2 * linux/arch/arm/kernel/traps.c 3 * 4 * Copyright (C) 1995-2002 Russell King 5 * Fragments that appear the same as linux/arch/i386/kernel/traps.c (C) Linus Torvalds 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 231 unchanged lines hidden (view full) --- 240 spin_unlock_irq(&die_lock); 241 242 if (panic_on_oops) 243 panic("Fatal exception"); 244 245 do_exit(SIGSEGV); 246} 247 |
248void notify_die(const char *str, struct pt_regs *regs, struct siginfo *info, 249 unsigned long err, unsigned long trap) | 248void arm_notify_die(const char *str, struct pt_regs *regs, 249 struct siginfo *info, unsigned long err, unsigned long trap) |
250{ 251 if (user_mode(regs)) { 252 current->thread.error_code = err; 253 current->thread.trap_no = trap; 254 255 force_sig_info(info->si_signo, info, current); 256 } else { 257 die(str, regs, err); --- 67 unchanged lines hidden (view full) --- 325 } 326#endif 327 328 info.si_signo = SIGILL; 329 info.si_errno = 0; 330 info.si_code = ILL_ILLOPC; 331 info.si_addr = pc; 332 | 250{ 251 if (user_mode(regs)) { 252 current->thread.error_code = err; 253 current->thread.trap_no = trap; 254 255 force_sig_info(info->si_signo, info, current); 256 } else { 257 die(str, regs, err); --- 67 unchanged lines hidden (view full) --- 325 } 326#endif 327 328 info.si_signo = SIGILL; 329 info.si_errno = 0; 330 info.si_code = ILL_ILLOPC; 331 info.si_addr = pc; 332 |
333 notify_die("Oops - undefined instruction", regs, &info, 0, 6); | 333 arm_notify_die("Oops - undefined instruction", regs, &info, 0, 6); |
334} 335 336asmlinkage void do_unexp_fiq (struct pt_regs *regs) 337{ 338#ifndef CONFIG_IGNORE_FIQ 339 printk("Hmm. Unexpected FIQ received, but trying to continue\n"); 340 printk("You may have a hardware problem...\n"); 341#endif --- 37 unchanged lines hidden (view full) --- 379#endif 380 381 info.si_signo = SIGILL; 382 info.si_errno = 0; 383 info.si_code = ILL_ILLTRP; 384 info.si_addr = (void __user *)instruction_pointer(regs) - 385 (thumb_mode(regs) ? 2 : 4); 386 | 334} 335 336asmlinkage void do_unexp_fiq (struct pt_regs *regs) 337{ 338#ifndef CONFIG_IGNORE_FIQ 339 printk("Hmm. Unexpected FIQ received, but trying to continue\n"); 340 printk("You may have a hardware problem...\n"); 341#endif --- 37 unchanged lines hidden (view full) --- 379#endif 380 381 info.si_signo = SIGILL; 382 info.si_errno = 0; 383 info.si_code = ILL_ILLTRP; 384 info.si_addr = (void __user *)instruction_pointer(regs) - 385 (thumb_mode(regs) ? 2 : 4); 386 |
387 notify_die("Oops - bad syscall", regs, &info, n, 0); | 387 arm_notify_die("Oops - bad syscall", regs, &info, n, 0); |
388 389 return regs->ARM_r0; 390} 391 392static inline void 393do_cache_op(unsigned long start, unsigned long end, int flags) 394{ 395 struct vm_area_struct *vma; --- 27 unchanged lines hidden (view full) --- 423 424 switch (no & 0xffff) { 425 case 0: /* branch through 0 */ 426 info.si_signo = SIGSEGV; 427 info.si_errno = 0; 428 info.si_code = SEGV_MAPERR; 429 info.si_addr = NULL; 430 | 388 389 return regs->ARM_r0; 390} 391 392static inline void 393do_cache_op(unsigned long start, unsigned long end, int flags) 394{ 395 struct vm_area_struct *vma; --- 27 unchanged lines hidden (view full) --- 423 424 switch (no & 0xffff) { 425 case 0: /* branch through 0 */ 426 info.si_signo = SIGSEGV; 427 info.si_errno = 0; 428 info.si_code = SEGV_MAPERR; 429 info.si_addr = NULL; 430 |
431 notify_die("branch through zero", regs, &info, 0, 0); | 431 arm_notify_die("branch through zero", regs, &info, 0, 0); |
432 return 0; 433 434 case NR(breakpoint): /* SWI BREAK_POINT */ 435 regs->ARM_pc -= thumb_mode(regs) ? 2 : 4; 436 ptrace_break(current, regs); 437 return regs->ARM_r0; 438 439 /* --- 119 unchanged lines hidden (view full) --- 559 } 560#endif 561 info.si_signo = SIGILL; 562 info.si_errno = 0; 563 info.si_code = ILL_ILLTRP; 564 info.si_addr = (void __user *)instruction_pointer(regs) - 565 (thumb_mode(regs) ? 2 : 4); 566 | 432 return 0; 433 434 case NR(breakpoint): /* SWI BREAK_POINT */ 435 regs->ARM_pc -= thumb_mode(regs) ? 2 : 4; 436 ptrace_break(current, regs); 437 return regs->ARM_r0; 438 439 /* --- 119 unchanged lines hidden (view full) --- 559 } 560#endif 561 info.si_signo = SIGILL; 562 info.si_errno = 0; 563 info.si_code = ILL_ILLTRP; 564 info.si_addr = (void __user *)instruction_pointer(regs) - 565 (thumb_mode(regs) ? 2 : 4); 566 |
567 notify_die("Oops - bad syscall(2)", regs, &info, no, 0); | 567 arm_notify_die("Oops - bad syscall(2)", regs, &info, no, 0); |
568 return 0; 569} 570 571#ifdef CONFIG_TLS_REG_EMUL 572 573/* 574 * We might be running on an ARMv6+ processor which should have the TLS 575 * register but for some reason we can't use it, or maybe an SMP system --- 57 unchanged lines hidden (view full) --- 633 } 634#endif 635 636 info.si_signo = SIGILL; 637 info.si_errno = 0; 638 info.si_code = ILL_ILLOPC; 639 info.si_addr = (void __user *)addr; 640 | 568 return 0; 569} 570 571#ifdef CONFIG_TLS_REG_EMUL 572 573/* 574 * We might be running on an ARMv6+ processor which should have the TLS 575 * register but for some reason we can't use it, or maybe an SMP system --- 57 unchanged lines hidden (view full) --- 633 } 634#endif 635 636 info.si_signo = SIGILL; 637 info.si_errno = 0; 638 info.si_code = ILL_ILLOPC; 639 info.si_addr = (void __user *)addr; 640 |
641 notify_die("unknown data abort code", regs, &info, instr, 0); | 641 arm_notify_die("unknown data abort code", regs, &info, instr, 0); |
642} 643 644void __attribute__((noreturn)) __bug(const char *file, int line) 645{ 646 printk(KERN_CRIT"kernel BUG at %s:%d!\n", file, line); 647 *(int *)0 = 0; 648 649 /* Avoid "noreturn function does return" */ --- 69 unchanged lines hidden --- | 642} 643 644void __attribute__((noreturn)) __bug(const char *file, int line) 645{ 646 printk(KERN_CRIT"kernel BUG at %s:%d!\n", file, line); 647 *(int *)0 = 0; 648 649 /* Avoid "noreturn function does return" */ --- 69 unchanged lines hidden --- |