From 2321479238686f1bd05565bc070eb637e3a178f8 Mon Sep 17 00:00:00 2001 From: VintagePC <53943260+vintagepc@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:27:59 -0400 Subject: [PATCH] Missed file --- hw/arm/prusa/stm32_common/stm32_common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/arm/prusa/stm32_common/stm32_common.c b/hw/arm/prusa/stm32_common/stm32_common.c index 396ef2cd76..aee1851880 100644 --- a/hw/arm/prusa/stm32_common/stm32_common.c +++ b/hw/arm/prusa/stm32_common/stm32_common.c @@ -326,6 +326,12 @@ extern void stm32_soc_realize_all_peripherals(DeviceState *soc_state,Error **err if (!c->cfg->perhipherals[i].type) break; n_dmas++; } + MemoryRegion* dest_region = get_system_memory(); + + if (s->has_sys_memory) + { + dest_region = &s->sys_memory; + } for (int i=0; icfg->unimplemented[i].type != NULL) @@ -333,7 +339,7 @@ extern void stm32_soc_realize_all_peripherals(DeviceState *soc_state,Error **err const stm32_periph_cfg_t* cfg = &c->cfg->unimplemented[i]; MemoryRegion* mr = g_new0(MemoryRegion, 1); memory_region_init_ram(mr, OBJECT(soc_state), cfg->type, cfg->size, &error_fatal); - memory_region_add_subregion_overlap(&s->sys_memory, cfg->base_addr, mr, -999); + memory_region_add_subregion_overlap(dest_region, cfg->base_addr, mr, -999); continue; } stm32_soc_realize_peripheral(soc_state, i, errp);