[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 25/37] dp8393x: replace PROP_PTR with PROP_LINK
From: |
Marc-André Lureau |
Subject: |
[PULL 25/37] dp8393x: replace PROP_PTR with PROP_LINK |
Date: |
Tue, 7 Jan 2020 19:04:30 +0400 |
Link property is the correct way to pass a MemoryRegion to a device
for DMA purposes.
Sidenote: as a sysbus device, this remains non-usercreatable
even though we can drop the specific flag here.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
---
hw/m68k/q800.c | 3 ++-
hw/mips/mips_jazz.c | 3 ++-
hw/net/dp8393x.c | 7 +++----
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index 4ca8678007..8f3eb6bfe7 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -239,7 +239,8 @@ static void q800_init(MachineState *machine)
qdev_set_nic_properties(dev, &nd_table[0]);
qdev_prop_set_uint8(dev, "it_shift", 2);
qdev_prop_set_bit(dev, "big_endian", true);
- qdev_prop_set_ptr(dev, "dma_mr", get_system_memory());
+ object_property_set_link(OBJECT(dev), OBJECT(get_system_memory()),
+ "dma_mr", &error_abort);
qdev_init_nofail(dev);
sysbus = SYS_BUS_DEVICE(dev);
sysbus_mmio_map(sysbus, 0, SONIC_BASE);
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index 291fd6c1b8..66fd4d867d 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -290,7 +290,8 @@ static void mips_jazz_init(MachineState *machine,
dev = qdev_create(NULL, "dp8393x");
qdev_set_nic_properties(dev, nd);
qdev_prop_set_uint8(dev, "it_shift", 2);
- qdev_prop_set_ptr(dev, "dma_mr", rc4030_dma_mr);
+ object_property_set_link(OBJECT(dev), OBJECT(rc4030_dma_mr),
+ "dma_mr", &error_abort);
qdev_init_nofail(dev);
sysbus = SYS_BUS_DEVICE(dev);
sysbus_mmio_map(sysbus, 0, 0x80001000);
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
index 3d991af163..cdc2631c0c 100644
--- a/hw/net/dp8393x.c
+++ b/hw/net/dp8393x.c
@@ -175,7 +175,7 @@ typedef struct dp8393xState {
int loopback_packet;
/* Memory access */
- void *dma_mr;
+ MemoryRegion *dma_mr;
AddressSpace as;
} dp8393xState;
@@ -948,7 +948,8 @@ static const VMStateDescription vmstate_dp8393x = {
static Property dp8393x_properties[] = {
DEFINE_NIC_PROPERTIES(dp8393xState, conf),
- DEFINE_PROP_PTR("dma_mr", dp8393xState, dma_mr),
+ DEFINE_PROP_LINK("dma_mr", dp8393xState, dma_mr,
+ TYPE_MEMORY_REGION, MemoryRegion *),
DEFINE_PROP_UINT8("it_shift", dp8393xState, it_shift, 0),
DEFINE_PROP_BOOL("big_endian", dp8393xState, big_endian, false),
DEFINE_PROP_END_OF_LIST(),
@@ -963,8 +964,6 @@ static void dp8393x_class_init(ObjectClass *klass, void
*data)
dc->reset = dp8393x_reset;
dc->vmsd = &vmstate_dp8393x;
dc->props = dp8393x_properties;
- /* Reason: dma_mr property can't be set */
- dc->user_creatable = false;
}
static const TypeInfo dp8393x_info = {
--
2.25.0.rc1.20.g2443f3f80d
- [PULL 15/37] serial-mm: use sysbus facilities, (continued)
- [PULL 15/37] serial-mm: use sysbus facilities, Marc-André Lureau, 2020/01/07
- [PULL 17/37] mips: inline serial_init(), Marc-André Lureau, 2020/01/07
- [PULL 16/37] serial: make SerialIO a sysbus device, Marc-André Lureau, 2020/01/07
- [PULL 18/37] mips: baudbase is 115200 by default, Marc-André Lureau, 2020/01/07
- [PULL 19/37] mips: use sysbus_add_io(), Marc-André Lureau, 2020/01/07
- [PULL 20/37] mips: use sysbus_mmio_get_region() instead of internal fields, Marc-André Lureau, 2020/01/07
- [PULL 21/37] sm501: make SerialMM a child, export chardev property, Marc-André Lureau, 2020/01/07
- [PULL 22/37] vmmouse: replace PROP_PTR with PROP_LINK, Marc-André Lureau, 2020/01/07
- [PULL 24/37] etraxfs: remove PROP_PTR usage, Marc-André Lureau, 2020/01/07
- [PULL 23/37] lance: replace PROP_PTR with PROP_LINK, Marc-André Lureau, 2020/01/07
- [PULL 25/37] dp8393x: replace PROP_PTR with PROP_LINK,
Marc-André Lureau <=
- [PULL 26/37] leon3: use qemu_irq framework instead of callback as property, Marc-André Lureau, 2020/01/07
- [PULL 27/37] leon3: use qdev gpio facilities for the PIL, Marc-André Lureau, 2020/01/07
- [PULL 28/37] qdev: use g_strcmp0() instead of open-coding it, Marc-André Lureau, 2020/01/07
- [PULL 29/37] mips/cps: fix setting saar property, Marc-André Lureau, 2020/01/07
- [PULL 30/37] cris: improve passing PIC interrupt vector to the CPU, Marc-André Lureau, 2020/01/07
- [PULL 31/37] smbus-eeprom: remove PROP_PTR, Marc-André Lureau, 2020/01/07
- [PULL 32/37] omap-intc: remove PROP_PTR, Marc-André Lureau, 2020/01/07
- [PULL 33/37] omap-i2c: remove PROP_PTR, Marc-André Lureau, 2020/01/07
- [PULL 34/37] omap-gpio: remove PROP_PTR, Marc-André Lureau, 2020/01/07
- [PULL 35/37] qdev: remove PROP_MEMORY_REGION, Marc-André Lureau, 2020/01/07