From 48c0b1e45f364e75a450ddd0ebbbf84b28197d6e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 28 Oct 2020 06:14:33 -0400 Subject: sparc64: do not use ram_size global Use the machine properties instead. Cc: Mark Cave-Ayland Signed-off-by: Paolo Bonzini --- hw/sparc64/sparc64.c | 3 ++- hw/sparc64/sun4u.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'hw') diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index 100b2fab17..e3f9219a10 100644 --- a/hw/sparc64/sparc64.c +++ b/hw/sparc64/sparc64.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "cpu.h" +#include "hw/boards.h" #include "hw/char/serial.h" #include "hw/sparc/sparc64.h" #include "qemu/timer.h" @@ -180,7 +181,7 @@ static void main_cpu_reset(void *opaque) cpu_timer_reset(env->hstick); env->gregs[1] = 0; /* Memory start */ - env->gregs[2] = ram_size; /* Memory size */ + env->gregs[2] = current_machine->ram_size; /* Memory size */ env->gregs[3] = 0; /* Machine description XXX */ if (nr_resets++ == 0) { /* Power on reset */ diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 22896b4c62..8bee7dd2f4 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -690,7 +690,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, initrd_addr = 0; kernel_size = sun4u_load_kernel(machine->kernel_filename, machine->initrd_filename, - ram_size, &initrd_size, &initrd_addr, + machine->ram_size, &initrd_size, &initrd_addr, &kernel_addr, &kernel_entry); sun4u_NVRAM_set_params(nvram, NVRAM_SIZE, "Sun4u", machine->ram_size, @@ -713,7 +713,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, fw_cfg = FW_CFG(dev); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)machine->smp.cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)machine->smp.max_cpus); - fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); + fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, hwdef->machine_id); fw_cfg_add_i64(fw_cfg, FW_CFG_KERNEL_ADDR, kernel_entry); fw_cfg_add_i64(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size); -- cgit v1.2.3