11 #include <linux/module.h>
12 #include <linux/ptrace.h>
17 #include <asm/special_insns.h>
18 #include <asm/traps.h>
34 pr_err(
"PC: %08lx SP: %08lx\n", regs->
pc, regs->
sp);
35 pr_err(
"Status: %08lx ORIG_A4: %08lx\n", regs->csr, regs->orig_a4);
36 pr_err(
"A0: %08lx B0: %08lx\n", regs->
a0, regs->
b0);
37 pr_err(
"A1: %08lx B1: %08lx\n", regs->
a1, regs->
b1);
38 pr_err(
"A2: %08lx B2: %08lx\n", regs->
a2, regs->
b2);
39 pr_err(
"A3: %08lx B3: %08lx\n", regs->
a3, regs->
b3);
40 pr_err(
"A4: %08lx B4: %08lx\n", regs->a4, regs->b4);
41 pr_err(
"A5: %08lx B5: %08lx\n", regs->a5, regs->b5);
42 pr_err(
"A6: %08lx B6: %08lx\n", regs->a6, regs->
b6);
43 pr_err(
"A7: %08lx B7: %08lx\n", regs->a7, regs->
b7);
44 pr_err(
"A8: %08lx B8: %08lx\n", regs->a8, regs->b8);
45 pr_err(
"A9: %08lx B9: %08lx\n", regs->a9, regs->b9);
46 pr_err(
"A10: %08lx B10: %08lx\n", regs->a10, regs->b10);
47 pr_err(
"A11: %08lx B11: %08lx\n", regs->a11, regs->b11);
48 pr_err(
"A12: %08lx B12: %08lx\n", regs->a12, regs->b12);
49 pr_err(
"A13: %08lx B13: %08lx\n", regs->a13, regs->b13);
50 pr_err(
"A14: %08lx B14: %08lx\n", regs->a14, regs->dp);
51 pr_err(
"A15: %08lx B15: %08lx\n", regs->a15, regs->
sp);
52 pr_err(
"A16: %08lx B16: %08lx\n", regs->a16, regs->b16);
53 pr_err(
"A17: %08lx B17: %08lx\n", regs->a17, regs->b17);
54 pr_err(
"A18: %08lx B18: %08lx\n", regs->a18, regs->b18);
55 pr_err(
"A19: %08lx B19: %08lx\n", regs->a19, regs->b19);
56 pr_err(
"A20: %08lx B20: %08lx\n", regs->a20, regs->b20);
57 pr_err(
"A21: %08lx B21: %08lx\n", regs->a21, regs->b21);
58 pr_err(
"A22: %08lx B22: %08lx\n", regs->a22, regs->b22);
59 pr_err(
"A23: %08lx B23: %08lx\n", regs->a23, regs->b23);
60 pr_err(
"A24: %08lx B24: %08lx\n", regs->a24, regs->b24);
61 pr_err(
"A25: %08lx B25: %08lx\n", regs->a25, regs->b25);
62 pr_err(
"A26: %08lx B26: %08lx\n", regs->a26, regs->b26);
63 pr_err(
"A27: %08lx B27: %08lx\n", regs->a27, regs->b27);
64 pr_err(
"A28: %08lx B28: %08lx\n", regs->a28, regs->b28);
65 pr_err(
"A29: %08lx B29: %08lx\n", regs->a29, regs->b29);
66 pr_err(
"A30: %08lx B30: %08lx\n", regs->a30, regs->b30);
67 pr_err(
"A31: %08lx B31: %08lx\n", regs->a31, regs->b31);
82 pr_err(
"%s: %08x\n", str, nr);
85 pr_err(
"Process %s (pid: %d, stackpage=%08lx)\n",
258 pr_err(
"TRAP: %s PC[0x%lx] signo[%d] code[%d]\n",
267 info.si_addr = (
void __user *)addr;
275 static int process_iexcept(
struct pt_regs *regs)
278 unsigned int iexcept_num;
282 pr_err(
"IEXCEPT: PC[0x%lx]\n", regs->
pc);
284 while (iexcept_report) {
285 iexcept_num =
__ffs(iexcept_report);
286 iexcept_report &= ~(1 << iexcept_num);
291 "Oops - undefined instruction",
294 do_trap(&bkpt_exception, regs);
295 iexcept_report &= ~(0xFF);
300 do_trap(&iexcept_table[iexcept_num], regs);
308 static void process_eexcept(
struct pt_regs *regs)
312 pr_err(
"EEXCEPT: PC[0x%lx]\n", regs->
pc);
315 do_trap(&eexcept_table[evt], regs);
326 unsigned int type_num;
327 unsigned int ie_num = 9;
330 type_num = fls(type) - 1;
342 if (process_iexcept(regs))
347 process_eexcept(regs);
354 do_trap(&iexcept_table[ie_num], regs);
361 static int kstack_depth_to_print = 48;
363 static void show_trace(
unsigned long *
stack,
unsigned long *endstack)
370 while (stack + 1 <= endstack) {
381 #ifndef CONFIG_KALLSYMS
386 print_symbol(
" %s\n", addr);
395 unsigned long *
p, *endstack;
404 stack = (
unsigned long *)&stack;
406 endstack = (
unsigned long *)(((
unsigned long)stack +
THREAD_SIZE - 1)
409 pr_debug(
"Stack from %08lx:", (
unsigned long)stack);
410 for (i = 0, p = stack; i < kstack_depth_to_print; i++) {
411 if (p + 1 > endstack)
418 show_trace(stack, endstack);