Cosmetic:
- add %s: __func__, function names change [most of them were wrong] - add a DIAGNOSTIC printf to help debug alignment fixups
This commit is contained in:
parent
e74a3a0936
commit
3ea0cfb9a1
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fault.c,v 1.78 2010/12/20 00:25:27 matt Exp $ */
|
||||
/* $NetBSD: fault.c,v 1.79 2012/02/09 23:32:55 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 2003 Wasabi Systems, Inc.
|
||||
@ -82,7 +82,7 @@
|
||||
#include "opt_sa.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: fault.c,v 1.78 2010/12/20 00:25:27 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: fault.c,v 1.79 2012/02/09 23:32:55 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -193,7 +193,7 @@ data_abort_fixup(trapframe_t *tf, u_int fsr, u_int far, struct lwp *l)
|
||||
/*
|
||||
* Oops, couldn't fix up the instruction
|
||||
*/
|
||||
printf("data_abort_fixup: fixup for %s mode data abort failed.\n",
|
||||
printf("%s: fixup for %s mode data abort failed.\n", __func__,
|
||||
TRAP_USERMODE(tf) ? "user" : "kernel");
|
||||
#ifdef THUMB_CODE
|
||||
if (tf->tf_spsr & PSR_T_bit) {
|
||||
@ -263,6 +263,10 @@ data_abort_handler(trapframe_t *tf)
|
||||
|
||||
/* Invoke the appropriate handler, if necessary */
|
||||
if (__predict_false(data_aborts[fsr & FAULT_TYPE_MASK].func != NULL)) {
|
||||
#ifdef DIAGNOSTIC
|
||||
printf("%s: data_aborts fsr=0x%x far=0x%x\n",
|
||||
__func__, fsr, far);
|
||||
#endif
|
||||
if ((data_aborts[fsr & FAULT_TYPE_MASK].func)(tf, fsr, far,
|
||||
l, &ksi))
|
||||
goto do_trapsignal;
|
||||
@ -306,8 +310,8 @@ data_abort_handler(trapframe_t *tf)
|
||||
* at some point.
|
||||
*/
|
||||
if (__predict_false(!user && (tf->tf_pc & 3) != 0)) {
|
||||
printf("\ndata_abort_fault: Misaligned Kernel-mode "
|
||||
"Program Counter\n");
|
||||
printf("\n%s: Misaligned Kernel-mode Program Counter\n",
|
||||
__func__);
|
||||
dab_fatal(tf, fsr, far, l, NULL);
|
||||
}
|
||||
#else
|
||||
@ -328,8 +332,8 @@ data_abort_handler(trapframe_t *tf)
|
||||
/*
|
||||
* The kernel never executes Thumb code.
|
||||
*/
|
||||
printf("\ndata_abort_fault: Misaligned Kernel-mode "
|
||||
"Program Counter\n");
|
||||
printf("\n%s: Misaligned Kernel-mode Program Counter\n",
|
||||
__func__);
|
||||
dab_fatal(tf, fsr, far, l, NULL);
|
||||
}
|
||||
#endif
|
||||
@ -736,8 +740,7 @@ prefetch_abort_fixup(trapframe_t *tf)
|
||||
/*
|
||||
* Oops, couldn't fix up the instruction
|
||||
*/
|
||||
printf(
|
||||
"prefetch_abort_fixup: fixup for %s mode prefetch abort failed.\n",
|
||||
printf("%s: fixup for %s mode prefetch abort failed.\n", __func__,
|
||||
TRAP_USERMODE(tf) ? "user" : "kernel");
|
||||
#ifdef THUMB_CODE
|
||||
if (tf->tf_spsr & PSR_T_bit) {
|
||||
@ -957,7 +960,7 @@ badaddr_read(void *addr, size_t size, void *rptr)
|
||||
|
||||
default:
|
||||
curpcb = curpcb_save;
|
||||
panic("badaddr: invalid size (%lu)", (u_long) size);
|
||||
panic("%s: invalid size (%lu)", __func__, (u_long)size);
|
||||
}
|
||||
|
||||
/* Restore curpcb */
|
||||
|
Loading…
Reference in New Issue
Block a user