Skip to contentSkip to conversation

Abort on attempts to load out-of-range ROMs

PATCH New Ben Leslie 1 participant 1 message May 16, 2011

lore
Share & tools
lore

Ben Leslie

author
#0 lore raw

PATCH 1/1 Abort on attempts to load out-of-range ROMs

Abort on attempts to load out-of-range ROMs

Change ROM loading behaviour so that attempts to load ROMs that fall outside valid memory ranges causing an abort with a useful error message, rather than silently ignoring the problem.

---
 exec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
exec.c +0 -0
index a718d74..af1b6a2 100644
@@ -3838,7 +3838,7 @@ void

cpu_physical_memory_write_rom(target_phys_addr_t addr,

         if ((pd & ~TARGET_PAGE_MASK) != IO_MEM_RAM &&
             (pd & ~TARGET_PAGE_MASK) != IO_MEM_ROM &&
             !(pd & IO_MEM_ROMD)) {
-            /* do nothing */
+           cpu_abort(first_cpu, "Attempting to load malformed ROM at
address: 0x%x\n", addr);
         } else {
             unsigned long addr1;
             addr1 = (pd & TARGET_PAGE_MASK) + (addr & ~TARGET_PAGE_MASK);