[Top][All Lists]
[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: |
David Gibson |
Subject: |
Re: [Qemu-devel] [PATCH 05/13] iommu: Add universal DMA helper functions |
Date: |
Fri, 9 Mar 2012 22:19:14 +1100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, Mar 09, 2012 at 11:06:41AM +0100, Paolo Bonzini wrote:
> 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.
Uh, these are from the point of view of the device - the device writes
to memory == transfer from device. More importantly, this is the same
convention as cpu_physical_memory_{read,write}() which is what these
generally replace. dma_buf_read() is from the point of view of the
core/memory.
--
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
- [Qemu-devel] [0/13] Implement support for guest visible IOMMUs, David Gibson, 2012/03/09
- [Qemu-devel] [PATCH 04/13] Implement cpu_physical_memory_zero(), David Gibson, 2012/03/09
- [Qemu-devel] [PATCH 12/13] iommu: Allow PCI to use IOMMU infrastructure, David Gibson, 2012/03/09
- [Qemu-devel] [PATCH 07/13] iommu: Make sglists and dma_bdrv helpers use new universal DMA helpers, David Gibson, 2012/03/09
- Re: [Qemu-devel] [PATCH 07/13] iommu: Make sglists and dma_bdrv helpers use new universal DMA helpers, Paolo Bonzini, 2012/03/09
[Qemu-devel] [PATCH 01/13] Use DMADirection type for dma_bdrv_io, David Gibson, 2012/03/09