diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-24 15:07:25 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-24 15:07:25 +0000 |
commit | 0ccff151b42a5b684ce22473b68972a94bc708fb (patch) | |
tree | 850ffa2363ba6fd7d1e53bdb9c5881654896c00e /hw/mips_r4k.c | |
parent | fc2e7aa3f17e1230f57eec6a0f54091262d08e48 (diff) |
mips: limit RAM size to 256MB on malta and qemu boards
This avoid crash when a bigger RAM size is requested (the devices are
mapped at 0x01000000).
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6419 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/mips_r4k.c')
-rw-r--r-- | hw/mips_r4k.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c index 34b3853295..1ed123e4e7 100644 --- a/hw/mips_r4k.c +++ b/hw/mips_r4k.c @@ -178,6 +178,12 @@ void mips_r4k_init (ram_addr_t ram_size, int vga_ram_size, qemu_register_reset(main_cpu_reset, env); /* allocate RAM */ + if (ram_size > (256 << 20)) { + fprintf(stderr, + "qemu: Too much memory for this machine: %d MB, maximum 256 MB\n", + ((unsigned int)ram_size / (1 << 20))); + exit(1); + } cpu_register_physical_memory(0, ram_size, IO_MEM_RAM); if (!mips_qemu_iomemtype) { |