[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 47/80] m68k/q800: use memdev for RAM
From: |
Igor Mammedov |
Subject: |
[PATCH v4 47/80] m68k/q800: use memdev for RAM |
Date: |
Fri, 31 Jan 2020 16:09:17 +0100 |
Switch to using generic main RAM allocation. To do this set
MachineClass::default_ram_id to m68k_mac.ram and use
MachineState::ram instead of manually initializing
RAM memory region.
Signed-off-by: Igor Mammedov <address@hidden>
Acked-by: Laurent Vivier <address@hidden>
---
hw/m68k/q800.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index 1e32363..a4c4bc1 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -160,7 +160,6 @@ static void q800_init(MachineState *machine)
ram_addr_t initrd_base;
int32_t initrd_size;
MemoryRegion *rom;
- MemoryRegion *ram;
MemoryRegion *io;
const int io_slice_nb = (IO_SIZE / IO_SLICE) - 1;
int i;
@@ -194,9 +193,7 @@ static void q800_init(MachineState *machine)
qemu_register_reset(main_cpu_reset, cpu);
/* RAM */
- ram = g_malloc(sizeof(*ram));
- memory_region_init_ram(ram, NULL, "m68k_mac.ram", ram_size, &error_abort);
- memory_region_add_subregion(get_system_memory(), 0, ram);
+ memory_region_add_subregion(get_system_memory(), 0, machine->ram);
/*
* Memory from IO_BASE to IO_BASE + IO_SLICE is repeated
@@ -443,6 +440,7 @@ static void q800_machine_class_init(ObjectClass *oc, void
*data)
mc->max_cpus = 1;
mc->is_default = 0;
mc->block_default_type = IF_SCSI;
+ mc->default_ram_id = "m68k_mac.ram";
}
static const TypeInfo q800_machine_typeinfo = {
--
2.7.4
- [PATCH v4 38/80] s390x/s390-virtio-ccw: use memdev for RAM, (continued)
- [PATCH v4 38/80] s390x/s390-virtio-ccw: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 40/80] cris/axis_dev88: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 41/80] hppa: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 42/80] x86/microvm: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 43/80] x86/pc: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 45/80] lm32/milkymist: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 49/80] m68k/next-cube: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 50/80] mips/boston: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 44/80] lm32/lm32_boards: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 46/80] m68k/an5206: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 47/80] m68k/q800: use memdev for RAM,
Igor Mammedov <=
- [PATCH v4 48/80] m68k/mcf5208: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 51/80] mips/mips_fulong2e: drop RAM size fixup, Igor Mammedov, 2020/01/31
- [PATCH v4 55/80] mips/mips_mipssim: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 52/80] mips/mips_fulong2e: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 53/80] mips/mips_jazz: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 58/80] ppc/e500: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 57/80] ppc/e500: drop RAM size fixup, Igor Mammedov, 2020/01/31
- [PATCH v4 56/80] mips/mips_r4k: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 54/80] mips/mips_malta: use memdev for RAM, Igor Mammedov, 2020/01/31
- [PATCH v4 60/80] ppc/mac_oldworld: use memdev for RAM, Igor Mammedov, 2020/01/31