Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm Provide a DDB_REGS in the same way to others. M...
details: https://anonhg.NetBSD.org/src/rev/06b203cf7493
branches: trunk
changeset: 328294:06b203cf7493
user: skrll <skrll%NetBSD.org@localhost>
date: Sun Mar 30 08:00:34 2014 +0000
description:
Provide a DDB_REGS in the same way to others. Makes crash buildable.
diffstat:
sys/arch/arm/arm32/db_interface.c | 16 +++++++++++++---
sys/arch/arm/arm32/db_machdep.c | 7 +++----
sys/arch/arm/include/db_machdep.h | 11 +++++++++--
3 files changed, 25 insertions(+), 9 deletions(-)
diffs (110 lines):
diff -r aea8c52ee926 -r 06b203cf7493 sys/arch/arm/arm32/db_interface.c
--- a/sys/arch/arm/arm32/db_interface.c Sun Mar 30 07:29:22 2014 +0000
+++ b/sys/arch/arm/arm32/db_interface.c Sun Mar 30 08:00:34 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.51 2014/03/28 21:54:12 matt Exp $ */
+/* $NetBSD: db_interface.c,v 1.52 2014/03/30 08:00:34 skrll Exp $ */
/*
* Copyright (c) 1996 Scott K. Stevens
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.51 2014/03/28 21:54:12 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.52 2014/03/30 08:00:34 skrll Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -71,6 +71,9 @@
int db_trapper(u_int, u_int, trapframe_t *, int);
int db_active = 0;
+db_regs_t ddb_regs; /* register state */
+db_regs_t *ddb_regp;
+
#ifdef MULTIPROCESSOR
volatile struct cpu_info *db_onproc;
volatile struct cpu_info *db_newcpu;
@@ -87,6 +90,7 @@
kdb_trap(int type, db_regs_t *regs)
{
struct cpu_info * const ci = curcpu();
+ db_regs_t dbreg;
int s;
switch (type) {
@@ -148,13 +152,19 @@
#endif
s = splhigh();
- ci->ci_ddb_regs = regs;
+ ci->ci_ddb_regs = &dbreg;
+ ddb_regp = &dbreg;
+ ddb_regs = *regs;
+
atomic_inc_32(&db_active);
cnpollc(true);
db_trap(type, 0/*code*/);
cnpollc(false);
atomic_dec_32(&db_active);
+
ci->ci_ddb_regs = NULL;
+ ddb_regp = &dbreg;
+ *regs = ddb_regs;
splx(s);
#ifdef MULTIPROCESSOR
diff -r aea8c52ee926 -r 06b203cf7493 sys/arch/arm/arm32/db_machdep.c
--- a/sys/arch/arm/arm32/db_machdep.c Sun Mar 30 07:29:22 2014 +0000
+++ b/sys/arch/arm/arm32/db_machdep.c Sun Mar 30 08:00:34 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.c,v 1.20 2014/03/29 09:27:57 skrll Exp $ */
+/* $NetBSD: db_machdep.c,v 1.21 2014/03/30 08:00:34 skrll Exp $ */
/*
* Copyright (c) 1996 Mark Brinicombe
@@ -33,7 +33,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.20 2014/03/29 09:27:57 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.21 2014/03/30 08:00:34 skrll Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -66,8 +66,7 @@
static int
ddb_reg_var(const struct db_variable *v, db_expr_t *ep, int op)
{
- KASSERT(curcpu()->ci_ddb_regs != NULL);
- register_t * const rp = (register_t *)(curcpu()->ci_ddb_regs);
+ register_t * const rp = (register_t *)DDB_REGS;
if (op == DB_VAR_SET) {
rp[(uintptr_t)v->valuep] = *ep;
} else {
diff -r aea8c52ee926 -r 06b203cf7493 sys/arch/arm/include/db_machdep.h
--- a/sys/arch/arm/include/db_machdep.h Sun Mar 30 07:29:22 2014 +0000
+++ b/sys/arch/arm/include/db_machdep.h Sun Mar 30 08:00:34 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.20 2014/03/28 21:54:12 matt Exp $ */
+/* $NetBSD: db_machdep.h,v 1.21 2014/03/30 08:00:34 skrll Exp $ */
/*
* Copyright (c) 1996 Scott K Stevens
@@ -48,7 +48,14 @@
typedef trapframe_t db_regs_t;
-#define DDB_REGS (curcpu()->ci_ddb_regs)
+#ifndef MULTIPROCESSOR
+extern db_regs_t ddb_regs; /* register state */
+#define DDB_REGS (&ddb_regs)
+#else
+extern db_regs_t *ddb_regp;
+#define DDB_REGS (ddb_regp)
+#define ddb_regs (*ddb_regp)
+#endif
#ifdef __PROG26
#define PC_REGS(regs) ((regs)->tf_r15 & R15_PC)
Home |
Main Index |
Thread Index |
Old Index