summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-01-14 07:24:44 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-01-14 07:24:44 +0000
commit6289df0bb69ead9510339fd203c856bdc0db0cbc (patch)
tree9275e4dba8a2a5855eb1ee2b1178aac7ff8e7dd1 /sys/arch/mips64
parent46963f20be5bcce607b920179e3fdd924939598a (diff)
When trying to get a stack trace, consider CKSEG1 addresses as invalid, as the
kernel will never use them for code or stack.
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/mips64/db_machdep.c4
-rw-r--r--sys/arch/mips64/mips64/trap.c28
2 files changed, 4 insertions, 28 deletions
diff --git a/sys/arch/mips64/mips64/db_machdep.c b/sys/arch/mips64/mips64/db_machdep.c
index e42acc35a5b..7a9345a9c78 100644
--- a/sys/arch/mips64/mips64/db_machdep.c
+++ b/sys/arch/mips64/mips64/db_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_machdep.c,v 1.24 2010/01/13 22:55:54 miod Exp $ */
+/* $OpenBSD: db_machdep.c,v 1.25 2010/01/14 07:24:43 miod Exp $ */
/*
* Copyright (c) 1998-2003 Opsycon AB (www.opsycon.se)
@@ -208,7 +208,7 @@ db_write_bytes(addr, size, data)
#define VALID_ADDRESS(va) \
(((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS) || \
- IS_XKPHYS(va) || ((va) >= CKSEG0_BASE && (va) < CKSSEG_BASE))
+ IS_XKPHYS(va) || ((va) >= CKSEG0_BASE && (va) < CKSEG1_BASE))
void
db_stack_trace_print(addr, have_addr, count, modif, pr)
diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c
index 6fb16bcb460..d4d7c8f7545 100644
--- a/sys/arch/mips64/mips64/trap.c
+++ b/sys/arch/mips64/mips64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.58 2010/01/09 23:34:29 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.59 2010/01/14 07:24:43 miod Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -1141,7 +1141,7 @@ stacktrace(regs)
#define VALID_ADDRESS(va) \
(((va) >= VM_MIN_KERNEL_ADDRESS && (va) < VM_MAX_KERNEL_ADDRESS) || \
- IS_XKPHYS(va) || ((va) >= CKSEG0_BASE && (va) < CKSSEG_BASE))
+ IS_XKPHYS(va) || ((va) >= CKSEG0_BASE && (va) < CKSEG1_BASE))
void
stacktrace_subr(regs, printfn)
@@ -1184,30 +1184,6 @@ loop:
goto done;
}
-#if 0
- /* Backtraces should contine through interrupts from kernel mode */
- if (pc >= (vaddr_t)MipsKernIntr && pc < (vaddr_t)MipsUserIntr) {
- (*printfn)("MipsKernIntr+%x: (%x, %x ,%x) -------\n",
- pc - (vaddr_t)MipsKernIntr, a0, a1, a2);
- regs = (struct trap_frame *)(sp + STAND_ARG_SIZE);
- a0 = kdbpeek(&regs->a0);
- a1 = kdbpeek(&regs->a1);
- a2 = kdbpeek(&regs->a2);
- a3 = kdbpeek(&regs->a3);
-
- pc = kdbpeek(&regs->pc); /* exc_pc - pc at time of exception */
- ra = kdbpeek(&regs->ra); /* ra at time of exception */
- sp = kdbpeek(&regs->sp);
- goto specialframe;
- }
-#endif
-
-
-# define Between(x, y, z) \
- ( ((x) <= (y)) && ((y) < (z)) )
-# define pcBetween(a,b) \
- Between((vaddr_t)a, pc, (vaddr_t)b)
-
/* check for bad PC */
if (pc & 3 || !VALID_ADDRESS(pc)) {
(*printfn)("PC %p: not in kernel\n", pc);