Module Name: src
Committed By: matt
Date: Mon Sep 7 22:06:32 UTC 2009
Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: trap.c
Log Message:
Cleanup fatal trap printfs
To generate a diff of this commit:
cvs rdiff -u -r1.217.12.8 -r1.217.12.9 src/sys/arch/mips/mips/trap.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.217.12.8 src/sys/arch/mips/mips/trap.c:1.217.12.9
--- src/sys/arch/mips/mips/trap.c:1.217.12.8 Thu Sep 3 00:10:18 2009
+++ src/sys/arch/mips/mips/trap.c Mon Sep 7 22:06:32 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.217.12.8 2009/09/03 00:10:18 matt Exp $ */
+/* $NetBSD: trap.c,v 1.217.12.9 2009/09/07 22:06:32 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -78,7 +78,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.217.12.8 2009/09/03 00:10:18 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.217.12.9 2009/09/07 22:06:32 matt Exp $");
#include "opt_cputype.h" /* which mips CPU levels do we support? */
#include "opt_ddb.h"
@@ -227,16 +227,22 @@
default:
dopanic:
(void)splhigh();
+ printf("pid %d(%s): ", p->p_pid, p->p_comm);
printf("trap: %s in %s mode\n",
trap_type[TRAPTYPE(cause)],
USERMODE(status) ? "user" : "kernel");
printf("status=0x%x, cause=0x%x, epc=%#" PRIxVADDR
- ", vaddr=%#" PRIxVADDR "\n", status, cause, opc, vaddr);
- fp = l->l_md.md_regs;
- printf("pid=%d cmd=%s usp=%#" PRIxREGISTER
- " ksp=%p ra=%#" PRIxREGISTER "\n",
- p->p_pid, p->p_comm, fp->f_regs[_R_SP],
- &status, fp->f_regs[_R_RA]);
+ ", vaddr=%#" PRIxVADDR, status, cause, opc, vaddr);
+ if (USERMODE(status)) {
+ fp = l->l_md.md_regs;
+ printf(" frame=%p usp=%#" PRIxREGISTER
+ " ra=%#" PRIxREGISTER "\n",
+ fp, fp->f_regs[_R_SP], fp->f_regs[_R_RA]);
+ } else {
+ printf(" tf=%p ksp=%p ra=%#" PRIxREGISTER "\n",
+ frame, frame+1, frame->tf_regs[TF_RA]);
+ }
+
#if defined(DDB)
kdb_trap(type, frame->tf_regs);
/* XXX force halt XXX */