[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 04/16] hw/mips: set machine->fdt in boston_mach_init()
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH v8 04/16] hw/mips: set machine->fdt in boston_mach_init() |
Date: |
Mon, 26 Sep 2022 14:38:43 -0300 |
This will enable support for the 'dumpdtb' QMP/HMP command for the
boston machine.
'dtb_load_data' can't be autofreed anymore, otherwise we'll free the fdt
that is now being referenced by machine->fdt.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
hw/mips/boston.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/mips/boston.c b/hw/mips/boston.c
index d2ab9da1a0..65d38cbd71 100644
--- a/hw/mips/boston.c
+++ b/hw/mips/boston.c
@@ -793,7 +793,7 @@ static void boston_mach_init(MachineState *machine)
if (kernel_size > 0) {
int dt_size;
g_autofree const void *dtb_file_data = NULL;
- g_autofree const void *dtb_load_data = NULL;
+ const void *dtb_load_data = NULL;
hwaddr dtb_paddr = QEMU_ALIGN_UP(kernel_high, 64 * KiB);
hwaddr dtb_vaddr = cpu_mips_phys_to_kseg0(NULL, dtb_paddr);
@@ -810,6 +810,9 @@ static void boston_mach_init(MachineState *machine)
/* Calculate real fdt size after filter */
dt_size = fdt_totalsize(dtb_load_data);
rom_add_blob_fixed("dtb", dtb_load_data, dt_size, dtb_paddr);
+
+ /* Set machine->fdt for 'dumpdtb' QMP/HMP command */
+ machine->fdt = (void *)dtb_load_data;
} else {
/* Try to load file as FIT */
fit_err = load_fit(&boston_fit_loader, machine->kernel_filename,
s);
--
2.37.3
- [PATCH v8 05/16] hw/microblaze: set machine->fdt in microblaze_load_dtb(), (continued)
- [PATCH v8 05/16] hw/microblaze: set machine->fdt in microblaze_load_dtb(), Daniel Henrique Barboza, 2022/09/26
- [PATCH v8 08/16] hw/ppc: set machine->fdt in bamboo_load_device_tree(), Daniel Henrique Barboza, 2022/09/26
- [PATCH v8 12/16] hw/ppc: set machine->fdt in pnv_reset(), Daniel Henrique Barboza, 2022/09/26
- [PATCH v8 16/16] hw/xtensa: set machine->fdt in xtfpga_init(), Daniel Henrique Barboza, 2022/09/26
- [PATCH v8 10/16] hw/ppc: set machine->fdt in xilinx_load_device_tree(), Daniel Henrique Barboza, 2022/09/26
- [PATCH v8 11/16] hw/ppc: set machine->fdt in pegasos2_machine_reset(), Daniel Henrique Barboza, 2022/09/26
- [PATCH v8 15/16] hw/riscv: set machine->fdt in spike_board_init(), Daniel Henrique Barboza, 2022/09/26
- [PATCH v8 03/16] hw/arm: do not free machine->fdt in arm_load_dtb(), Daniel Henrique Barboza, 2022/09/26
- [PATCH v8 13/16] hw/ppc: set machine->fdt in spapr machine, Daniel Henrique Barboza, 2022/09/26
- [PATCH v8 09/16] hw/ppc: set machine->fdt in sam460ex_load_device_tree(), Daniel Henrique Barboza, 2022/09/26
- [PATCH v8 04/16] hw/mips: set machine->fdt in boston_mach_init(),
Daniel Henrique Barboza <=
- [PATCH v8 07/16] hw/ppc: set machine->fdt in ppce500_load_device_tree(), Daniel Henrique Barboza, 2022/09/26
- [PATCH v8 14/16] hw/riscv: set machine->fdt in sifive_u_machine_init(), Daniel Henrique Barboza, 2022/09/26