aboutsummaryrefslogtreecommitdiff
path: root/hw/mc146818rtc.c
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2010-05-14 16:29:24 +0900
committerBlue Swirl <blauwirbel@gmail.com>2010-05-15 16:42:39 +0000
commitec51e364ed041c5526e388cc1e480f48ecb68c3c (patch)
tree5e46bbe1db12cdbeae00208ae74775dd34bae699 /hw/mc146818rtc.c
parent019ea978975cb8c4cf6102961e5fe5d23b9a5f98 (diff)
mc146818rtc: remove #ifdef DEBUG_CMOS.
remove #ifdef DEBUG_CMOS by using macro. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/mc146818rtc.c')
-rw-r--r--hw/mc146818rtc.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 450d218509..571c5931ec 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -32,6 +32,12 @@
//#define DEBUG_CMOS
+#ifdef DEBUG_CMOS
+# define CMOS_DPRINTF(format, ...) printf(format, ## __VA_ARGS__)
+#else
+# define CMOS_DPRINTF(format, ...) do { } while (0)
+#endif
+
#define RTC_REINJECT_ON_ACK_COUNT 20
#define RTC_SECONDS 0
@@ -211,10 +217,8 @@ static void cmos_ioport_write(void *opaque, uint32_t addr, uint32_t data)
if ((addr & 1) == 0) {
s->cmos_index = data & 0x7f;
} else {
-#ifdef DEBUG_CMOS
- printf("cmos: write index=0x%02x val=0x%02x\n",
- s->cmos_index, data);
-#endif
+ CMOS_DPRINTF("cmos: write index=0x%02x val=0x%02x\n",
+ s->cmos_index, data);
switch(s->cmos_index) {
case RTC_SECONDS_ALARM:
case RTC_MINUTES_ALARM:
@@ -485,10 +489,8 @@ static uint32_t cmos_ioport_read(void *opaque, uint32_t addr)
ret = s->cmos_data[s->cmos_index];
break;
}
-#ifdef DEBUG_CMOS
- printf("cmos: read index=0x%02x val=0x%02x\n",
- s->cmos_index, ret);
-#endif
+ CMOS_DPRINTF("cmos: read index=0x%02x val=0x%02x\n",
+ s->cmos_index, ret);
return ret;
}
}