aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2012-06-25 16:52:24 +0100
committerBlue Swirl <blauwirbel@gmail.com>2012-07-14 10:37:42 +0000
commit66f27e63ae3d91876d348e38fb5af4b48ae6b8fb (patch)
tree4fe30b5e6570e9f8e88acea21c91c725c91946b8 /monitor.c
parentc1950a4e95c57c47a74d010c7c0727320ef2a550 (diff)
downloadqemu-66f27e63ae3d91876d348e38fb5af4b48ae6b8fb.zip
qemu-66f27e63ae3d91876d348e38fb5af4b48ae6b8fb.tar.gz
qemu-66f27e63ae3d91876d348e38fb5af4b48ae6b8fb.tar.bz2
monitor: Use TARGET_PRI*PHYS to avoid TARGET_PHYS_ADDR_BITS ifdef
Now we have TARGET_PRI*PHYS for printing target_phys_addr_t values, we can use them in monitor.c rather than having duplicate code in two arms of a TARGET_PHYS_ADDR_BITS ifdef. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/monitor.c b/monitor.c
index f6107ba..188c03d 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1262,45 +1262,24 @@ static void do_print(Monitor *mon, const QDict *qdict)
int format = qdict_get_int(qdict, "format");
target_phys_addr_t val = qdict_get_int(qdict, "val");
-#if TARGET_PHYS_ADDR_BITS == 32
switch(format) {
case 'o':
- monitor_printf(mon, "%#o", val);
+ monitor_printf(mon, "%#" TARGET_PRIoPHYS, val);
break;
case 'x':
- monitor_printf(mon, "%#x", val);
+ monitor_printf(mon, "%#" TARGET_PRIxPHYS, val);
break;
case 'u':
- monitor_printf(mon, "%u", val);
+ monitor_printf(mon, "%" TARGET_PRIuPHYS, val);
break;
default:
case 'd':
- monitor_printf(mon, "%d", val);
+ monitor_printf(mon, "%" TARGET_PRIdPHYS, val);
break;
case 'c':
monitor_printc(mon, val);
break;
}
-#else
- switch(format) {
- case 'o':
- monitor_printf(mon, "%#" PRIo64, val);
- break;
- case 'x':
- monitor_printf(mon, "%#" PRIx64, val);
- break;
- case 'u':
- monitor_printf(mon, "%" PRIu64, val);
- break;
- default:
- case 'd':
- monitor_printf(mon, "%" PRId64, val);
- break;
- case 'c':
- monitor_printc(mon, val);
- break;
- }
-#endif
monitor_printf(mon, "\n");
}