]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/riscv/virt: Add memmap pointer to RiscVVirtState
authorSunil V L <sunilvl@ventanamicro.com>
Thu, 2 Mar 2023 09:12:07 +0000 (14:42 +0530)
committerPalmer Dabbelt <palmer@rivosinc.com>
Mon, 6 Mar 2023 19:35:03 +0000 (11:35 -0800)
memmap needs to be exported outside of virt.c so that
modules like acpi can use it. Hence, add a pointer field
in RiscVVirtState structure and initialize it with the
memorymap.

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Bin Meng <bmeng@tinylab.org>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Message-ID: <20230302091212.999767-4-sunilvl@ventanamicro.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
hw/riscv/virt.c
include/hw/riscv/virt.h

index 90579a4c0e77d98bdb37ea83f6715888e5766a09..aed303e1e690841e6c1910ca80aaf7d6dfb44b27 100644 (file)
@@ -1458,6 +1458,8 @@ static void virt_machine_init(MachineState *machine)
             ROUND_UP(virt_high_pcie_memmap.base, virt_high_pcie_memmap.size);
     }
 
+    s->memmap = virt_memmap;
+
     /* register system main memory (actual RAM) */
     memory_region_add_subregion(system_memory, memmap[VIRT_DRAM].base,
         machine->ram);
index 62efebaa3225061abcfc53445051c662d26de0db..379501edcc0d20b9225dc3adb602bb8e249d1207 100644 (file)
@@ -59,6 +59,7 @@ struct RISCVVirtState {
     char *oem_id;
     char *oem_table_id;
     OnOffAuto acpi;
+    const MemMapEntry *memmap;
 };
 
 enum {