mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
dma: Define dma_context_memory and use in sysbus-ohci
Define a new global dma_context_memory which is a DMAContext corresponding to the global address_space_memory AddressSpace. This can be used by sysbus peripherals like sysbus-ohci which need to do DMA. In particular, use it in the sysbus-ohci device, which fixes a segfault when attempting to use that device. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
This commit is contained in:
parent
4003e24fce
commit
9e11908f12
3 changed files with 11 additions and 1 deletions
5
exec.c
5
exec.c
|
@ -34,6 +34,7 @@
|
|||
#include "hw/xen.h"
|
||||
#include "qemu-timer.h"
|
||||
#include "memory.h"
|
||||
#include "dma.h"
|
||||
#include "exec-memory.h"
|
||||
#if defined(CONFIG_USER_ONLY)
|
||||
#include <qemu.h>
|
||||
|
@ -103,6 +104,7 @@ static MemoryRegion *system_io;
|
|||
|
||||
AddressSpace address_space_io;
|
||||
AddressSpace address_space_memory;
|
||||
DMAContext dma_context_memory;
|
||||
|
||||
MemoryRegion io_mem_ram, io_mem_rom, io_mem_unassigned, io_mem_notdirty;
|
||||
static MemoryRegion io_mem_subpage_ram;
|
||||
|
@ -3294,6 +3296,9 @@ static void memory_map_init(void)
|
|||
memory_listener_register(&core_memory_listener, &address_space_memory);
|
||||
memory_listener_register(&io_memory_listener, &address_space_io);
|
||||
memory_listener_register(&tcg_memory_listener, &address_space_memory);
|
||||
|
||||
dma_context_init(&dma_context_memory, &address_space_memory,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
MemoryRegion *get_system_memory(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue