[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 29/76] hw/ppc: Avoid using Monitor in PnvChipClass::intc_print_inf
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 29/76] hw/ppc: Avoid using Monitor in PnvChipClass::intc_print_info() |
Date: |
Tue, 18 Jun 2024 17:59:51 +0200 |
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-6-philmd@linaro.org>
---
include/hw/ppc/pnv_chip.h | 2 +-
hw/ppc/pnv.c | 30 ++++++++----------------------
2 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/include/hw/ppc/pnv_chip.h b/include/hw/ppc/pnv_chip.h
index 8589f3291e..a5e428be7c 100644
--- a/include/hw/ppc/pnv_chip.h
+++ b/include/hw/ppc/pnv_chip.h
@@ -151,7 +151,7 @@ struct PnvChipClass {
void (*intc_create)(PnvChip *chip, PowerPCCPU *cpu, Error **errp);
void (*intc_reset)(PnvChip *chip, PowerPCCPU *cpu);
void (*intc_destroy)(PnvChip *chip, PowerPCCPU *cpu);
- void (*intc_print_info)(PnvChip *chip, PowerPCCPU *cpu, Monitor *mon);
+ void (*intc_print_info)(PnvChip *chip, PowerPCCPU *cpu, GString *buf);
ISABus *(*isa_create)(PnvChip *chip, Error **errp);
void (*dt_populate)(PnvChip *chip, void *fdt);
void (*pic_print_info)(PnvChip *chip, Monitor *mon);
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 3eaf674efa..aed6767c8d 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -1129,15 +1129,9 @@ static void pnv_chip_power8_intc_destroy(PnvChip *chip,
PowerPCCPU *cpu)
}
static void pnv_chip_power8_intc_print_info(PnvChip *chip, PowerPCCPU *cpu,
- Monitor *mon)
+ GString *buf)
{
- g_autoptr(GString) buf = g_string_new("");
- g_autoptr(HumanReadableText) info = NULL;
-
icp_pic_print_info(ICP(pnv_cpu_state(cpu)->intc), buf);
-
- info = human_readable_text_from_str(buf);
- monitor_puts(mon, info->human_readable_text);
}
/*
@@ -1222,15 +1216,9 @@ static void pnv_chip_power9_intc_destroy(PnvChip *chip,
PowerPCCPU *cpu)
}
static void pnv_chip_power9_intc_print_info(PnvChip *chip, PowerPCCPU *cpu,
- Monitor *mon)
+ GString *buf)
{
- g_autoptr(GString) buf = g_string_new("");
- g_autoptr(HumanReadableText) info = NULL;
-
xive_tctx_pic_print_info(XIVE_TCTX(pnv_cpu_state(cpu)->intc), buf);
-
- info = human_readable_text_from_str(buf);
- monitor_puts(mon, info->human_readable_text);
}
static void pnv_chip_power10_intc_create(PnvChip *chip, PowerPCCPU *cpu,
@@ -1272,15 +1260,9 @@ static void pnv_chip_power10_intc_destroy(PnvChip *chip,
PowerPCCPU *cpu)
}
static void pnv_chip_power10_intc_print_info(PnvChip *chip, PowerPCCPU *cpu,
- Monitor *mon)
+ GString *buf)
{
- g_autoptr(GString) buf = g_string_new("");
- g_autoptr(HumanReadableText) info = NULL;
-
xive_tctx_pic_print_info(XIVE_TCTX(pnv_cpu_state(cpu)->intc), buf);
-
- info = human_readable_text_from_str(buf);
- monitor_puts(mon, info->human_readable_text);
}
/*
@@ -2363,14 +2345,18 @@ static void pnv_pic_print_info(InterruptStatsProvider
*obj,
PnvMachineState *pnv = PNV_MACHINE(obj);
int i;
CPUState *cs;
+ g_autoptr(GString) buf = g_string_new("");
+ g_autoptr(HumanReadableText) info = NULL;
CPU_FOREACH(cs) {
PowerPCCPU *cpu = POWERPC_CPU(cs);
/* XXX: loop on each chip/core/thread instead of CPU_FOREACH() */
PNV_CHIP_GET_CLASS(pnv->chips[0])->intc_print_info(pnv->chips[0], cpu,
- mon);
+ buf);
}
+ info = human_readable_text_from_str(buf);
+ monitor_puts(mon, info->human_readable_text);
for (i = 0; i < pnv->num_chips; i++) {
PNV_CHIP_GET_CLASS(pnv->chips[i])->pic_print_info(pnv->chips[i], mon);
--
2.41.0
- [PULL 19/76] hw/i386/acpi: Remove AcpiBuildState::rsdp field, (continued)
- [PULL 19/76] hw/i386/acpi: Remove AcpiBuildState::rsdp field, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 22/76] target/i386: Remove X86CPU::kvm_no_smi_migration field, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 20/76] hw/i386/pc: Remove deprecated pc-i440fx-2.3 machine, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 21/76] hw/i386/pc: Simplify DEFINE_I440FX_MACHINE() macro, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 23/76] hw/i386/pc: Replace PCMachineClass::acpi_data_size by PC_ACPI_DATA_SIZE, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 24/76] hw/audio/virtio-snd: Always use little endian audio format, Philippe Mathieu-Daudé, 2024/06/18
- [PULL 25/76] hw/ppc: Avoid using Monitor in pnv_phb3_msi_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/18
- [PULL 26/76] hw/ppc: Avoid using Monitor in icp_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/18
- [PULL 27/76] hw/ppc: Avoid using Monitor in xive_tctx_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/18
- [PULL 28/76] hw/ppc: Avoid using Monitor in ics_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/18
- [PULL 29/76] hw/ppc: Avoid using Monitor in PnvChipClass::intc_print_info(),
Philippe Mathieu-Daudé <=
- [PULL 30/76] hw/ppc: Avoid using Monitor in xive_end_queue_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/18
- [PULL 31/76] hw/ppc: Avoid using Monitor in spapr_xive_end_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/18
- [PULL 32/76] hw/ppc: Avoid using Monitor in spapr_xive_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/18
- [PULL 33/76] hw/ppc: Avoid using Monitor in xive_source_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/18
- [PULL 34/76] hw/ppc: Avoid using Monitor in pnv_phb4_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/18
- [PULL 35/76] hw/ppc: Avoid using Monitor in xive_eas_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/18
- [PULL 36/76] hw/ppc: Avoid using Monitor in xive_end_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/18
- [PULL 37/76] hw/ppc: Avoid using Monitor in xive_end_eas_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/18
- [PULL 38/76] hw/ppc: Avoid using Monitor in xive_nvt_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/18
- [PULL 39/76] hw/ppc: Avoid using Monitor in pnv_xive_pic_print_info(), Philippe Mathieu-Daudé, 2024/06/18