On Thu, Jul 07, 2016 at 04:33:42PM -0700, Andrey Smirnov wrote: > Convert target_memory_rw_debug to use MMUAccessType as to follow similar > conversion of cpu_memory_rw_debug.
Apart from previously mentioned concerns with the confusingly named MMU_* tokens, Reviewed-by: David Gibson <da...@gibson.dropbear.id.au> > > Signed-off-by: Andrey Smirnov <andrew.smir...@gmail.com> > --- > gdbstub.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/gdbstub.c b/gdbstub.c > index 89cb538..a8cff45 100644 > --- a/gdbstub.c > +++ b/gdbstub.c > @@ -44,15 +44,16 @@ > #endif > > static inline int target_memory_rw_debug(CPUState *cpu, target_ulong addr, > - uint8_t *buf, int len, bool > is_write) > + uint8_t *buf, int len, > + MMUAccessType access_type) > { > CPUClass *cc = CPU_GET_CLASS(cpu); > > if (cc->memory_rw_debug) { > + const bool is_write = (access_type == MMU_DATA_STORE); > return cc->memory_rw_debug(cpu, addr, buf, len, is_write); > } > - return cpu_memory_rw_debug(cpu, addr, buf, len, > - is_write ? MMU_DATA_STORE : MMU_DATA_LOAD); > + return cpu_memory_rw_debug(cpu, addr, buf, len, access_type); > } > > enum { > @@ -966,7 +967,8 @@ static int gdb_handle_packet(GDBState *s, const char > *line_buf) > break; > } > > - if (target_memory_rw_debug(s->g_cpu, addr, mem_buf, len, false) != > 0) { > + if (target_memory_rw_debug(s->g_cpu, addr, mem_buf, > + len, MMU_DATA_LOAD) != 0) { > put_packet (s, "E14"); > } else { > memtohex(buf, mem_buf, len); > @@ -988,7 +990,7 @@ static int gdb_handle_packet(GDBState *s, const char > *line_buf) > } > hextomem(mem_buf, p, len); > if (target_memory_rw_debug(s->g_cpu, addr, mem_buf, len, > - true) != 0) { > + MMU_DATA_STORE) != 0) { > put_packet(s, "E14"); > } else { > put_packet(s, "OK"); -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature