Thu Aug 6 23:07:55 2009 UTC ()
print ra on trap.


(matt)
diff -r1.217 -r1.218 src/sys/arch/mips/mips/trap.c

cvs diff -r1.217 -r1.218 src/sys/arch/mips/mips/trap.c (expand / switch to unified diff)

--- src/sys/arch/mips/mips/trap.c 2008/10/15 06:51:18 1.217
+++ src/sys/arch/mips/mips/trap.c 2009/08/06 23:07:55 1.218
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: trap.c,v 1.217 2008/10/15 06:51:18 wrstuden Exp $ */ 1/* $NetBSD: trap.c,v 1.218 2009/08/06 23:07:55 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992, 1993 4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer 8 * the Systems Programming Group of the University of Utah Computer
9 * Science Department and Ralph Campbell. 9 * Science Department and Ralph Campbell.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -68,27 +68,27 @@ @@ -68,27 +68,27 @@
68 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 68 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
69 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 69 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
70 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 70 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
71 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 71 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
72 * SUCH DAMAGE. 72 * SUCH DAMAGE.
73 * 73 *
74 * from: Utah Hdr: trap.c 1.32 91/04/06 74 * from: Utah Hdr: trap.c 1.32 91/04/06
75 * 75 *
76 * @(#)trap.c 8.5 (Berkeley) 1/11/94 76 * @(#)trap.c 8.5 (Berkeley) 1/11/94
77 */ 77 */
78 78
79#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ 79#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
80 80
81__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.217 2008/10/15 06:51:18 wrstuden Exp $"); 81__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.218 2009/08/06 23:07:55 matt Exp $");
82 82
83#include "opt_cputype.h" /* which mips CPU levels do we support? */ 83#include "opt_cputype.h" /* which mips CPU levels do we support? */
84#include "opt_ddb.h" 84#include "opt_ddb.h"
85#include "opt_kgdb.h" 85#include "opt_kgdb.h"
86 86
87#include <sys/param.h> 87#include <sys/param.h>
88#include <sys/systm.h> 88#include <sys/systm.h>
89#include <sys/kernel.h> 89#include <sys/kernel.h>
90#include <sys/proc.h> 90#include <sys/proc.h>
91#include <sys/ras.h> 91#include <sys/ras.h>
92#include <sys/signalvar.h> 92#include <sys/signalvar.h>
93#include <sys/syscall.h> 93#include <sys/syscall.h>
94#include <sys/user.h> 94#include <sys/user.h>
@@ -230,27 +230,27 @@ trap(unsigned int status, unsigned int c @@ -230,27 +230,27 @@ trap(unsigned int status, unsigned int c
230 dopanic: 230 dopanic:
231 (void)splhigh(); 231 (void)splhigh();
232 printf("trap: %s in %s mode\n", 232 printf("trap: %s in %s mode\n",
233 trap_type[TRAPTYPE(cause)], 233 trap_type[TRAPTYPE(cause)],
234 USERMODE(status) ? "user" : "kernel"); 234 USERMODE(status) ? "user" : "kernel");
235 printf("status=0x%x, cause=0x%x, epc=%#lx, vaddr=%#lx\n", 235 printf("status=0x%x, cause=0x%x, epc=%#lx, vaddr=%#lx\n",
236 status, cause, opc, vaddr); 236 status, cause, opc, vaddr);
237 if (curlwp != NULL) { 237 if (curlwp != NULL) {
238 fp = (struct frame *)l->l_md.md_regs; 238 fp = (struct frame *)l->l_md.md_regs;
239 printf("pid=%d cmd=%s usp=0x%x ", 239 printf("pid=%d cmd=%s usp=0x%x ",
240 p->p_pid, p->p_comm, (int)fp->f_regs[_R_SP]); 240 p->p_pid, p->p_comm, (int)fp->f_regs[_R_SP]);
241 } else 241 } else
242 printf("curlwp == NULL "); 242 printf("curlwp == NULL ");
243 printf("ksp=%p\n", &status); 243 printf("ksp=%p ra=%#x\n", &status, (int)frame->tf_regs[TF_RA]);
244#if defined(DDB) 244#if defined(DDB)
245 kdb_trap(type, (mips_reg_t *) frame); 245 kdb_trap(type, (mips_reg_t *) frame);
246 /* XXX force halt XXX */ 246 /* XXX force halt XXX */
247#elif defined(KGDB) 247#elif defined(KGDB)
248 { 248 {
249 struct frame *f = (struct frame *)&ddb_regs; 249 struct frame *f = (struct frame *)&ddb_regs;
250 extern mips_reg_t kgdb_cause, kgdb_vaddr; 250 extern mips_reg_t kgdb_cause, kgdb_vaddr;
251 kgdb_cause = cause; 251 kgdb_cause = cause;
252 kgdb_vaddr = vaddr; 252 kgdb_vaddr = vaddr;
253 253
254 /* 254 /*
255 * init global ddb_regs, used in db_interface.c routines 255 * init global ddb_regs, used in db_interface.c routines
256 * shared between ddb and gdb. Send ddb_regs to gdb so 256 * shared between ddb and gdb. Send ddb_regs to gdb so