Module Name: src
Committed By: matt
Date: Thu Apr 14 17:43:07 UTC 2011
Modified Files:
src/sys/arch/mips/include: locore.h
src/sys/arch/mips/mips: db_interface.c
Log Message:
Fix printing of watch{lo,hi} and make mipsNN_watchlo_* use intptr_t so that
sign extention happens.
To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/mips/include/locore.h
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/mips/mips/db_interface.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/mips/include/locore.h
diff -u src/sys/arch/mips/include/locore.h:1.88 src/sys/arch/mips/include/locore.h:1.89
--- src/sys/arch/mips/include/locore.h:1.88 Thu Apr 14 05:08:22 2011
+++ src/sys/arch/mips/include/locore.h Thu Apr 14 17:43:07 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.h,v 1.88 2011/04/14 05:08:22 cliff Exp $ */
+/* $NetBSD: locore.h,v 1.89 2011/04/14 17:43:07 matt Exp $ */
/*
* This file should not be included by MI code!!!
@@ -148,8 +148,8 @@
uint32_t mipsNN_cp0_config2_read(void);
uint32_t mipsNN_cp0_config3_read(void);
-uintptr_t mipsNN_cp0_watchlo_read(u_int);
-void mipsNN_cp0_watchlo_write(u_int, uintptr_t);
+intptr_t mipsNN_cp0_watchlo_read(u_int);
+void mipsNN_cp0_watchlo_write(u_int, intptr_t);
uint32_t mipsNN_cp0_watchhi_read(u_int);
void mipsNN_cp0_watchhi_write(u_int, uint32_t);
Index: src/sys/arch/mips/mips/db_interface.c
diff -u src/sys/arch/mips/mips/db_interface.c:1.72 src/sys/arch/mips/mips/db_interface.c:1.73
--- src/sys/arch/mips/mips/db_interface.c:1.72 Thu Apr 14 09:25:05 2011
+++ src/sys/arch/mips/mips/db_interface.c Thu Apr 14 17:43:07 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.72 2011/04/14 09:25:05 matt Exp $ */
+/* $NetBSD: db_interface.c,v 1.73 2011/04/14 17:43:07 matt Exp $ */
/*
* Mach Operating System
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.72 2011/04/14 09:25:05 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.73 2011/04/14 17:43:07 matt Exp $");
#include "opt_multiprocessor.h"
#include "opt_cputype.h" /* which mips CPUs do we support? */
@@ -466,19 +466,12 @@
#if (MIPS32 + MIPS32R2 + MIPS64 + MIPS64R2) > 0
for (int i=0; i < curcpu()->ci_cpuwatch_count; i++) {
- uint32_t r = mipsNN_cp0_watchlo_read(i);
- printf(" %s%d:%*s %#x\n", "watchlo", i, FLDWIDTH - 8, "", r);
- }
- for (int i=0; i < curcpu()->ci_cpuwatch_count; i++) {
- if (CPUIS64BITS) {
- uint32_t r = mipsNN_cp0_watchhi_read(i);
- printf(" %s%d:%*s %#x\n",
- "watchhi", i, FLDWIDTH - 8, "", r);
- } else {
- uint64_t r = mipsNN_cp0_watchhi_read(i);
- printf(" %s%d:%*s %#" PRIx64 "\n",
- "watchhi", i, FLDWIDTH - 8, "", r);
- }
+ const intptr_t lo = mipsNN_cp0_watchlo_read(i);
+ const uint32_t hi = mipsNN_cp0_watchhi_read(i);
+ printf(" %s%d:%*s %#" PRIxPTR "\t",
+ "watchlo", i, FLDWIDTH - 8, "", lo);
+ printf(" %s%d:%*s %#" PRIx32 "\n",
+ "watchhi", i, FLDWIDTH - 8, "", hi);
}
#endif