new physical memory access API (used by DMA accesses)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@645 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
b448f2f36c
commit
8b1f24b090
17
cpu-all.h
17
cpu-all.h
|
@ -599,10 +599,21 @@ int cpu_register_io_memory(int io_index,
|
||||||
CPUReadMemoryFunc **mem_read,
|
CPUReadMemoryFunc **mem_read,
|
||||||
CPUWriteMemoryFunc **mem_write);
|
CPUWriteMemoryFunc **mem_write);
|
||||||
|
|
||||||
void cpu_physical_memory_rw(CPUState *env, uint8_t *buf, target_ulong addr,
|
void cpu_physical_memory_rw(target_ulong addr, uint8_t *buf,
|
||||||
int len, int is_write);
|
int len, int is_write);
|
||||||
int cpu_memory_rw_debug(CPUState *env,
|
static inline void cpu_physical_memory_read(target_ulong addr, uint8_t *buf,
|
||||||
uint8_t *buf, target_ulong addr, int len, int is_write);
|
int len)
|
||||||
|
{
|
||||||
|
cpu_physical_memory_rw(addr, buf, len, 0);
|
||||||
|
}
|
||||||
|
static inline void cpu_physical_memory_write(target_ulong addr, const uint8_t *buf,
|
||||||
|
int len)
|
||||||
|
{
|
||||||
|
cpu_physical_memory_rw(addr, (uint8_t *)buf, len, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int cpu_memory_rw_debug(CPUState *env, target_ulong addr,
|
||||||
|
uint8_t *buf, int len, int is_write);
|
||||||
|
|
||||||
/* read dirty bit (return 0 or 1) */
|
/* read dirty bit (return 0 or 1) */
|
||||||
static inline int cpu_physical_memory_is_dirty(target_ulong addr)
|
static inline int cpu_physical_memory_is_dirty(target_ulong addr)
|
||||||
|
|
|
@ -472,7 +472,7 @@ int cpu_gdbstub(void *opaque, int (*main_loop)(void *opaque), int port)
|
||||||
if (*p == ',')
|
if (*p == ',')
|
||||||
p++;
|
p++;
|
||||||
len = strtoul(p, NULL, 16);
|
len = strtoul(p, NULL, 16);
|
||||||
if (cpu_memory_rw_debug(env, mem_buf, addr, len, 0) != 0)
|
if (cpu_memory_rw_debug(env, addr, mem_buf, len, 0) != 0)
|
||||||
memset(mem_buf, 0, len);
|
memset(mem_buf, 0, len);
|
||||||
memtohex(buf, mem_buf, len);
|
memtohex(buf, mem_buf, len);
|
||||||
put_packet(buf);
|
put_packet(buf);
|
||||||
|
@ -486,7 +486,7 @@ int cpu_gdbstub(void *opaque, int (*main_loop)(void *opaque), int port)
|
||||||
if (*p == ',')
|
if (*p == ',')
|
||||||
p++;
|
p++;
|
||||||
hextomem(mem_buf, p, len);
|
hextomem(mem_buf, p, len);
|
||||||
if (cpu_memory_rw_debug(env, mem_buf, addr, len, 1) != 0)
|
if (cpu_memory_rw_debug(env, addr, mem_buf, len, 1) != 0)
|
||||||
put_packet("ENN");
|
put_packet("ENN");
|
||||||
else
|
else
|
||||||
put_packet("OK");
|
put_packet("OK");
|
||||||
|
|
Loading…
Reference in a new issue