From patchwork Sat Apr 20 13:48:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 16266 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f199.google.com (mail-ye0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7431020E7B for ; Sat, 20 Apr 2013 13:49:17 +0000 (UTC) Received: by mail-ye0-f199.google.com with SMTP id l14sf7758886yen.10 for ; Sat, 20 Apr 2013 06:48:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=uC2ZXtqP1DFUMxj8FMMEegVLby82EwQZPoNtuw3rJwM=; b=P5Rkf0GERxGoRAjkiGNov2Dik6EMxmt7Xl5kHqZQccO2ctxthmxe70s4iR4xc+B+2Q GCvXCGr/8wZJLHxwrdNEWoOa5Ew7vlfKYam0vDRynni0nNoXfBlDb1HPlVbPO1VHoe86 qoKSkrRJ3GYuiHbsUwja+RWwMT0ipMk8FXQ+XCi42adYUX62HpR7GGDJxXXlauoPUbpf qtLNBBhxZ57j8aZPJuVqREv4CK2BnVYaC53pXUkXKDeVswnqD9o94DwI+W4tMzyrzp3A luXuCw/wboMfe6e+2GPKmXOnxpcoFTTVv9ZFRPtGcX4yZgAqRQf6Awx8wLjDBg4ON05r 84Wg== X-Received: by 10.224.160.65 with SMTP id m1mr13935158qax.2.1366465715271; Sat, 20 Apr 2013 06:48:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.44 with SMTP id cz12ls2738301qeb.67.gmail; Sat, 20 Apr 2013 06:48:34 -0700 (PDT) X-Received: by 10.220.80.67 with SMTP id s3mr14265523vck.12.1366465714926; Sat, 20 Apr 2013 06:48:34 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id gr6si11940721vdc.78.2013.04.20.06.48.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 20 Apr 2013 06:48:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id hf12so4728530vcb.21 for ; Sat, 20 Apr 2013 06:48:34 -0700 (PDT) X-Received: by 10.52.71.4 with SMTP id q4mr12233015vdu.8.1366465714679; Sat, 20 Apr 2013 06:48:34 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp13045veb; Sat, 20 Apr 2013 06:48:33 -0700 (PDT) X-Received: by 10.205.33.9 with SMTP id sm9mr7359367bkb.43.1366465713604; Sat, 20 Apr 2013 06:48:33 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id ha11si6201687bkc.234.2013.04.20.06.48.32 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 20 Apr 2013 06:48:33 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1UTY9U-0003ll-Q1; Sat, 20 Apr 2013 14:48:28 +0100 From: Peter Maydell To: qemu-devel@nongnu.org, Blue Swirl Cc: patches@linaro.org, Anthony Liguori , Paolo Bonzini , David Gibson Subject: [PATCH v3 2/2] qdev: Drop taddr properties Date: Sat, 20 Apr 2013 14:48:28 +0100 Message-Id: <1366465708-14462-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1366465708-14462-1-git-send-email-peter.maydell@linaro.org> References: <1366465708-14462-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQlM/dXw65JftBDkV6DhqL48qmiMBdELRbMKm23scvQ4a22ND3qMtQBxxU7j5Fv9rXyaHsfp X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- hw/block/fdc.c | 1 - hw/core/Makefile.objs | 1 - hw/core/qdev-addr.c | 78 ------------------------------------------- hw/display/sm501.c | 1 - hw/display/tcx.c | 1 - hw/dma/xilinx_axidma.c | 1 - hw/lm32/milkymist-hw.h | 1 - hw/net/milkymist-minimac2.c | 1 - hw/sparc/sun4m.c | 1 - include/hw/qdev-addr.h | 10 ------ 10 files changed, 96 deletions(-) delete mode 100644 hw/core/qdev-addr.c delete mode 100644 include/hw/qdev-addr.h diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 1ed874f..f1f1fd7 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 94109f3..950146c 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 80a38bb..0000000 --- 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 fc5e539..916816f 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 77c7191..d7465c6 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 bc62664..3a3ef8a 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 4e86c4e..5317ce6 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 29618e8..4ef6318 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 31beb32..635115f 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 79708e6..0000000 --- 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