qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 05/13] iommu: Add universal DMA helper functions


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 05/13] iommu: Add universal DMA helper functions
Date: Fri, 09 Mar 2012 11:06:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

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

[Prev in Thread] Current Thread [Next in Thread]