qdev: Drop taddr properties

Drop all the infrastructure for taddr properties (ie ones which
are 'hwaddr' sized). These are now unused, and any further desired
use would be rather questionable since device properties shouldn't
generally depend on a type that is conceptually variable based on
the target CPU. 32 or 64 bit integer properties should be used instead
as appropriate for the specific device.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Peter Maydell 2013-04-20 14:48:28 +01:00 committed by Blue Swirl
parent 19298eca06
commit 21e5181f95
10 changed files with 0 additions and 96 deletions

View File

@ -33,7 +33,6 @@
#include "qemu/timer.h" #include "qemu/timer.h"
#include "hw/isa/isa.h" #include "hw/isa/isa.h"
#include "hw/sysbus.h" #include "hw/sysbus.h"
#include "hw/qdev-addr.h"
#include "sysemu/blockdev.h" #include "sysemu/blockdev.h"
#include "sysemu/sysemu.h" #include "sysemu/sysemu.h"
#include "qemu/log.h" #include "qemu/log.h"

View File

@ -9,6 +9,5 @@ common-obj-$(CONFIG_PTIMER) += ptimer.o
common-obj-$(CONFIG_SOFTMMU) += sysbus.o common-obj-$(CONFIG_SOFTMMU) += sysbus.o
common-obj-$(CONFIG_SOFTMMU) += null-machine.o common-obj-$(CONFIG_SOFTMMU) += null-machine.o
common-obj-$(CONFIG_SOFTMMU) += loader.o common-obj-$(CONFIG_SOFTMMU) += loader.o
common-obj-$(CONFIG_SOFTMMU) += qdev-addr.o
common-obj-$(CONFIG_SOFTMMU) += qdev-properties-system.o common-obj-$(CONFIG_SOFTMMU) += qdev-properties-system.o

View File

@ -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);
}

View File

@ -28,7 +28,6 @@
#include "ui/console.h" #include "ui/console.h"
#include "hw/devices.h" #include "hw/devices.h"
#include "hw/sysbus.h" #include "hw/sysbus.h"
#include "hw/qdev-addr.h"
#include "qemu/range.h" #include "qemu/range.h"
#include "ui/pixel_ops.h" #include "ui/pixel_ops.h"

View File

@ -26,7 +26,6 @@
#include "ui/console.h" #include "ui/console.h"
#include "ui/pixel_ops.h" #include "ui/pixel_ops.h"
#include "hw/sysbus.h" #include "hw/sysbus.h"
#include "hw/qdev-addr.h"
#define MAXX 1024 #define MAXX 1024
#define MAXY 768 #define MAXY 768

View File

@ -26,7 +26,6 @@
#include "qemu/timer.h" #include "qemu/timer.h"
#include "hw/ptimer.h" #include "hw/ptimer.h"
#include "qemu/log.h" #include "qemu/log.h"
#include "hw/qdev-addr.h"
#include "qapi/qmp/qerror.h" #include "qapi/qmp/qerror.h"
#include "hw/stream.h" #include "hw/stream.h"

View File

@ -2,7 +2,6 @@
#define QEMU_HW_MILKYMIST_H #define QEMU_HW_MILKYMIST_H
#include "hw/qdev.h" #include "hw/qdev.h"
#include "hw/qdev-addr.h"
#include "net/net.h" #include "net/net.h"
static inline DeviceState *milkymist_uart_create(hwaddr base, static inline DeviceState *milkymist_uart_create(hwaddr base,

View File

@ -27,7 +27,6 @@
#include "trace.h" #include "trace.h"
#include "net/net.h" #include "net/net.h"
#include "qemu/error-report.h" #include "qemu/error-report.h"
#include "hw/qdev-addr.h"
#include <zlib.h> #include <zlib.h>

View File

@ -37,7 +37,6 @@
#include "hw/nvram/fw_cfg.h" #include "hw/nvram/fw_cfg.h"
#include "hw/char/escc.h" #include "hw/char/escc.h"
#include "hw/empty_slot.h" #include "hw/empty_slot.h"
#include "hw/qdev-addr.h"
#include "hw/loader.h" #include "hw/loader.h"
#include "elf.h" #include "elf.h"
#include "sysemu/blockdev.h" #include "sysemu/blockdev.h"

View File

@ -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