Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc/sparc add a "mach xcall" command to dump info...
details: https://anonhg.NetBSD.org/src/rev/94eb79dc45a6
branches: trunk
changeset: 762039:94eb79dc45a6
user: mrg <mrg%NetBSD.org@localhost>
date: Mon Feb 14 03:18:10 2011 +0000
description:
add a "mach xcall" command to dump info about each cpus xpmsg{} values.
while here, move the prototype for cpu_debug_dump() to cpuvar.h and
avoid the copy in db_interface.c.
diffstat:
sys/arch/sparc/sparc/cpu.c | 38 +++++++++++++++++++++++++++++++++---
sys/arch/sparc/sparc/cpuvar.h | 9 +++++++-
sys/arch/sparc/sparc/db_interface.c | 14 ++++++++++--
3 files changed, 53 insertions(+), 8 deletions(-)
diffs (149 lines):
diff -r cc85740f3c5d -r 94eb79dc45a6 sys/arch/sparc/sparc/cpu.c
--- a/sys/arch/sparc/sparc/cpu.c Mon Feb 14 02:43:37 2011 +0000
+++ b/sys/arch/sparc/sparc/cpu.c Mon Feb 14 03:18:10 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.228 2011/02/04 09:23:00 mrg Exp $ */
+/* $NetBSD: cpu.c,v 1.229 2011/02/14 03:18:10 mrg Exp $ */
/*
* Copyright (c) 1996
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.228 2011/02/04 09:23:00 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.229 2011/02/14 03:18:10 mrg Exp $");
#include "opt_multiprocessor.h"
#include "opt_lockdebug.h"
@@ -80,6 +80,7 @@
#include <machine/pmap.h>
#if defined(MULTIPROCESSOR) && defined(DDB)
+#include <ddb/db_output.h>
#include <machine/db_machdep.h>
#endif
@@ -2165,8 +2166,6 @@
#include "ioconf.h"
-void cpu_debug_dump(void);
-
/*
* Dump CPU information from ddb.
*/
@@ -2189,4 +2188,35 @@
ci->curpcb);
}
}
+
+#if defined(MULTIPROCESSOR)
+/*
+ * Dump CPU xcall from ddb.
+ */
+void
+cpu_xcall_dump(void)
+{
+ struct cpu_info *ci;
+ CPU_INFO_ITERATOR cii;
+
+ db_printf("%-4s %-10s %-10s %-10s %-10s %-10s "
+ "%-4s %-4s %-4s\n",
+ "CPU#", "FUNC", "TRAP", "ARG0", "ARG1", "ARG2",
+ "TAG", "RECV", "COMPL");
+ for (CPU_INFO_FOREACH(cii, ci)) {
+ db_printf("%-4d %-10p %-10p 0x%-8x 0x%-8x 0x%-8x "
+ "%-4d %-4d %-4d\n",
+ ci->ci_cpuid,
+ ci->msg.u.xpmsg_func.func,
+ ci->msg.u.xpmsg_func.trap,
+ ci->msg.u.xpmsg_func.arg0,
+ ci->msg.u.xpmsg_func.arg1,
+ ci->msg.u.xpmsg_func.arg2,
+ ci->msg.tag,
+ ci->msg.received,
+ ci->msg.complete);
+ }
+}
#endif
+
+#endif
diff -r cc85740f3c5d -r 94eb79dc45a6 sys/arch/sparc/sparc/cpuvar.h
--- a/sys/arch/sparc/sparc/cpuvar.h Mon Feb 14 02:43:37 2011 +0000
+++ b/sys/arch/sparc/sparc/cpuvar.h Mon Feb 14 03:18:10 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuvar.h,v 1.86 2011/01/27 06:24:59 mrg Exp $ */
+/* $NetBSD: cpuvar.h,v 1.87 2011/02/14 03:18:10 mrg Exp $ */
/*
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -496,5 +496,12 @@
#define cpuinfo (*(struct cpu_info *)CPUINFO_VA)
+#if defined(DDB) || defined(MULTIPROCESSOR)
+/*
+ * These are called by ddb mach functions.
+ */
+void cpu_debug_dump(void);
+void cpu_xcall_dump(void);
+#endif
#endif /* _sparc_cpuvar_h */
diff -r cc85740f3c5d -r 94eb79dc45a6 sys/arch/sparc/sparc/db_interface.c
--- a/sys/arch/sparc/sparc/db_interface.c Mon Feb 14 02:43:37 2011 +0000
+++ b/sys/arch/sparc/sparc/db_interface.c Mon Feb 14 03:18:10 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.87 2010/11/06 11:46:02 uebayasi Exp $ */
+/* $NetBSD: db_interface.c,v 1.88 2011/02/14 03:18:11 mrg Exp $ */
/*
* Mach Operating System
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.87 2010/11/06 11:46:02 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.88 2011/02/14 03:18:11 mrg Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -201,6 +201,7 @@
void db_uvmhistdump(db_expr_t, bool, db_expr_t, const char *);
#ifdef MULTIPROCESSOR
void db_cpu_cmd(db_expr_t, bool, db_expr_t, const char *);
+void db_xcall_cmd(db_expr_t, bool, db_expr_t, const char *);
#endif
void db_page_cmd(db_expr_t, bool, db_expr_t, const char *);
@@ -447,7 +448,6 @@
}
#if defined(MULTIPROCESSOR)
-extern void cpu_debug_dump(void); /* XXX */
void
db_cpu_cmd(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif)
@@ -482,6 +482,12 @@
ddb_cpuinfo = ci;
}
+void
+db_xcall_cmd(db_expr_t addr, bool have_addr, db_expr_t count, const char *modif)
+{
+ cpu_xcall_dump();
+}
+
#endif /* MULTIPROCESSOR */
const struct db_command db_machine_command_table[] = {
@@ -500,6 +506,8 @@
#ifdef MULTIPROCESSOR
{ DDB_ADD_CMD("cpu", db_cpu_cmd, 0,
"switch to another cpu's registers", "cpu-no", NULL) },
+ { DDB_ADD_CMD("xcall", db_xcall_cmd, 0,
+ "show xcall information on all cpus", NULL, NULL) },
#endif
{ DDB_ADD_CMD(NULL, NULL, 0, NULL,NULL,NULL) }
};
Home |
Main Index |
Thread Index |
Old Index