arm: do not use ram_size global

Use the machine properties instead.

Cc: qemu-ppc@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
master
Paolo Bonzini 2020-10-28 06:18:20 -04:00
parent d619f157a5
commit 6e504a989d
3 changed files with 9 additions and 7 deletions

View File

@ -309,7 +309,7 @@ static void aspeed_machine_init(MachineState *machine)
/* /*
* This will error out if isize is not supported by memory controller. * This will error out if isize is not supported by memory controller.
*/ */
object_property_set_uint(OBJECT(&bmc->soc), "ram-size", ram_size, object_property_set_uint(OBJECT(&bmc->soc), "ram-size", machine->ram_size,
&error_fatal); &error_fatal);
for (i = 0; i < sc->macs_num; i++) { for (i = 0; i < sc->macs_num; i++) {
@ -346,8 +346,8 @@ static void aspeed_machine_init(MachineState *machine)
max_ram_size = object_property_get_uint(OBJECT(&bmc->soc), "max-ram-size", max_ram_size = object_property_get_uint(OBJECT(&bmc->soc), "max-ram-size",
&error_abort); &error_abort);
memory_region_init_io(&bmc->max_ram, NULL, &max_ram_ops, NULL, memory_region_init_io(&bmc->max_ram, NULL, &max_ram_ops, NULL,
"max_ram", max_ram_size - ram_size); "max_ram", max_ram_size - machine->ram_size);
memory_region_add_subregion(&bmc->ram_container, ram_size, &bmc->max_ram); memory_region_add_subregion(&bmc->ram_container, machine->ram_size, &bmc->max_ram);
aspeed_board_init_flashes(&bmc->soc.fmc, bmc->fmc_model ? aspeed_board_init_flashes(&bmc->soc.fmc, bmc->fmc_model ?
bmc->fmc_model : amc->fmc_model); bmc->fmc_model : amc->fmc_model);
@ -392,7 +392,7 @@ static void aspeed_machine_init(MachineState *machine)
aspeed_board_binfo.smp_loader_start = AST_SMP_MBOX_CODE; aspeed_board_binfo.smp_loader_start = AST_SMP_MBOX_CODE;
} }
aspeed_board_binfo.ram_size = ram_size; aspeed_board_binfo.ram_size = machine->ram_size;
aspeed_board_binfo.loader_start = sc->memmap[ASPEED_DEV_SDRAM]; aspeed_board_binfo.loader_start = sc->memmap[ASPEED_DEV_SDRAM];
aspeed_board_binfo.nb_cpus = sc->num_cpus; aspeed_board_binfo.nb_cpus = sc->num_cpus;

View File

@ -17,6 +17,7 @@
#include "ui/console.h" #include "ui/console.h"
#include "hw/arm/pxa.h" #include "hw/arm/pxa.h"
#include "ui/pixel_ops.h" #include "ui/pixel_ops.h"
#include "hw/boards.h"
/* FIXME: For graphic_rotate. Should probably be done in common code. */ /* FIXME: For graphic_rotate. Should probably be done in common code. */
#include "sysemu/sysemu.h" #include "sysemu/sysemu.h"
#include "framebuffer.h" #include "framebuffer.h"
@ -305,7 +306,7 @@ static void pxa2xx_descriptor_load(PXA2xxLCDState *s)
descptr = s->dma_ch[i].descriptor; descptr = s->dma_ch[i].descriptor;
if (!((descptr >= PXA2XX_SDRAM_BASE && descptr + if (!((descptr >= PXA2XX_SDRAM_BASE && descptr +
sizeof(desc) <= PXA2XX_SDRAM_BASE + ram_size) || sizeof(desc) <= PXA2XX_SDRAM_BASE + current_machine->ram_size) ||
(descptr >= PXA2XX_INTERNAL_BASE && descptr + sizeof(desc) <= (descptr >= PXA2XX_INTERNAL_BASE && descptr + sizeof(desc) <=
PXA2XX_INTERNAL_BASE + PXA2XX_INTERNAL_SIZE))) { PXA2XX_INTERNAL_BASE + PXA2XX_INTERNAL_SIZE))) {
continue; continue;
@ -850,7 +851,7 @@ static void pxa2xx_update_display(void *opaque)
} }
fbptr = s->dma_ch[ch].source; fbptr = s->dma_ch[ch].source;
if (!((fbptr >= PXA2XX_SDRAM_BASE && if (!((fbptr >= PXA2XX_SDRAM_BASE &&
fbptr <= PXA2XX_SDRAM_BASE + ram_size) || fbptr <= PXA2XX_SDRAM_BASE + current_machine->ram_size) ||
(fbptr >= PXA2XX_INTERNAL_BASE && (fbptr >= PXA2XX_INTERNAL_BASE &&
fbptr <= PXA2XX_INTERNAL_BASE + PXA2XX_INTERNAL_SIZE))) { fbptr <= PXA2XX_INTERNAL_BASE + PXA2XX_INTERNAL_SIZE))) {
pxa2xx_dma_ber_set(s, ch); pxa2xx_dma_ber_set(s, ch);

View File

@ -37,6 +37,7 @@
#include "exec/gdbstub.h" #include "exec/gdbstub.h"
#include "qemu/cutils.h" #include "qemu/cutils.h"
#include "hw/arm/boot.h" #include "hw/arm/boot.h"
#include "hw/boards.h"
#endif #endif
#define TARGET_SYS_OPEN 0x01 #define TARGET_SYS_OPEN 0x01
@ -1048,7 +1049,7 @@ target_ulong do_arm_semihosting(CPUARMState *env)
retvals[2] = ts->stack_base; retvals[2] = ts->stack_base;
retvals[3] = 0; /* Stack limit. */ retvals[3] = 0; /* Stack limit. */
#else #else
limit = ram_size; limit = current_machine->ram_size;
/* TODO: Make this use the limit of the loaded application. */ /* TODO: Make this use the limit of the loaded application. */
retvals[0] = rambase + limit / 2; retvals[0] = rambase + limit / 2;
retvals[1] = rambase + limit; retvals[1] = rambase + limit;