summaryrefslogtreecommitdiffstats
path: root/dma.h
Commit message (Collapse)AuthorAgeFilesLines
* Use dma_addr_t type for scatter/gather codeDavid Gibson2011-11-011-5/+4
| | | | | | | | | | | | | This patch uses the newly created dma_addr_t type throughout the scatter/gather handling code in dma-helpers.c whenever we need to represent a dma bus address. This makes a better distinction as to what is a bus address and what is a cpu physical address. Since we don't support IOMMUs yet, they can't be very different for now, but that will change in future, and this preliminary helps clarify what's going on. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Define DMA address and direction typesDavid Gibson2011-11-011-0/+9
| | | | | | | | | | | | | | | | As a preliminary to adding more extensive DMA and IOMMU infrastructure support into qemu, this patch defines a dma_addr_t for storing DMA bus addresses and a DMADirection enum which describes whether a DMA is from an external device to main memory or from main memory to an external device. For now dma_addr_t is just defined to be target_phys_addr_t, but in future, we can change this to support machines where we have bus addresses which don't necessarily have the same format as CPU physical addresses. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* dma-helpers: allow including from target-independent codePaolo Bonzini2011-09-201-2/+6
| | | | | | | | Target-independent code cannot construct sglists, but it can take them from the outside as a black box. Allow this. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* dma-helpers: rename is_write to to_devPaolo Bonzini2011-09-191-1/+1
| | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* move QEMUSGList typedefGerd Hoffmann2011-08-041-2/+2
| | | | | | | Move the QEMUSGList typedef to qemu-common so it can easily be used. The actual struct definition stays in dma.h. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* make dma_bdrv_io available to driversChristoph Hellwig2011-06-151-0/+8
| | | | | | | | | | Make dma_bdrv_io available for drivers, and pass an explicit I/O function instead of hardcoding bdrv_aio_readv/bdrv_aio_writev. This is required to implement non-READ/WRITE dma commands in the ide driver, e.g. the upcoming TRIM support. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Revert "Get rid of _t suffix"Anthony Liguori2009-10-011-5/+5
| | | | | | | | | | | | In the very least, a change like this requires discussion on the list. The naming convention is goofy and it causes a massive merge problem. Something like this _must_ be presented on the list first so people can provide input and cope with it. This reverts commit 99a0949b720a0936da2052cb9a46db04ffc6db29. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Get rid of _t suffixmalc2009-10-011-5/+5
| | | | | | | Some not so obvious bits, slirp and Xen were left alone for the time being. Signed-off-by: malc <av1474@comtv.ru>
* fully split aio_pool from BlockDriverChristoph Hellwig2009-05-271-2/+0
| | | | | | | | | | | | | | Now that we have a separate aio pool structure we can remove those aio pool details from BlockDriver. Every driver supporting AIO now needs to declare a static AIOPool with the aiocb size and the cancellation method. This cleans up the current code considerably and will make it cleaner and more obvious to support two different aio implementations behind a single BlockDriver. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Hardware convenience libraryPaul Brook2009-05-191-1/+2
| | | | | | | | | | | | | | The only target dependency for most hardware is sizeof(target_phys_addr_t). Build these files into a convenience library, and use that instead of building for every target. Remove and poison various target specific macros to avoid bogus target dependencies creeping back in. Big/Little endian is not handled because devices should not know or care about this to start with. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Implement cancellation method for dma async I/O (Avi Kivity)aliguori2009-03-201-0/+1
| | | | | | | | | | | | Move the dma helpers to a private aio pool, and implement a cancellation method for them. Should prevent issues when cancelling I/O while dma is in progress. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6872 c046a42c-6fe2-441c-8c8c-71466251a162
* Introduce block dma helpers (Avi Kivity)aliguori2009-02-051-0/+8
| | | | | | | | | | | | These helpers perform read/write requests on entire scatter/gather lists, relieving the device emulation code from mapping and unmapping physical memory, and from looping when map resources are exhausted. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6524 c046a42c-6fe2-441c-8c8c-71466251a162
* Add a scatter-gather list type and accessors (Avi Kivity)aliguori2009-02-051-0/+33
Scatter-gather lists are used extensively in dma-capable devices; a single data structure allows more code reuse later on. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6522 c046a42c-6fe2-441c-8c8c-71466251a162
OpenPOWER on IntegriCloud