aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-06-07 14:48:53 +0200
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-06-19 12:40:49 +0200
commit4d62448c1c74629ec7a1a19920770cbfb13861de (patch)
tree30a965a23920e50e50355d09bacc3a3e0b7e4259 /hw
parent950f1273abed699227d0fde2c7436a6fbc16fd53 (diff)
downloadqemu-4d62448c1c74629ec7a1a19920770cbfb13861de.zip
qemu-4d62448c1c74629ec7a1a19920770cbfb13861de.tar.gz
qemu-4d62448c1c74629ec7a1a19920770cbfb13861de.tar.bz2
hw/ppc: Avoid using Monitor in spapr_xive_pic_print_info()
Replace Monitor API by HumanReadableText one. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com> Message-Id: <20240610062105.49848-9-philmd@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/intc/spapr_xive.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c
index d571645..9d0d594 100644
--- a/hw/intc/spapr_xive.c
+++ b/hw/intc/spapr_xive.c
@@ -157,7 +157,7 @@ static void spapr_xive_end_pic_print_info(SpaprXive *xive, XiveEND *end,
#define spapr_xive_in_kernel(xive) \
(kvm_irqchip_in_kernel() && (xive)->fd != -1)
-static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon)
+static void spapr_xive_pic_print_info(SpaprXive *xive, GString *buf)
{
XiveSource *xsrc = &xive->source;
int i;
@@ -172,7 +172,7 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon)
}
}
- monitor_printf(mon, " LISN PQ EISN CPU/PRIO EQ\n");
+ g_string_append_printf(buf, " LISN PQ EISN CPU/PRIO EQ\n");
for (i = 0; i < xive->nr_irqs; i++) {
uint8_t pq = xive_source_esb_get(xsrc, i);
@@ -182,19 +182,17 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon)
continue;
}
- monitor_printf(mon, " %08x %s %c%c%c %s %08x ", i,
- xive_source_irq_is_lsi(xsrc, i) ? "LSI" : "MSI",
- pq & XIVE_ESB_VAL_P ? 'P' : '-',
- pq & XIVE_ESB_VAL_Q ? 'Q' : '-',
- xive_source_is_asserted(xsrc, i) ? 'A' : ' ',
- xive_eas_is_masked(eas) ? "M" : " ",
- (int) xive_get_field64(EAS_END_DATA, eas->w));
+ g_string_append_printf(buf, " %08x %s %c%c%c %s %08x ", i,
+ xive_source_irq_is_lsi(xsrc, i) ? "LSI" : "MSI",
+ pq & XIVE_ESB_VAL_P ? 'P' : '-',
+ pq & XIVE_ESB_VAL_Q ? 'Q' : '-',
+ xive_source_is_asserted(xsrc, i) ? 'A' : ' ',
+ xive_eas_is_masked(eas) ? "M" : " ",
+ (int) xive_get_field64(EAS_END_DATA, eas->w));
if (!xive_eas_is_masked(eas)) {
uint32_t end_idx = xive_get_field64(EAS_END_INDEX, eas->w);
XiveEND *end;
- g_autoptr(GString) buf = g_string_new("");
- g_autoptr(HumanReadableText) info = NULL;
assert(end_idx < xive->nr_ends);
end = &xive->endt[end_idx];
@@ -203,10 +201,8 @@ static void spapr_xive_pic_print_info(SpaprXive *xive, Monitor *mon)
spapr_xive_end_pic_print_info(xive, end, buf);
}
- info = human_readable_text_from_str(buf);
- monitor_puts(mon, info->human_readable_text);
}
- monitor_printf(mon, "\n");
+ g_string_append_c(buf, '\n');
}
}
@@ -717,10 +713,10 @@ static void spapr_xive_print_info(SpaprInterruptController *intc, Monitor *mon)
xive_tctx_pic_print_info(spapr_cpu_state(cpu)->tctx, buf);
}
+ spapr_xive_pic_print_info(xive, buf);
+
info = human_readable_text_from_str(buf);
monitor_puts(mon, info->human_readable_text);
-
- spapr_xive_pic_print_info(xive, mon);
}
static void spapr_xive_dt(SpaprInterruptController *intc, uint32_t nr_servers,