aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2012-06-25 11:57:41 +0000
committerPeter Maydell <peter.maydell@linaro.org>2012-06-25 11:57:41 +0000
commitd3ee69375d181123f448bb10162205ea519552d0 (patch)
tree77e5b83492e0dbbeab248b57d8ca4d9c8714f8c3
parenta7d7f2e5b4d1e92776c81d57b1b78d7ad2799238 (diff)
downloadqemu-arm-priplx.tar.gz
monitor: Use PRI*PLX to avoid TARGET_PHYS_ADDR_BITS ifdefpriplx
Now we have PRX*PLX 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>
-rw-r--r--monitor.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/monitor.c b/monitor.c
index f6107badb6..6dea2a3249 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, "%#" PRIoPLX, val);
break;
case 'x':
- monitor_printf(mon, "%#x", val);
+ monitor_printf(mon, "%#" PRIxPLX, val);
break;
case 'u':
- monitor_printf(mon, "%u", val);
+ monitor_printf(mon, "%" PRIuPLX, val);
break;
default:
case 'd':
- monitor_printf(mon, "%d", val);
+ monitor_printf(mon, "%" PRIdPLX, 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");
}