Il 09/03/2012 06:01, David Gibson ha scritto:
> +static inline int dma_memory_read(DMAContext *dma, dma_addr_t addr,
> +                                  void *buf, dma_addr_t len)
> +{
> +    return dma_memory_rw(dma, addr, buf, len, DMA_DIRECTION_TO_DEVICE);
> +}
> +
> +static inline int dma_memory_write(DMAContext *dma, dma_addr_t addr,
> +                                   const void *buf, dma_addr_t len)
> +{
> +    return dma_memory_rw(dma, addr, (void *)buf, len,
> +                         DMA_DIRECTION_FROM_DEVICE);
> +}

This is opposite to the convention of dma_buf_read/dma_buf_write, which
is from the point of view of the device.  Either way is okay for me,
including removing dma_buf_read/dma_buf_write altogether and using
dma_buf_rw in the few users (so that there will be an explicit
DMADirection argument that clears all confusion).

Paolo

Reply via email to