mirror of https://github.com/xemu-project/xemu.git
hw/ppc: Avoid using Monitor in pnv_phb4_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-11-philmd@linaro.org>
This commit is contained in:
parent
b71a3f67bc
commit
dbcbb8c00f
|
@ -10,8 +10,6 @@
|
||||||
#include "qemu/log.h"
|
#include "qemu/log.h"
|
||||||
#include "qapi/visitor.h"
|
#include "qapi/visitor.h"
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "qapi/type-helpers.h"
|
|
||||||
#include "monitor/monitor.h"
|
|
||||||
#include "target/ppc/cpu.h"
|
#include "target/ppc/cpu.h"
|
||||||
#include "hw/pci-host/pnv_phb4_regs.h"
|
#include "hw/pci-host/pnv_phb4_regs.h"
|
||||||
#include "hw/pci-host/pnv_phb4.h"
|
#include "hw/pci-host/pnv_phb4.h"
|
||||||
|
@ -1802,14 +1800,12 @@ static void pnv_phb4_register_types(void)
|
||||||
|
|
||||||
type_init(pnv_phb4_register_types);
|
type_init(pnv_phb4_register_types);
|
||||||
|
|
||||||
void pnv_phb4_pic_print_info(PnvPHB4 *phb, Monitor *mon)
|
void pnv_phb4_pic_print_info(PnvPHB4 *phb, GString *buf)
|
||||||
{
|
{
|
||||||
uint64_t notif_port =
|
uint64_t notif_port =
|
||||||
phb->regs[PHB_INT_NOTIFY_ADDR >> 3] & ~PHB_INT_NOTIFY_ADDR_64K;
|
phb->regs[PHB_INT_NOTIFY_ADDR >> 3] & ~PHB_INT_NOTIFY_ADDR_64K;
|
||||||
uint32_t offset = phb->regs[PHB_INT_NOTIFY_INDEX >> 3];
|
uint32_t offset = phb->regs[PHB_INT_NOTIFY_INDEX >> 3];
|
||||||
bool abt = !!(phb->regs[PHB_CTRLR >> 3] & PHB_CTRLR_IRQ_ABT_MODE);
|
bool abt = !!(phb->regs[PHB_CTRLR >> 3] & PHB_CTRLR_IRQ_ABT_MODE);
|
||||||
g_autoptr(GString) buf = g_string_new("");
|
|
||||||
g_autoptr(HumanReadableText) info = NULL;
|
|
||||||
|
|
||||||
g_string_append_printf(buf,
|
g_string_append_printf(buf,
|
||||||
"PHB4[%x:%x] Source %08x .. %08x "
|
"PHB4[%x:%x] Source %08x .. %08x "
|
||||||
|
@ -1819,7 +1815,4 @@ void pnv_phb4_pic_print_info(PnvPHB4 *phb, Monitor *mon)
|
||||||
abt ? "ABT" : "",
|
abt ? "ABT" : "",
|
||||||
notif_port);
|
notif_port);
|
||||||
xive_source_pic_print_info(&phb->xsrc, 0, buf);
|
xive_source_pic_print_info(&phb->xsrc, 0, buf);
|
||||||
|
|
||||||
info = human_readable_text_from_str(buf);
|
|
||||||
monitor_puts(mon, info->human_readable_text);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -791,12 +791,16 @@ static int pnv_chip_power9_pic_print_info_child(Object *child, void *opaque)
|
||||||
{
|
{
|
||||||
Monitor *mon = opaque;
|
Monitor *mon = opaque;
|
||||||
PnvPHB *phb = (PnvPHB *) object_dynamic_cast(child, TYPE_PNV_PHB);
|
PnvPHB *phb = (PnvPHB *) object_dynamic_cast(child, TYPE_PNV_PHB);
|
||||||
|
g_autoptr(GString) buf = g_string_new("");
|
||||||
|
g_autoptr(HumanReadableText) info = NULL;
|
||||||
|
|
||||||
if (!phb) {
|
if (!phb) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pnv_phb4_pic_print_info(PNV_PHB4(phb->backend), mon);
|
pnv_phb4_pic_print_info(PNV_PHB4(phb->backend), buf);
|
||||||
|
info = human_readable_text_from_str(buf);
|
||||||
|
monitor_puts(mon, info->human_readable_text);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ struct PnvPHB4 {
|
||||||
QLIST_HEAD(, PnvPhb4DMASpace) dma_spaces;
|
QLIST_HEAD(, PnvPhb4DMASpace) dma_spaces;
|
||||||
};
|
};
|
||||||
|
|
||||||
void pnv_phb4_pic_print_info(PnvPHB4 *phb, Monitor *mon);
|
void pnv_phb4_pic_print_info(PnvPHB4 *phb, GString *buf);
|
||||||
int pnv_phb4_pec_get_phb_id(PnvPhb4PecState *pec, int stack_index);
|
int pnv_phb4_pec_get_phb_id(PnvPhb4PecState *pec, int stack_index);
|
||||||
PnvPhb4PecState *pnv_pec_add_phb(PnvChip *chip, PnvPHB *phb, Error **errp);
|
PnvPhb4PecState *pnv_pec_add_phb(PnvChip *chip, PnvPHB *phb, Error **errp);
|
||||||
void pnv_phb4_bus_init(DeviceState *dev, PnvPHB4 *phb);
|
void pnv_phb4_bus_init(DeviceState *dev, PnvPHB4 *phb);
|
||||||
|
|
Loading…
Reference in New Issue