[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/6] hw/dma/rc4030: Use DMA address space to do DMA accesses
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 2/6] hw/dma/rc4030: Use DMA address space to do DMA accesses |
Date: |
Sun, 31 May 2020 19:54:21 +0200 |
The DMA device should not use the CPU address space
to do its operation, but its own address space.
Replace cpu_physical_memory_write() by dma_memory_read()
since we already have the DMA address space available.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/dma/rc4030.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c
index eefbabd758..c39fe2bb69 100644
--- a/hw/dma/rc4030.c
+++ b/hw/dma/rc4030.c
@@ -24,6 +24,7 @@
#include "qemu/osdep.h"
#include "qemu/units.h"
+#include "sysemu/dma.h"
#include "hw/irq.h"
#include "hw/mips/mips.h"
#include "hw/sysbus.h"
@@ -301,7 +302,7 @@ static void rc4030_write(void *opaque, hwaddr addr,
uint64_t data,
if (s->cache_ltag == 0x80000001 && s->cache_bmask == 0xf0f0f0f) {
hwaddr dest = s->cache_ptag & ~0x1;
dest += (s->cache_maint & 0x3) << 3;
- cpu_physical_memory_write(dest, &val, 4);
+ dma_memory_read(&s->dma_as, dest, &val, 4);
}
break;
/* Remote Speed Registers */
--
2.21.3
- [PATCH 0/6] exec/memory: Rework some address and access size limits, Philippe Mathieu-Daudé, 2020/05/31
- [PATCH 2/6] hw/dma/rc4030: Use DMA address space to do DMA accesses,
Philippe Mathieu-Daudé <=
- [PATCH 1/6] target/s390x/mmu_helper: Use address_space_rw() in place, Philippe Mathieu-Daudé, 2020/05/31
- [PATCH 3/6] hw/sd/allwinner-sdhost: Do DMA accesses via DMA address space, Philippe Mathieu-Daudé, 2020/05/31
- [PATCH 4/6] exec/cpu-common: Do not restrict CPU to 32-bit memory access maximum, Philippe Mathieu-Daudé, 2020/05/31
- [PATCH 5/6] exec: Restrict 32-bit CPUs to 32-bit address space, Philippe Mathieu-Daudé, 2020/05/31
- [RFC PATCH 6/6] memory: Use CPU register size as default access_size_max, Philippe Mathieu-Daudé, 2020/05/31
- Re: [PATCH 0/6] exec/memory: Rework some address and access size limits, no-reply, 2020/05/31