X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=exec.c;h=5e94a8feea305818be71ea78a5e80bb567faef94;hb=5e2972fdab75341357d7fd23859b887491c932a9;hp=86ab7de87bcff5537b37af7a2b142703261940cf;hpb=26b258e13860a885b337cf7564162b93894863e4;p=qemu diff --git a/exec.c b/exec.c index 86ab7de..5e94a8f 100644 --- a/exec.c +++ b/exec.c @@ -3448,7 +3448,7 @@ void stq_phys(target_phys_addr_t addr, uint64_t val) #endif -/* virtual memory access for debug */ +/* virtual memory access for debug (includes writing to ROM) */ int cpu_memory_rw_debug(CPUState *env, target_ulong addr, uint8_t *buf, int len, int is_write) { @@ -3465,8 +3465,13 @@ int cpu_memory_rw_debug(CPUState *env, target_ulong addr, l = (page + TARGET_PAGE_SIZE) - addr; if (l > len) l = len; - cpu_physical_memory_rw(phys_addr + (addr & ~TARGET_PAGE_MASK), - buf, l, is_write); + phys_addr += (addr & ~TARGET_PAGE_MASK); +#if !defined(CONFIG_USER_ONLY) + if (is_write) + cpu_physical_memory_write_rom(phys_addr, buf, l); + else +#endif + cpu_physical_memory_rw(phys_addr, buf, l, is_write); len -= l; buf += l; addr += l;