On 28/06/2016 23:44, Andrey Smirnov wrote: > Add code to support writing to memory mapped peripherals via > cpu_memory_rw_debug(). The code of that function already supports > reading from such memory regions, so this commit makes that > functionality "symmetric".
It's not entirely symmetric however, as you cannot write to the MMIO registers of romd devices. Is this correct? So I'll leave to others the review of whether the functionality is appropriate. Regarding the code: > @@ -2621,7 +2625,7 @@ static MemTxResult > address_space_write_continue(AddressSpace *as, hwaddr addr, > } > > MemTxResult address_space_write(AddressSpace *as, hwaddr addr, MemTxAttrs > attrs, > - const uint8_t *buf, int len) > + const uint8_t *buf, int len, bool force) I would prefer to leave this API as is, and instead add a new API such as address_space_write_debug or address_space_program. It's okay to add the "force" argument to address_space_write_continue. > > +typedef enum { > + MEMTX_READ, > + MEMTX_WRITE, > + MEMTX_PROGRAM, > +} MemTxType; This needs comments. If you go with address_space_write_debug, rename MEMTX_PROGRAM to MEMTX_WRITE_DEBUG. Thanks, Paolo