mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
hw/sysbus: Inline and remove sysbus_add_io()
sysbus_add_io(...) is a simple wrapper to memory_region_add_subregion(get_system_io(), ...). It is used in 3 places; inline it directly. Rationale: we want to move to an explicit I/O bus, rather that an implicit one. Besides in heterogeneous setup we can have more than one I/O bus. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20240216150441.45681-1-philmd@linaro.org> [PMD: Include missing "exec/address-spaces.h" header] Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
40f27a785f
commit
0068b069c3
5 changed files with 8 additions and 12 deletions
|
@ -27,6 +27,7 @@
|
|||
#include "sysemu/sysemu.h"
|
||||
#include "sysemu/dma.h"
|
||||
#include "sysemu/reset.h"
|
||||
#include "exec/address-spaces.h"
|
||||
#include "hw/boards.h"
|
||||
#include "hw/nvram/fw_cfg.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
|
@ -1142,6 +1143,7 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
|
|||
SysBusDevice *sbd;
|
||||
FWCfgIoState *ios;
|
||||
FWCfgState *s;
|
||||
MemoryRegion *iomem = get_system_io();
|
||||
bool dma_requested = dma_iobase && dma_as;
|
||||
|
||||
dev = qdev_new(TYPE_FW_CFG_IO);
|
||||
|
@ -1155,7 +1157,7 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
|
|||
sbd = SYS_BUS_DEVICE(dev);
|
||||
sysbus_realize_and_unref(sbd, &error_fatal);
|
||||
ios = FW_CFG_IO(dev);
|
||||
sysbus_add_io(sbd, iobase, &ios->comb_iomem);
|
||||
memory_region_add_subregion(iomem, iobase, &ios->comb_iomem);
|
||||
|
||||
s = FW_CFG(dev);
|
||||
|
||||
|
@ -1163,7 +1165,7 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
|
|||
/* 64 bits for the address field */
|
||||
s->dma_as = dma_as;
|
||||
s->dma_addr = 0;
|
||||
sysbus_add_io(sbd, dma_iobase, &s->dma_iomem);
|
||||
memory_region_add_subregion(iomem, dma_iobase, &s->dma_iomem);
|
||||
}
|
||||
|
||||
return s;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue