[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 21/26] hw/ppc: Avoid using Monitor in xive2_nvp_pic_print_info()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 21/26] hw/ppc: Avoid using Monitor in xive2_nvp_pic_print_info() |
Date: |
Mon, 10 Jun 2024 08:20:59 +0200 |
Replace Monitor API by HumanReadableText one.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/intc/pnv_xive2.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/hw/intc/pnv_xive2.c b/hw/intc/pnv_xive2.c
index 52505fd1a4..10914b04df 100644
--- a/hw/intc/pnv_xive2.c
+++ b/hw/intc/pnv_xive2.c
@@ -2028,7 +2028,7 @@ static void pnv_xive2_register_types(void)
type_init(pnv_xive2_register_types)
static void xive2_nvp_pic_print_info(Xive2Nvp *nvp, uint32_t nvp_idx,
- Monitor *mon)
+ GString *buf)
{
uint8_t eq_blk = xive_get_field32(NVP2_W5_VP_END_BLOCK, nvp->w5);
uint32_t eq_idx = xive_get_field32(NVP2_W5_VP_END_INDEX, nvp->w5);
@@ -2037,21 +2037,21 @@ static void xive2_nvp_pic_print_info(Xive2Nvp *nvp,
uint32_t nvp_idx,
return;
}
- monitor_printf(mon, " %08x end:%02x/%04x IPB:%02x",
- nvp_idx, eq_blk, eq_idx,
- xive_get_field32(NVP2_W2_IPB, nvp->w2));
+ g_string_append_printf(buf, " %08x end:%02x/%04x IPB:%02x",
+ nvp_idx, eq_blk, eq_idx,
+ xive_get_field32(NVP2_W2_IPB, nvp->w2));
/*
* When the NVP is HW controlled, more fields are updated
*/
if (xive2_nvp_is_hw(nvp)) {
- monitor_printf(mon, " CPPR:%02x",
- xive_get_field32(NVP2_W2_CPPR, nvp->w2));
+ g_string_append_printf(buf, " CPPR:%02x",
+ xive_get_field32(NVP2_W2_CPPR, nvp->w2));
if (xive2_nvp_is_co(nvp)) {
- monitor_printf(mon, " CO:%04x",
- xive_get_field32(NVP2_W1_CO_THRID, nvp->w1));
+ g_string_append_printf(buf, " CO:%04x",
+ xive_get_field32(NVP2_W1_CO_THRID,
nvp->w1));
}
}
- monitor_printf(mon, "\n");
+ g_string_append_c(buf, '\n');
}
/*
@@ -2147,15 +2147,16 @@ void pnv_xive2_pic_print_info(PnvXive2 *xive, Monitor
*mon)
while (!xive2_router_get_end(xrtr, blk, i, &end)) {
xive2_end_pic_print_info(&end, i++, buf);
}
- info = human_readable_text_from_str(buf);
- monitor_puts(mon, info->human_readable_text);
- monitor_printf(mon, "XIVE[%x] #%d NVPT %08x .. %08x\n", chip_id, blk,
- 0, XIVE2_NVP_COUNT - 1);
+ g_string_append_printf(buf, "XIVE[%x] #%d NVPT %08x .. %08x\n",
+ chip_id, blk, 0, XIVE2_NVP_COUNT - 1);
xive_nvp_per_subpage = pnv_xive2_vst_per_subpage(xive, VST_NVP);
for (i = 0; i < XIVE2_NVP_COUNT; i += xive_nvp_per_subpage) {
while (!xive2_router_get_nvp(xrtr, blk, i, &nvp)) {
- xive2_nvp_pic_print_info(&nvp, i++, mon);
+ xive2_nvp_pic_print_info(&nvp, i++, buf);
}
}
+
+ info = human_readable_text_from_str(buf);
+ monitor_puts(mon, info->human_readable_text);
}
--
2.41.0
- [PATCH 12/26] hw/ppc: Avoid using Monitor in xive_end_pic_print_info(), (continued)
- [PATCH 12/26] hw/ppc: Avoid using Monitor in xive_end_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/10
- [PATCH 11/26] hw/ppc: Avoid using Monitor in xive_eas_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/10
- [PATCH 13/26] hw/ppc: Avoid using Monitor in xive_end_eas_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/10
- [PATCH 14/26] hw/ppc: Avoid using Monitor in xive_nvt_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/10
- [PATCH 15/26] hw/ppc: Avoid using Monitor in pnv_xive_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/10
- [PATCH 16/26] hw/ppc: Avoid using Monitor in pnv_psi_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/10
- [PATCH 17/26] hw/ppc: Avoid using Monitor in xive2_eas_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/10
- [PATCH 18/26] hw/ppc: Avoid using Monitor in xive2_end_eas_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/10
- [PATCH 19/26] hw/ppc: Avoid using Monitor in xive2_end_queue_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/10
- [PATCH 20/26] hw/ppc: Avoid using Monitor in xive2_end_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/10
- [PATCH 21/26] hw/ppc: Avoid using Monitor in xive2_nvp_pic_print_info(),
Philippe Mathieu-Daudé <=
- [PATCH 22/26] hw/ppc: Avoid using Monitor in pnv_xive2_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/10
- [PATCH 23/26] hw/ppc: Avoid using Monitor in SpaprInterruptControllerClass::print_info(), Philippe Mathieu-Daudé, 2024/06/10
- [PATCH 24/26] hw/ppc: Avoid using Monitor in spapr_irq_print_info(), Philippe Mathieu-Daudé, 2024/06/10
- [PATCH 26/26] hw/ppc: Avoid using Monitor in pic_print_info(), Philippe Mathieu-Daudé, 2024/06/10
- [PATCH 25/26] hw/ppc: Avoid using Monitor in pnv_chip_power9_pic_print_info_child(), Philippe Mathieu-Daudé, 2024/06/10
- Re: [PATCH 00/26] hw/ppc: Prefer HumanReadableText over Monitor, Philippe Mathieu-Daudé, 2024/06/10
- Re: [PATCH 00/26] hw/ppc: Prefer HumanReadableText over Monitor, Cédric Le Goater, 2024/06/10
- Re: [PATCH 00/26] hw/ppc: Prefer HumanReadableText over Monitor, Cédric Le Goater, 2024/06/10