diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-05-23 14:54:05 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-05-25 19:04:11 +0200 |
commit | cbe0ed6247a0589e4f72b25984b8afcfa9c26b1c (patch) | |
tree | a88e070cee3cc9ca866178ecf41bcedc6591a579 /hw/ide/core.c | |
parent | 20018e12cfde4847a0e90f0f9942804c20c14894 (diff) |
dma-helpers: change interface to byte-based
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide/core.c')
-rw-r--r-- | hw/ide/core.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c index fe2bfba489..7326189d17 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -799,6 +799,7 @@ static void ide_dma_cb(void *opaque, int ret) IDEState *s = opaque; int n; int64_t sector_num; + uint64_t offset; bool stay_active = false; if (ret == -ECANCELED) { @@ -859,17 +860,18 @@ static void ide_dma_cb(void *opaque, int ret) return; } + offset = sector_num << BDRV_SECTOR_BITS; switch (s->dma_cmd) { case IDE_DMA_READ: - s->bus->dma->aiocb = dma_blk_read(s->blk, &s->sg, sector_num, + s->bus->dma->aiocb = dma_blk_read(s->blk, &s->sg, offset, ide_dma_cb, s); break; case IDE_DMA_WRITE: - s->bus->dma->aiocb = dma_blk_write(s->blk, &s->sg, sector_num, + s->bus->dma->aiocb = dma_blk_write(s->blk, &s->sg, offset, ide_dma_cb, s); break; case IDE_DMA_TRIM: - s->bus->dma->aiocb = dma_blk_io(s->blk, &s->sg, sector_num, + s->bus->dma->aiocb = dma_blk_io(s->blk, &s->sg, offset, ide_issue_trim, ide_dma_cb, s, DMA_DIRECTION_TO_DEVICE); break; |