Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hpcmips/vr change about debug print.
details: https://anonhg.NetBSD.org/src/rev/2684d7555f48
branches: trunk
changeset: 483617:2684d7555f48
user: sato <sato%NetBSD.org@localhost>
date: Tue Mar 14 08:26:42 2000 +0000
description:
change about debug print.
CVS
diffstat:
sys/arch/hpcmips/vr/vrgiu.c | 55 +++++++++++++++++++++++---------------------
1 files changed, 29 insertions(+), 26 deletions(-)
diffs (115 lines):
diff -r e8916b21dc66 -r 2684d7555f48 sys/arch/hpcmips/vr/vrgiu.c
--- a/sys/arch/hpcmips/vr/vrgiu.c Tue Mar 14 08:23:29 2000 +0000
+++ b/sys/arch/hpcmips/vr/vrgiu.c Tue Mar 14 08:26:42 2000 +0000
@@ -1,5 +1,4 @@
-/* $NetBSD: vrgiu.c,v 1.8 2000/03/11 09:11:33 shin Exp $ */
-
+/* $NetBSD: vrgiu.c,v 1.9 2000/03/14 08:26:42 sato Exp $ */
/*-
* Copyright (c) 1999
* Shin Takemura and PocketBSD Project. All rights reserved.
@@ -62,8 +61,13 @@
#endif /* VRGIUDEBUG_CONF */
int vrgiu_debug = VRGIUDEBUG_CONF;
#define DPRINTF(flag, arg) if (vrgiu_debug & flag) printf arg;
+#define DDUMP_IO(flag, sc) if (vrgiu_debug & flag) vrgiu_dump_io(sc);
+#define DDUMP_IOSETTING(flag, sc) \
+ if (vrgiu_debug & flag) vrgiu_dump_iosetting(sc);
#else
#define DPRINTF(flag, arg)
+#define DDUMP_IO(flag, sc)
+#define DDUMP_IOSETTING(flag, sc)
#endif
#define LEGAL_INTR_PORT(x) ((x) >= 0 && (x) < MAX_GPIO_INOUT)
@@ -76,6 +80,7 @@
void vrgiu_callback __P((struct device*));
void vrgiu_dump_regs(struct vrgiu_softc *sc);
+void vrgiu_dump_io(struct vrgiu_softc *sc);
void vrgiu_dump_iosetting(struct vrgiu_softc *sc);
u_int32_t vrgiu_regread_4 __P((vrgiu_chipset_tag_t, bus_addr_t));
u_int16_t vrgiu_regread __P((vrgiu_chipset_tag_t, bus_addr_t));
@@ -133,13 +138,9 @@
#ifdef WINCE_DEFAULT_SETTING
#warning WINCE_DEFAULT_SETTING
#else
-#ifdef VRGIUDEBUG
- if (vrgiu_debug & DEBUG_IO) {
- printf("WIN setting: ");
- vrgiu_dump_iosetting(sc);
- printf("\n");
- }
-#endif /* VRGIUDEBUG */
+ DPRINTF(DEBUG_IO, ("WIN setting: "));
+ DDUMP_IOSETTING(DEBUG_IO, sc);
+ DPRINTF(DEBUG_IO, ("\n"));
vrgiu_regwrite_4(sc, GIUINTEN_REG, sc->sc_intr_mask);
#endif
@@ -156,21 +157,14 @@
* Register functions to upper interface.
*/
vrip_giu_function_register(va->va_vc, &vrgiu_functions, self);
-#ifdef VRGIUDEBUG
- /* Display port status (Input/Output) for debugging */
- if (vrgiu_debug & DEBUG_IO) {
- u_int32_t preg[2];
- printf("I/O setting: ");
- vrgiu_dump_iosetting(sc);
- printf("\n");
+ /* Display port status (Input/Output) for debugging */
+ DPRINTF(DEBUG_IO, ("I/O setting: "));
+ DDUMP_IOSETTING(DEBUG_IO, sc);
+ DPRINTF(DEBUG_IO, ("\n"));
+ DPRINTF(DEBUG_IO, (" data:"));
+ DDUMP_IO(DEBUG_IO, sc);
- preg[0] = vrgiu_regread_4(sc, GIUPIOD_REG);
- preg[1] = vrgiu_regread_4(sc, GIUPODAT_REG);
- printf(" data:");
- bitdisp64(preg);
- }
-#endif /* VRGIUDEBUG */
/*
* General purpose bus
*/
@@ -228,6 +222,18 @@
}
void
+vrgiu_dump_io(sc)
+ struct vrgiu_softc *sc;
+{
+ u_int32_t preg[2];
+
+ preg[0] = vrgiu_regread_4(sc, GIUPIOD_REG);
+ preg[1] = vrgiu_regread_4(sc, GIUPODAT_REG);
+
+ bitdisp64(preg);
+}
+
+void
vrgiu_dump_regs(sc)
struct vrgiu_softc *sc;
{
@@ -367,7 +373,7 @@
offs = port - 48;
panic ("__vrgiu_out: not coded yet.");
}
- printf ("__vrgiu_out: addr %08x bit %d\n", addr, offs);
+ DPRINTF(DEBUG_IO, ("__vrgiu_out: addr %08x bit %d\n", addr, offs));
wbflush();
reg = *((volatile u_int16_t*)addr);
@@ -481,9 +487,6 @@
splx(s);
DPRINTF(DEBUG_INTR, ("\n"));
-#if 0 && defined VRGIUDEBUG
- vrgiu_dump_regs(sc);
-#endif
return ih;
}
Home |
Main Index |
Thread Index |
Old Index