提交 66f27e63 编写于 作者: P Peter Maydell 提交者: Blue Swirl

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: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NAndreas Färber <afaerber@suse.de>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 c1950a4e
...@@ -1262,45 +1262,24 @@ static void do_print(Monitor *mon, const QDict *qdict) ...@@ -1262,45 +1262,24 @@ static void do_print(Monitor *mon, const QDict *qdict)
int format = qdict_get_int(qdict, "format"); int format = qdict_get_int(qdict, "format");
target_phys_addr_t val = qdict_get_int(qdict, "val"); target_phys_addr_t val = qdict_get_int(qdict, "val");
#if TARGET_PHYS_ADDR_BITS == 32
switch(format) { switch(format) {
case 'o': case 'o':
monitor_printf(mon, "%#o", val); monitor_printf(mon, "%#" TARGET_PRIoPHYS, val);
break; break;
case 'x': case 'x':
monitor_printf(mon, "%#x", val); monitor_printf(mon, "%#" TARGET_PRIxPHYS, val);
break; break;
case 'u': case 'u':
monitor_printf(mon, "%u", val); monitor_printf(mon, "%" TARGET_PRIuPHYS, val);
break; break;
default: default:
case 'd': case 'd':
monitor_printf(mon, "%d", val); monitor_printf(mon, "%" TARGET_PRIdPHYS, val);
break; break;
case 'c': case 'c':
monitor_printc(mon, val); monitor_printc(mon, val);
break; 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"); monitor_printf(mon, "\n");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册