Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src Pull up following revision(s) (requested by nakayama in t...
details: https://anonhg.NetBSD.org/src/rev/d929fb1d1ebe
branches: netbsd-8
changeset: 434153:d929fb1d1ebe
user: snj <snj%NetBSD.org@localhost>
date: Tue Jul 25 02:11:13 2017 +0000
description:
Pull up following revision(s) (requested by nakayama in ticket #152):
usr.sbin/crash/Makefile: revision 1.37
sys/arch/sparc/conf/files.sparc: revision 1.157
sys/arch/sparc/sparc/db_interface.c: revision 1.94
sys/arch/sparc/sparc/db_machdep.c: revision 1.1
Move the ddb registers and empty command table used for crash(8) into
db_machdep.c like other archs.
--
sparc has db_machdep.c now.
diffstat:
sys/arch/sparc/conf/files.sparc | 3 +-
sys/arch/sparc/sparc/db_interface.c | 81 +----------------------
sys/arch/sparc/sparc/db_machdep.c | 128 ++++++++++++++++++++++++++++++++++++
usr.sbin/crash/Makefile | 6 +-
4 files changed, 134 insertions(+), 84 deletions(-)
diffs (278 lines):
diff -r c9ed0e5db683 -r d929fb1d1ebe sys/arch/sparc/conf/files.sparc
--- a/sys/arch/sparc/conf/files.sparc Tue Jul 25 02:09:32 2017 +0000
+++ b/sys/arch/sparc/conf/files.sparc Tue Jul 25 02:11:13 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.sparc,v 1.156 2016/04/30 05:24:45 macallan Exp $
+# $NetBSD: files.sparc,v 1.156.10.1 2017/07/25 02:11:13 snj Exp $
# @(#)files.sparc 8.1 (Berkeley) 7/19/93
# sparc-specific configuration info
@@ -317,6 +317,7 @@
file arch/sparc/sparc/vm_machdep.c
file arch/sparc/sparc/db_interface.c ddb | kgdb
+file arch/sparc/sparc/db_machdep.c ddb
file arch/sparc/sparc/db_trace.c ddb
file arch/sparc/sparc/db_disasm.c ddb
diff -r c9ed0e5db683 -r d929fb1d1ebe sys/arch/sparc/sparc/db_interface.c
--- a/sys/arch/sparc/sparc/db_interface.c Tue Jul 25 02:09:32 2017 +0000
+++ b/sys/arch/sparc/sparc/db_interface.c Tue Jul 25 02:11:13 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.93 2016/12/14 18:50:56 mrg Exp $ */
+/* $NetBSD: db_interface.c,v 1.93.8.1 2017/07/25 02:11:14 snj Exp $ */
/*
* Mach Operating System
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.93 2016/12/14 18:50:56 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.93.8.1 2017/07/25 02:11:14 snj Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -113,8 +113,6 @@
}
#endif
-db_regs_t *ddb_regp;
-
#if defined(DDB)
/*
@@ -132,81 +130,6 @@
#if defined(DDB) || defined(_KMEMUSER)
-static long nil;
-
-/*
- * Machine register set.
- */
-#define dbreg(xx) (long *)offsetof(db_regs_t, db_tf.tf_ ## xx)
-#define dbregfr(xx) (long *)offsetof(db_regs_t, db_fr.fr_ ## xx)
-
-static int db_sparc_regop(const struct db_variable *, db_expr_t *, int);
-
-const struct db_variable db_regs[] = {
- { "psr", dbreg(psr), db_sparc_regop, NULL, },
- { "pc", dbreg(pc), db_sparc_regop, NULL, },
- { "npc", dbreg(npc), db_sparc_regop, NULL, },
- { "y", dbreg(y), db_sparc_regop, NULL, },
- { "wim", dbreg(global[0]), db_sparc_regop, NULL, }, /* see reg.h */
- { "g0", &nil, FCN_NULL, NULL, },
- { "g1", dbreg(global[1]), db_sparc_regop, NULL, },
- { "g2", dbreg(global[2]), db_sparc_regop, NULL, },
- { "g3", dbreg(global[3]), db_sparc_regop, NULL, },
- { "g4", dbreg(global[4]), db_sparc_regop, NULL, },
- { "g5", dbreg(global[5]), db_sparc_regop, NULL, },
- { "g6", dbreg(global[6]), db_sparc_regop, NULL, },
- { "g7", dbreg(global[7]), db_sparc_regop, NULL, },
- { "o0", dbreg(out[0]), db_sparc_regop, NULL, },
- { "o1", dbreg(out[1]), db_sparc_regop, NULL, },
- { "o2", dbreg(out[2]), db_sparc_regop, NULL, },
- { "o3", dbreg(out[3]), db_sparc_regop, NULL, },
- { "o4", dbreg(out[4]), db_sparc_regop, NULL, },
- { "o5", dbreg(out[5]), db_sparc_regop, NULL, },
- { "o6", dbreg(out[6]), db_sparc_regop, NULL, },
- { "o7", dbreg(out[7]), db_sparc_regop, NULL, },
- { "l0", dbregfr(local[0]), db_sparc_regop, NULL, },
- { "l1", dbregfr(local[1]), db_sparc_regop, NULL, },
- { "l2", dbregfr(local[2]), db_sparc_regop, NULL, },
- { "l3", dbregfr(local[3]), db_sparc_regop, NULL, },
- { "l4", dbregfr(local[4]), db_sparc_regop, NULL, },
- { "l5", dbregfr(local[5]), db_sparc_regop, NULL, },
- { "l6", dbregfr(local[6]), db_sparc_regop, NULL, },
- { "l7", dbregfr(local[7]), db_sparc_regop, NULL, },
- { "i0", dbregfr(arg[0]), db_sparc_regop, NULL, },
- { "i1", dbregfr(arg[1]), db_sparc_regop, NULL, },
- { "i2", dbregfr(arg[2]), db_sparc_regop, NULL, },
- { "i3", dbregfr(arg[3]), db_sparc_regop, NULL, },
- { "i4", dbregfr(arg[4]), db_sparc_regop, NULL, },
- { "i5", dbregfr(arg[5]), db_sparc_regop, NULL, },
- { "i6", dbregfr(fp), db_sparc_regop, NULL, },
- { "i7", dbregfr(pc), db_sparc_regop, NULL, },
-};
-const struct db_variable * const db_eregs =
- db_regs + sizeof(db_regs)/sizeof(db_regs[0]);
-
-static int
-db_sparc_regop (const struct db_variable *vp, db_expr_t *val, int opcode)
-{
- db_expr_t *regaddr =
- (db_expr_t *)(((uint8_t *)DDB_REGS) + ((size_t)vp->valuep));
-
- switch (opcode) {
- case DB_VAR_GET:
- *val = *regaddr;
- break;
- case DB_VAR_SET:
- *regaddr = *val;
- break;
- default:
-#ifdef _KERNEL
- panic("db_sparc_regop: unknown op %d", opcode);
-#else
- printf("db_sparc_regop: unknown op %d\n", opcode);
-#endif
- }
- return 0;
-}
-
int db_active = 0;
extern char *trap_type[];
diff -r c9ed0e5db683 -r d929fb1d1ebe sys/arch/sparc/sparc/db_machdep.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sparc/sparc/db_machdep.c Tue Jul 25 02:11:13 2017 +0000
@@ -0,0 +1,128 @@
+/* $NetBSD: db_machdep.c,v 1.1.2.2 2017/07/25 02:11:14 snj Exp $ */
+
+/*
+ * Mach Operating System
+ * Copyright (c) 1991,1990 Carnegie Mellon University
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ * Software Distribution Coordinator or Software.Distribution%CS.CMU.EDU@localhost
+ * School of Computer Science
+ * Carnegie Mellon University
+ * Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ *
+ * From: db_interface.c,v 2.4 1991/02/05 17:11:13 mrt (CMU)
+ */
+
+/*
+ * Interface to new debugger.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.1.2.2 2017/07/25 02:11:14 snj Exp $");
+
+#ifdef _KERNEL_OPT
+#include "opt_ddb.h"
+#endif
+
+#include <sys/param.h>
+#include <machine/db_machdep.h>
+#include <ddb/db_user.h>
+#include <ddb/db_command.h>
+#include <ddb/db_variables.h>
+
+/*
+ * Machine register set.
+ */
+#define dbreg(xx) (long *)offsetof(db_regs_t, db_tf.tf_ ## xx)
+#define dbregfr(xx) (long *)offsetof(db_regs_t, db_fr.fr_ ## xx)
+
+static int db_sparc_regop(const struct db_variable *, db_expr_t *, int);
+
+db_regs_t *ddb_regp;
+static long nil;
+
+const struct db_variable db_regs[] = {
+ { "psr", dbreg(psr), db_sparc_regop, NULL, },
+ { "pc", dbreg(pc), db_sparc_regop, NULL, },
+ { "npc", dbreg(npc), db_sparc_regop, NULL, },
+ { "y", dbreg(y), db_sparc_regop, NULL, },
+ { "wim", dbreg(global[0]), db_sparc_regop, NULL, }, /* see reg.h */
+ { "g0", &nil, FCN_NULL, NULL, },
+ { "g1", dbreg(global[1]), db_sparc_regop, NULL, },
+ { "g2", dbreg(global[2]), db_sparc_regop, NULL, },
+ { "g3", dbreg(global[3]), db_sparc_regop, NULL, },
+ { "g4", dbreg(global[4]), db_sparc_regop, NULL, },
+ { "g5", dbreg(global[5]), db_sparc_regop, NULL, },
+ { "g6", dbreg(global[6]), db_sparc_regop, NULL, },
+ { "g7", dbreg(global[7]), db_sparc_regop, NULL, },
+ { "o0", dbreg(out[0]), db_sparc_regop, NULL, },
+ { "o1", dbreg(out[1]), db_sparc_regop, NULL, },
+ { "o2", dbreg(out[2]), db_sparc_regop, NULL, },
+ { "o3", dbreg(out[3]), db_sparc_regop, NULL, },
+ { "o4", dbreg(out[4]), db_sparc_regop, NULL, },
+ { "o5", dbreg(out[5]), db_sparc_regop, NULL, },
+ { "o6", dbreg(out[6]), db_sparc_regop, NULL, },
+ { "o7", dbreg(out[7]), db_sparc_regop, NULL, },
+ { "l0", dbregfr(local[0]), db_sparc_regop, NULL, },
+ { "l1", dbregfr(local[1]), db_sparc_regop, NULL, },
+ { "l2", dbregfr(local[2]), db_sparc_regop, NULL, },
+ { "l3", dbregfr(local[3]), db_sparc_regop, NULL, },
+ { "l4", dbregfr(local[4]), db_sparc_regop, NULL, },
+ { "l5", dbregfr(local[5]), db_sparc_regop, NULL, },
+ { "l6", dbregfr(local[6]), db_sparc_regop, NULL, },
+ { "l7", dbregfr(local[7]), db_sparc_regop, NULL, },
+ { "i0", dbregfr(arg[0]), db_sparc_regop, NULL, },
+ { "i1", dbregfr(arg[1]), db_sparc_regop, NULL, },
+ { "i2", dbregfr(arg[2]), db_sparc_regop, NULL, },
+ { "i3", dbregfr(arg[3]), db_sparc_regop, NULL, },
+ { "i4", dbregfr(arg[4]), db_sparc_regop, NULL, },
+ { "i5", dbregfr(arg[5]), db_sparc_regop, NULL, },
+ { "i6", dbregfr(fp), db_sparc_regop, NULL, },
+ { "i7", dbregfr(pc), db_sparc_regop, NULL, },
+};
+const struct db_variable * const db_eregs =
+ db_regs + sizeof(db_regs)/sizeof(db_regs[0]);
+
+static int
+db_sparc_regop(const struct db_variable *vp, db_expr_t *val, int opcode)
+{
+ db_expr_t *regaddr =
+ (db_expr_t *)(((uint8_t *)DDB_REGS) + ((size_t)vp->valuep));
+
+ switch (opcode) {
+ case DB_VAR_GET:
+ *val = *regaddr;
+ break;
+ case DB_VAR_SET:
+ *regaddr = *val;
+ break;
+ default:
+#ifdef _KERNEL
+ panic("db_sparc_regop: unknown op %d", opcode);
+#else
+ printf("db_sparc_regop: unknown op %d\n", opcode);
+#endif
+ }
+ return 0;
+}
+
+#ifndef DDB
+const struct db_command db_machine_command_table[] = {
+ { DDB_ADD_CMD(NULL, NULL, 0, NULL,NULL,NULL) }
+};
+#endif /* DDB */
diff -r c9ed0e5db683 -r d929fb1d1ebe usr.sbin/crash/Makefile
--- a/usr.sbin/crash/Makefile Tue Jul 25 02:09:32 2017 +0000
+++ b/usr.sbin/crash/Makefile Tue Jul 25 02:11:13 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.36 2017/04/10 12:05:52 christos Exp $
+# $NetBSD: Makefile,v 1.36.4.1 2017/07/25 02:11:14 snj Exp $
PROG= crash
MAN= crash.8
@@ -21,9 +21,7 @@
|| (${MACHINE_CPU} == "arm" && ${MACHINE} != "acorn26") \
|| ${MACHINE_ARCH} == "m68k"
SRCS+= db_trace.c
-.if ${MACHINE_ARCH} == "sparc"
-SRCS+= db_interface.c
-.elif ${MACHINE_ARCH} != "m68k"
+.if ${MACHINE_ARCH} != "m68k"
SRCS+= db_machdep.c
.endif
REALCRASH=yes
Home |
Main Index |
Thread Index |
Old Index