Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64/sparc64 fix 'show registers' mis-aligned ac...
details: https://anonhg.NetBSD.org/src/rev/6082668dcc6c
branches: trunk
changeset: 507478:6082668dcc6c
user: petrov <petrov%NetBSD.org@localhost>
date: Thu Mar 22 22:20:28 2001 +0000
description:
fix 'show registers' mis-aligned access, PR11580
diffstat:
sys/arch/sparc64/sparc64/db_interface.c | 71 +++++++++++++++++++++++++++++++-
1 files changed, 68 insertions(+), 3 deletions(-)
diffs (89 lines):
diff -r ceadb8f7fe72 -r 6082668dcc6c sys/arch/sparc64/sparc64/db_interface.c
--- a/sys/arch/sparc64/sparc64/db_interface.c Thu Mar 22 22:10:04 2001 +0000
+++ b/sys/arch/sparc64/sparc64/db_interface.c Thu Mar 22 22:20:28 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.55 2001/01/22 13:57:00 jdolecek Exp $ */
+/* $NetBSD: db_interface.c,v 1.56 2001/03/22 22:20:28 petrov Exp $ */
/*
* Mach Operating System
@@ -76,12 +76,77 @@
static int nil;
+static int
+db__char_value(const struct db_variable *var, db_expr_t *expr, int mode)
+{
+
+ switch (mode) {
+ case DB_VAR_SET:
+ *var->valuep = *(char *)expr;
+ break;
+ case DB_VAR_GET:
+ *expr = *(char *)var->valuep;
+ break;
+#ifdef DIAGNOSTIC
+ default:
+ printf("db__char_value: mode %d\n", mode);
+ break;
+#endif
+ }
+
+ return 0;
+}
+
+#ifdef notdef_yet
+static int
+db__short_value(const struct db_variable *var, db_expr_t *expr, int mode)
+{
+
+ switch (mode) {
+ case DB_VAR_SET:
+ *var->valuep = *(short *)expr;
+ break;
+ case DB_VAR_GET:
+ *expr = *(short *)var->valuep;
+ break;
+#ifdef DIAGNOSTIC
+ default:
+ printf("db__short_value: mode %d\n", mode);
+ break;
+#endif
+ }
+
+ return 0;
+}
+#endif
+
+static int
+db__int_value(const struct db_variable *var, db_expr_t *expr, int mode)
+{
+
+ switch (mode) {
+ case DB_VAR_SET:
+ *var->valuep = *(int *)expr;
+ break;
+ case DB_VAR_GET:
+ *expr = *(int *)var->valuep;
+ break;
+#ifdef DIAGNOSTIC
+ default:
+ printf("db__int_value: mode %d\n", mode);
+ break;
+#endif
+ }
+
+ return 0;
+}
+
const struct db_variable db_regs[] = {
{ "tstate", (long *)&DDB_TF->tf_tstate, FCN_NULL, },
{ "pc", (long *)&DDB_TF->tf_pc, FCN_NULL, },
{ "npc", (long *)&DDB_TF->tf_npc, FCN_NULL, },
- { "ipl", (long *)&DDB_TF->tf_oldpil, FCN_NULL, },
- { "y", (long *)&DDB_TF->tf_y, FCN_NULL, },
+ { "ipl", (long *)&DDB_TF->tf_oldpil, db__char_value, },
+ { "y", (long *)&DDB_TF->tf_y, db__int_value, },
{ "g0", (long *)&nil, FCN_NULL, },
{ "g1", (long *)&DDB_TF->tf_global[1], FCN_NULL, },
{ "g2", (long *)&DDB_TF->tf_global[2], FCN_NULL, },
Home |
Main Index |
Thread Index |
Old Index