diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 1ed874f074120bda3431a859d767fafe4460bf8c..f1f1fd7f3b4972815beee287859038e462f56e08 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -33,7 +33,6 @@ #include "qemu/timer.h" #include "hw/isa/isa.h" #include "hw/sysbus.h" -#include "hw/qdev-addr.h" #include "sysemu/blockdev.h" #include "sysemu/sysemu.h" #include "qemu/log.h" diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs index 94109f32e220199daa6340941e3504c24f7d0a67..950146c6ffc55383fa92715d487df97990bbdb03 100644 --- a/hw/core/Makefile.objs +++ b/hw/core/Makefile.objs @@ -9,6 +9,5 @@ common-obj-$(CONFIG_PTIMER) += ptimer.o common-obj-$(CONFIG_SOFTMMU) += sysbus.o common-obj-$(CONFIG_SOFTMMU) += null-machine.o common-obj-$(CONFIG_SOFTMMU) += loader.o -common-obj-$(CONFIG_SOFTMMU) += qdev-addr.o common-obj-$(CONFIG_SOFTMMU) += qdev-properties-system.o diff --git a/hw/core/qdev-addr.c b/hw/core/qdev-addr.c deleted file mode 100644 index 80a38bb01787146ebf8f838405483e77c84e10be..0000000000000000000000000000000000000000 --- a/hw/core/qdev-addr.c +++ /dev/null @@ -1,78 +0,0 @@ -#include "hw/qdev.h" -#include "hw/qdev-addr.h" -#include "exec/hwaddr.h" -#include "qapi/qmp/qerror.h" -#include "qapi/visitor.h" - -/* --- target physical address --- */ - -static int parse_taddr(DeviceState *dev, Property *prop, const char *str) -{ - hwaddr *ptr = qdev_get_prop_ptr(dev, prop); - - *ptr = strtoull(str, NULL, 16); - return 0; -} - -static int print_taddr(DeviceState *dev, Property *prop, char *dest, size_t len) -{ - hwaddr *ptr = qdev_get_prop_ptr(dev, prop); - return snprintf(dest, len, "0x" TARGET_FMT_plx, *ptr); -} - -static void get_taddr(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) -{ - DeviceState *dev = DEVICE(obj); - Property *prop = opaque; - hwaddr *ptr = qdev_get_prop_ptr(dev, prop); - int64_t value; - - value = *ptr; - visit_type_int64(v, &value, name, errp); -} - -static void set_taddr(Object *obj, Visitor *v, void *opaque, - const char *name, Error **errp) -{ - DeviceState *dev = DEVICE(obj); - Property *prop = opaque; - hwaddr *ptr = qdev_get_prop_ptr(dev, prop); - Error *local_err = NULL; - int64_t value; - - if (dev->realized) { - qdev_prop_set_after_realize(dev, name, errp); - return; - } - - visit_type_int64(v, &value, name, &local_err); - if (local_err) { - error_propagate(errp, local_err); - return; - } - if ((uint64_t)value <= (uint64_t) ~(hwaddr)0) { - *ptr = value; - } else { - error_set(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, - dev->id?:"", name, value, (uint64_t) 0, - (uint64_t) ~(hwaddr)0); - } -} - - -PropertyInfo qdev_prop_taddr = { - .name = "taddr", - .parse = parse_taddr, - .print = print_taddr, - .get = get_taddr, - .set = set_taddr, -}; - -void qdev_prop_set_taddr(DeviceState *dev, const char *name, hwaddr value) -{ - Error *errp = NULL; - object_property_set_int(OBJECT(dev), value, name, &errp); - assert(!errp); - -} diff --git a/hw/display/sm501.c b/hw/display/sm501.c index fc5e539bcb249ee971159e58192d3a3ff2dc878a..916816fc24520a1d20d9da1026b7738bca189cc8 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -28,7 +28,6 @@ #include "ui/console.h" #include "hw/devices.h" #include "hw/sysbus.h" -#include "hw/qdev-addr.h" #include "qemu/range.h" #include "ui/pixel_ops.h" diff --git a/hw/display/tcx.c b/hw/display/tcx.c index 77c7191c764afdcce0205d247b01569098a96102..d7465c63f17bd5ce0de17734e090455881050f24 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -26,7 +26,6 @@ #include "ui/console.h" #include "ui/pixel_ops.h" #include "hw/sysbus.h" -#include "hw/qdev-addr.h" #define MAXX 1024 #define MAXY 768 diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index bc62664daa18e5708a50ac2b87f557d351c66c47..3a3ef8aff351595698f3ea2fe9dca0a5b07b587d 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -26,7 +26,6 @@ #include "qemu/timer.h" #include "hw/ptimer.h" #include "qemu/log.h" -#include "hw/qdev-addr.h" #include "qapi/qmp/qerror.h" #include "hw/stream.h" diff --git a/hw/lm32/milkymist-hw.h b/hw/lm32/milkymist-hw.h index 4e86c4e83231c5fd0e5e562dd58e8f6d6721973e..5317ce6e2d4c6fed187b947fca425613a0607b2c 100644 --- a/hw/lm32/milkymist-hw.h +++ b/hw/lm32/milkymist-hw.h @@ -2,7 +2,6 @@ #define QEMU_HW_MILKYMIST_H #include "hw/qdev.h" -#include "hw/qdev-addr.h" #include "net/net.h" static inline DeviceState *milkymist_uart_create(hwaddr base, diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c index 29618e8efa83653ff3a79503dc1d7026f6ffe08a..4ef631841816342f08ad015d0e5e20ee833860c2 100644 --- a/hw/net/milkymist-minimac2.c +++ b/hw/net/milkymist-minimac2.c @@ -27,7 +27,6 @@ #include "trace.h" #include "net/net.h" #include "qemu/error-report.h" -#include "hw/qdev-addr.h" #include diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 31beb328858a4377af1ba485a741785746b6fd8f..635115f0977b3f2e22c44d1daab9d1b1577cbd93 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -37,7 +37,6 @@ #include "hw/nvram/fw_cfg.h" #include "hw/char/escc.h" #include "hw/empty_slot.h" -#include "hw/qdev-addr.h" #include "hw/loader.h" #include "elf.h" #include "sysemu/blockdev.h" diff --git a/include/hw/qdev-addr.h b/include/hw/qdev-addr.h deleted file mode 100644 index 79708e6751236f38181a4752c40b2ba0bcb82197..0000000000000000000000000000000000000000 --- a/include/hw/qdev-addr.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef HW_QDEV_ADDR_H -#define HW_QDEV_ADDR_H 1 - -#define DEFINE_PROP_TADDR(_n, _s, _f, _d) \ - DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_taddr, hwaddr) - -extern PropertyInfo qdev_prop_taddr; -void qdev_prop_set_taddr(DeviceState *dev, const char *name, hwaddr value); - -#endif