[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 08/79] alpha/dp264: use memdev for RAM
From: |
Igor Mammedov |
Subject: |
[PATCH v6 08/79] alpha/dp264: use memdev for RAM |
Date: |
Wed, 19 Feb 2020 11:08:42 -0500 |
memory_region_allocate_system_memory() API is going away, so
replace it with memdev allocated MemoryRegion. The later is
initialized by generic code, so board only needs to opt in
to memdev scheme by providing
MachineClass::default_ram_id
and using MachineState::ram instead of manually initializing
RAM memory region.
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
Acked-by: Richard Henderson <address@hidden>
---
hw/alpha/alpha_sys.h | 2 +-
hw/alpha/dp264.c | 3 ++-
hw/alpha/typhoon.c | 8 ++------
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h
index 95033d7f0b..bc0a286226 100644
--- a/hw/alpha/alpha_sys.h
+++ b/hw/alpha/alpha_sys.h
@@ -11,7 +11,7 @@
#include "hw/intc/i8259.h"
-PCIBus *typhoon_init(ram_addr_t, ISABus **, qemu_irq *, AlphaCPU *[4],
+PCIBus *typhoon_init(MemoryRegion *, ISABus **, qemu_irq *, AlphaCPU *[4],
pci_map_irq_fn);
/* alpha_pci.c. */
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index a8f9a89cc4..8d71a30617 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -75,7 +75,7 @@ static void clipper_init(MachineState *machine)
cpus[0]->env.trap_arg2 = smp_cpus;
/* Init the chipset. */
- pci_bus = typhoon_init(ram_size, &isa_bus, &rtc_irq, cpus,
+ pci_bus = typhoon_init(machine->ram, &isa_bus, &rtc_irq, cpus,
clipper_pci_map_irq);
/* Since we have an SRM-compatible PALcode, use the SRM epoch. */
@@ -183,6 +183,7 @@ static void clipper_machine_init(MachineClass *mc)
mc->max_cpus = 4;
mc->is_default = 1;
mc->default_cpu_type = ALPHA_CPU_TYPE_NAME("ev67");
+ mc->default_ram_id = "ram";
}
DEFINE_MACHINE("clipper", clipper_machine_init)
diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c
index 179e1f7658..1795e2f29d 100644
--- a/hw/alpha/typhoon.c
+++ b/hw/alpha/typhoon.c
@@ -58,7 +58,6 @@ typedef struct TyphoonState {
TyphoonCchip cchip;
TyphoonPchip pchip;
MemoryRegion dchip_region;
- MemoryRegion ram_region;
} TyphoonState;
/* Called when one of DRIR or DIM changes. */
@@ -817,8 +816,7 @@ static void typhoon_alarm_timer(void *opaque)
cpu_interrupt(CPU(s->cchip.cpu[cpu]), CPU_INTERRUPT_TIMER);
}
-PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus,
- qemu_irq *p_rtc_irq,
+PCIBus *typhoon_init(MemoryRegion *ram, ISABus **isa_bus, qemu_irq *p_rtc_irq,
AlphaCPU *cpus[4], pci_map_irq_fn sys_map_irq)
{
MemoryRegion *addr_space = get_system_memory();
@@ -851,9 +849,7 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus,
/* Main memory region, 0x00.0000.0000. Real hardware supports 32GB,
but the address space hole reserved at this point is 8TB. */
- memory_region_allocate_system_memory(&s->ram_region, OBJECT(s), "ram",
- ram_size);
- memory_region_add_subregion(addr_space, 0, &s->ram_region);
+ memory_region_add_subregion(addr_space, 0, ram);
/* TIGbus, 0x801.0000.0000, 1GB. */
/* ??? The TIGbus is used for delivering interrupts, and access to
--
2.18.1
- [PATCH v6 00/79] refactor main RAM allocation to use hostmem backend, Igor Mammedov, 2020/02/19
- [PATCH v6 01/79] numa: remove deprecated -mem-path fallback to anonymous RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 02/79] machine: introduce memory-backend property, Igor Mammedov, 2020/02/19
- [PATCH v6 06/79] vl.c: move -m parsing after memory backends has been processed, Igor Mammedov, 2020/02/19
- [PATCH v6 05/79] initialize MachineState::ram in NUMA case, Igor Mammedov, 2020/02/19
- [PATCH v6 08/79] alpha/dp264: use memdev for RAM,
Igor Mammedov <=
- [PATCH v6 03/79] machine: alias -mem-path and -mem-prealloc into memory-foo backend, Igor Mammedov, 2020/02/19
- [PATCH v6 04/79] machine: introduce convenience MachineState::ram, Igor Mammedov, 2020/02/19
- [PATCH v6 10/79] arm/aspeed: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 07/79] vl.c: ensure that ram_size matches size of machine.memory-backend, Igor Mammedov, 2020/02/19
- [PATCH v6 09/79] arm/aspeed: actually check RAM size, Igor Mammedov, 2020/02/19
- [PATCH v6 12/79] arm/cubieboard: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 13/79] arm/digic_boards: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 14/79] arm/highbank: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 16/79] arm/imx25_pdk: use memdev for RAM, Igor Mammedov, 2020/02/19
- [PATCH v6 19/79] arm/kzm: use memdev for RAM, Igor Mammedov, 2020/02/19