Module Name: src
Committed By: andvar
Date: Sun Sep 8 10:16:05 UTC 2024
Modified Files:
src/sys/arch/powerpc/booke: e500_intr.c trap.c
src/sys/arch/powerpc/oea: cpu_subr.c
Log Message:
Use console_debbuger() or DDB guards for Debugger() and db_stack_trace_print().
Should allow to build these files without DDB enabled option.
To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/powerpc/booke/e500_intr.c
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/powerpc/booke/trap.c
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/powerpc/oea/cpu_subr.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/powerpc/booke/e500_intr.c
diff -u src/sys/arch/powerpc/booke/e500_intr.c:1.47 src/sys/arch/powerpc/booke/e500_intr.c:1.48
--- src/sys/arch/powerpc/booke/e500_intr.c:1.47 Fri Jul 22 19:54:14 2022
+++ src/sys/arch/powerpc/booke/e500_intr.c Sun Sep 8 10:16:04 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: e500_intr.c,v 1.47 2022/07/22 19:54:14 thorpej Exp $ */
+/* $NetBSD: e500_intr.c,v 1.48 2024/09/08 10:16:04 andvar Exp $ */
/*-
* Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -37,7 +37,7 @@
#define __INTR_PRIVATE
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.47 2022/07/22 19:54:14 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.48 2024/09/08 10:16:04 andvar Exp $");
#ifdef _KERNEL_OPT
#include "opt_mpc85xx.h"
@@ -55,6 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: e500_intr.c,
#include <sys/ipi.h>
#include <sys/bitops.h>
#include <sys/interrupt.h>
+#include <sys/systm.h>
#include <uvm/uvm_extern.h>
@@ -561,7 +562,7 @@ e500_splx(int ipl)
printf("%s: %p: cpl=%u: ignoring splx(%u) to raise ipl\n",
__func__, __builtin_return_address(0), old_ipl, ipl);
if (old_ipl == IPL_NONE)
- Debugger();
+ console_debugger();
}
// const
Index: src/sys/arch/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.40 src/sys/arch/powerpc/booke/trap.c:1.41
--- src/sys/arch/powerpc/booke/trap.c:1.40 Mon Apr 17 06:48:07 2023
+++ src/sys/arch/powerpc/booke/trap.c Sun Sep 8 10:16:04 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.40 2023/04/17 06:48:07 skrll Exp $ */
+/* $NetBSD: trap.c,v 1.41 2024/09/08 10:16:04 andvar Exp $ */
/*-
* Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.40 2023/04/17 06:48:07 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.41 2024/09/08 10:16:04 andvar Exp $");
#ifdef _KERNEL_OPT
#include "opt_altivec.h"
@@ -660,6 +660,7 @@ dump_trapframe(const struct trapframe *t
}
}
+#ifdef DDB
static bool
ddb_exception(struct trapframe *tf)
{
@@ -696,6 +697,7 @@ ddb_exception(struct trapframe *tf)
return false;
#endif
}
+#endif /* DDB */
static bool
onfaulted(struct trapframe *tf, register_t rv)
@@ -743,7 +745,7 @@ trap(enum ppc_booke_exceptions trap_code
printf("%s(entry): pid %d.%d (%s): invalid tf addr %p\n",
__func__, p->p_pid, l->l_lid, p->p_comm, tf);
dump_trapframe(tf, NULL);
- Debugger();
+ console_debugger();
}
#endif
#if 0
@@ -762,7 +764,7 @@ trap(enum ppc_booke_exceptions trap_code
trap_names[trap_code], tf->tf_fixreg[1],
(uintmax_t)mfspr(SPR_SPRG1));
dump_trapframe(tf, NULL);
- Debugger();
+ console_debugger();
}
if (usertrap && (tf->tf_srr1 & (PSL_DS|PSL_IS)) != (PSL_DS|PSL_IS)) {
@@ -770,7 +772,7 @@ trap(enum ppc_booke_exceptions trap_code
__func__, p->p_pid, l->l_lid, p->p_comm,
trap_names[trap_code], tf->tf_srr1);
dump_trapframe(tf, NULL);
- Debugger();
+ console_debugger();
}
switch (trap_code) {
@@ -832,7 +834,9 @@ trap(enum ppc_booke_exceptions trap_code
rv = embedded_fp_round_exception(tf, &ksi);
break;
case T_EMBEDDED_PERF_MONITOR:
+#ifdef DDB
//db_stack_trace_print(tf->tf_fixreg[1], true, 40, "", printf);
+#endif
dump_trapframe(tf, NULL);
rv = EPERM;
break;
@@ -845,14 +849,14 @@ trap(enum ppc_booke_exceptions trap_code
__func__, p->p_pid, l->l_lid, p->p_comm,
tf->tf_fixreg[1]);
dump_trapframe(tf, NULL);
- Debugger();
+ console_debugger();
}
if ((tf->tf_srr1 & (PSL_DS|PSL_IS)) != (PSL_DS|PSL_IS)) {
printf("%s(entry): pid %d.%d (%s): %s invalid PSL %#lx\n",
__func__, p->p_pid, l->l_lid, p->p_comm,
trap_names[trap_code], tf->tf_srr1);
dump_trapframe(tf, NULL);
- Debugger();
+ console_debugger();
}
#if 0
if ((mfmsr() & PSL_CE) == 0) {
@@ -868,7 +872,9 @@ trap(enum ppc_booke_exceptions trap_code
if (!usertrap) {
if (rv != 0) {
if (!onfaulted(tf, rv)) {
+#ifdef DDB
db_stack_trace_print(tf->tf_fixreg[1], true, 40, "", printf);
+#endif
dump_trapframe(tf, NULL);
panic("%s: pid %d.%d (%s): %s exception in kernel mode"
" (tf=%p, dear=%#lx, esr=%#x,"
@@ -930,7 +936,7 @@ trap(enum ppc_booke_exceptions trap_code
__func__, p->p_pid, l->l_lid, p->p_comm,
trap_names[trap_code], tf->tf_srr1);
dump_trapframe(tf, NULL);
- Debugger();
+ console_debugger();
}
#endif
#if 0
Index: src/sys/arch/powerpc/oea/cpu_subr.c
diff -u src/sys/arch/powerpc/oea/cpu_subr.c:1.109 src/sys/arch/powerpc/oea/cpu_subr.c:1.110
--- src/sys/arch/powerpc/oea/cpu_subr.c:1.109 Sat Jan 20 00:19:07 2024
+++ src/sys/arch/powerpc/oea/cpu_subr.c Sun Sep 8 10:16:04 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_subr.c,v 1.109 2024/01/20 00:19:07 jmcneill Exp $ */
+/* $NetBSD: cpu_subr.c,v 1.110 2024/09/08 10:16:04 andvar Exp $ */
/*-
* Copyright (c) 2001 Matt Thomas.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.109 2024/01/20 00:19:07 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.110 2024/09/08 10:16:04 andvar Exp $");
#include "sysmon_envsys.h"
@@ -1481,7 +1481,7 @@ cpu_spinup(device_t self, struct cpu_inf
#endif
aprint_error("%d:CPU %d didn't start %d\n", cpu_spinstart_ack,
ci->ci_cpuid, cpu_spinstart_ack);
- Debugger();
+ console_debugger();
return -1;
}