[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 56/61] hw/riscv: Let devices own the MemoryRegion they create
From: |
Paolo Bonzini |
Subject: |
[PULL 56/61] hw/riscv: Let devices own the MemoryRegion they create |
Date: |
Mon, 16 Mar 2020 22:27:23 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
Avoid orphan memory regions being added in the /unattached QOM
container.
This commit was produced with the Coccinelle script
scripts/coccinelle/memory-region-housekeeping.cocci.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/riscv/sifive_e.c | 6 +++---
hw/riscv/sifive_u.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c
index a1974ef..646553a 100644
--- a/hw/riscv/sifive_e.c
+++ b/hw/riscv/sifive_e.c
@@ -145,8 +145,8 @@ static void riscv_sifive_e_soc_realize(DeviceState *dev,
Error **errp)
&error_abort);
/* Mask ROM */
- memory_region_init_rom(&s->mask_rom, NULL, "riscv.sifive.e.mrom",
- memmap[SIFIVE_E_MROM].size, &error_fatal);
+ memory_region_init_rom(&s->mask_rom, OBJECT(dev), "riscv.sifive.e.mrom",
+ memmap[SIFIVE_E_MROM].size, &error_fatal);
memory_region_add_subregion(sys_mem,
memmap[SIFIVE_E_MROM].base, &s->mask_rom);
@@ -208,7 +208,7 @@ static void riscv_sifive_e_soc_realize(DeviceState *dev,
Error **errp)
memmap[SIFIVE_E_PWM2].base, memmap[SIFIVE_E_PWM2].size);
/* Flash memory */
- memory_region_init_rom(&s->xip_mem, NULL, "riscv.sifive.e.xip",
+ memory_region_init_rom(&s->xip_mem, OBJECT(dev), "riscv.sifive.e.xip",
memmap[SIFIVE_E_XIP].size, &error_fatal);
memory_region_add_subregion(sys_mem, memmap[SIFIVE_E_XIP].base,
&s->xip_mem);
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 156a003..662d42a 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -497,7 +497,7 @@ static void riscv_sifive_u_soc_realize(DeviceState *dev,
Error **errp)
&error_abort);
/* boot rom */
- memory_region_init_rom(mask_rom, NULL, "riscv.sifive.u.mrom",
+ memory_region_init_rom(mask_rom, OBJECT(dev), "riscv.sifive.u.mrom",
memmap[SIFIVE_U_MROM].size, &error_fatal);
memory_region_add_subregion(system_memory, memmap[SIFIVE_U_MROM].base,
mask_rom);
--
1.8.3.1
- [PULL 43/61] hw/m68k: Use memory_region_init_rom() with read-only regions, (continued)
- [PULL 43/61] hw/m68k: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/03/16
- [PULL 48/61] hw/sh4: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/03/16
- [PULL 50/61] scripts/cocci: Patch to detect potential use of memory_region_init_rom, Paolo Bonzini, 2020/03/16
- [PULL 47/61] hw/riscv: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/03/16
- [PULL 49/61] hw/sparc: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/03/16
- [PULL 51/61] scripts/cocci: Patch to remove unnecessary memory_region_set_readonly(), Paolo Bonzini, 2020/03/16
- [PULL 52/61] scripts/cocci: Patch to let devices own their MemoryRegions, Paolo Bonzini, 2020/03/16
- [PULL 53/61] hw/core: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/03/16
- [PULL 54/61] hw/display: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/03/16
- [PULL 55/61] hw/dma: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/03/16
- [PULL 56/61] hw/riscv: Let devices own the MemoryRegion they create,
Paolo Bonzini <=
- [PULL 57/61] hw/char: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/03/16
- [PULL 60/61] hw/arm: Remove unnecessary memory_region_set_readonly() on ROM alias, Paolo Bonzini, 2020/03/16
- [PULL 58/61] hw/arm/stm32: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/03/16
- [PULL 59/61] hw/ppc/ppc405: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/03/16
- [PULL 61/61] hw/arm: Let devices own the MemoryRegion they create, Paolo Bonzini, 2020/03/16
- Re: [PULL 00/61] Misc patches for soft freeze, no-reply, 2020/03/16
- Re: [PULL 00/61] Misc patches for soft freeze, no-reply, 2020/03/16