diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-10 14:29:45 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-10 14:29:45 +0000 |
commit | 5c130f659b20d53667e07957ebaa3e656f72b276 (patch) | |
tree | 1fce52bae1cfdb3f46599277634769cd50782cb0 /hw/ppc4xx_devs.c | |
parent | d397abbdbe68715ec86b4392e4e6384db64d029d (diff) |
Yet more phys_ram_base elimination.
Signed-off-by: Paul Brook <paul@cofdesourcery.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7067 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/ppc4xx_devs.c')
-rw-r--r-- | hw/ppc4xx_devs.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/hw/ppc4xx_devs.c b/hw/ppc4xx_devs.c index c02cebfb63..ddee8f6338 100644 --- a/hw/ppc4xx_devs.c +++ b/hw/ppc4xx_devs.c @@ -855,7 +855,7 @@ ram_addr_t ppc4xx_sdram_adjust(ram_addr_t ram_size, int nr_banks, target_phys_addr_t ram_sizes[], const unsigned int sdram_bank_sizes[]) { - ram_addr_t ram_end = 0; + ram_addr_t size_left = ram_size; int i; int j; @@ -863,24 +863,24 @@ ram_addr_t ppc4xx_sdram_adjust(ram_addr_t ram_size, int nr_banks, for (j = 0; sdram_bank_sizes[j] != 0; j++) { unsigned int bank_size = sdram_bank_sizes[j]; - if (bank_size <= ram_size) { - ram_bases[i] = ram_end; + if (bank_size <= size_left) { + ram_bases[i] = qemu_ram_alloc(bank_size); ram_sizes[i] = bank_size; - ram_end += bank_size; - ram_size -= bank_size; + size_left -= bank_size; break; } } - if (!ram_size) { + if (!size_left) { /* No need to use the remaining banks. */ break; } } + ram_size -= size_left; if (ram_size) printf("Truncating memory to %d MiB to fit SDRAM controller limits.\n", - (int)(ram_end >> 20)); + (int)(ram_size >> 20)); - return ram_end; + return ram_size; } |