* abort_fatal() handles the following data aborts: * * FAULT_DEBUG - Debug Event * FAULT_ACCESS_xx - Acces Bit * FAULT_EA_PREC - Precise External Abort * FAULT_DOMAIN_xx - Domain Fault * FAULT_EA_TRAN_xx - External Translation Abort * FAULT_EA_IMPREC - Imprecise External Abort * + all undefined codes for ABORT * * We should never see these on a properly functioning system. * *
| 556 | * Note: If 'l' is NULL, we assume we're dealing with a prefetch abort. |
| 557 | */ |
| 558 | static int |
| 559 | abort_fatal(struct trapframe *tf, u_int idx, u_int fsr, u_int far, |
| 560 | u_int prefetch, struct thread *td, struct ksig *ksig) |
| 561 | { |
| 562 | bool usermode; |
| 563 | const char *mode; |
| 564 | const char *rw_mode; |
| 565 | #ifdef KDB |
| 566 | bool handled; |
| 567 | #endif |
| 568 | |
| 569 | usermode = TRAPF_USERMODE(tf); |
| 570 | #ifdef KDTRACE_HOOKS |
| 571 | if (!usermode) { |
| 572 | if (dtrace_trap_func != NULL && (*dtrace_trap_func)(tf, far)) |
| 573 | return (0); |
| 574 | } |
| 575 | #endif |
| 576 | |
| 577 | mode = usermode ? "user" : "kernel"; |
| 578 | rw_mode = fsr & FSR_WNR ? "write" : "read"; |
| 579 | disable_interrupts(PSR_I|PSR_F); |
| 580 | |
| 581 | if (td != NULL) { |
| 582 | printf("Fatal %s mode data abort: '%s' on %s\n", mode, |
| 583 | aborts[idx].desc, rw_mode); |
| 584 | printf("trapframe: %p\nFSR=%08x, FAR=", tf, fsr); |
| 585 | if (idx != FAULT_EA_IMPREC) |
| 586 | printf("%08x, ", far); |
| 587 | else |
| 588 | printf("Invalid, "); |
| 589 | printf("spsr=%08x\n", tf->tf_spsr); |
| 590 | } else { |
| 591 | printf("Fatal %s mode prefetch abort at 0x%08x\n", |
| 592 | mode, tf->tf_pc); |
| 593 | printf("trapframe: %p, spsr=%08x\n", tf, tf->tf_spsr); |
| 594 | } |
| 595 | |
| 596 | printf("r0 =%08x, r1 =%08x, r2 =%08x, r3 =%08x\n", |
| 597 | tf->tf_r0, tf->tf_r1, tf->tf_r2, tf->tf_r3); |
| 598 | printf("r4 =%08x, r5 =%08x, r6 =%08x, r7 =%08x\n", |
| 599 | tf->tf_r4, tf->tf_r5, tf->tf_r6, tf->tf_r7); |
| 600 | printf("r8 =%08x, r9 =%08x, r10=%08x, r11=%08x\n", |
| 601 | tf->tf_r8, tf->tf_r9, tf->tf_r10, tf->tf_r11); |
| 602 | printf("r12=%08x, ", tf->tf_r12); |
| 603 | |
| 604 | if (usermode) |
| 605 | printf("usp=%08x, ulr=%08x", |
| 606 | tf->tf_usr_sp, tf->tf_usr_lr); |
| 607 | else |
| 608 | printf("ssp=%08x, slr=%08x", |
| 609 | tf->tf_svc_sp, tf->tf_svc_lr); |
| 610 | printf(", pc =%08x\n\n", tf->tf_pc); |
| 611 | |
| 612 | #ifdef KDB |
| 613 | if (debugger_on_trap) { |
| 614 | kdb_why = KDB_WHY_TRAP; |
| 615 | handled = kdb_trap(fsr, 0, tf); |
no test coverage detected