From bfa30f3903e0542611196b21f5832a4be5775a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@redhat.com> Date: Fri, 31 Dec 2021 11:33:29 +0100 Subject: hw/dma: Use dma_addr_t type definition when relevant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the obvious places where dma_addr_t should be used (instead of uint64_t, hwaddr, size_t, int32_t types). This allows to have &dma_addr_t type portable on 32/64-bit hosts. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220111184309.28637-11-f4bug@amsat.org> --- include/sysemu/dma.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include/sysemu') diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index c992d9d5d6..36039c5e68 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -38,7 +38,7 @@ struct QEMUSGList { ScatterGatherEntry *sg; int nsg; int nalloc; - size_t size; + dma_addr_t size; DeviceState *dev; AddressSpace *as; }; @@ -301,8 +301,10 @@ BlockAIOCB *dma_blk_read(BlockBackend *blk, BlockAIOCB *dma_blk_write(BlockBackend *blk, QEMUSGList *sg, uint64_t offset, uint32_t align, BlockCompletionFunc *cb, void *opaque); -uint64_t dma_buf_read(void *ptr, int32_t len, QEMUSGList *sg, MemTxAttrs attrs); -uint64_t dma_buf_write(void *ptr, int32_t len, QEMUSGList *sg, MemTxAttrs attrs); +dma_addr_t dma_buf_read(void *ptr, dma_addr_t len, + QEMUSGList *sg, MemTxAttrs attrs); +dma_addr_t dma_buf_write(void *ptr, dma_addr_t len, + QEMUSGList *sg, MemTxAttrs attrs); void dma_acct_start(BlockBackend *blk, BlockAcctCookie *cookie, QEMUSGList *sg, enum BlockAcctType type); -- cgit v1.2.3