From patchwork Tue Apr 2 16:10:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 15822 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 90B2123E3E for ; Tue, 2 Apr 2013 16:10:54 +0000 (UTC) Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by fiordland.canonical.com (Postfix) with ESMTP id F2442A18881 for ; Tue, 2 Apr 2013 16:10:53 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id bs12sf986216qab.9 for ; Tue, 02 Apr 2013 09:10:53 -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=ekE2fMrVCmOHA5pHjLum8ILUQdqTMy0ShtM25DWu3rg=; b=Av0htf2nwgwcopm1JomDtkezAGrxOsNjOAaZuauZ9uw/xgKiluoC+fiNlo0PbOfYG/ WOU94/3nq2HIX942rxVuKgNqEGKXPexUfvVyRoq/KgoqVvj4PtwFUHgglqHRknXchCx9 pYvFRwixu9VzxkiQVsJRsxlvSfEXAzFmNDfrlrcc6gFoUUOmhL5NbDdlDLzgrir2TbuP BnJMvpj2OhCmnDoWT/g2zPf3O4q9Ujea4VmuE10BSxgd5UBID8zLp3UAWZq9CcOEAAYF RYBCO+2dMqs//yn5ltAkQeQve3tlyPbSca82tMoJfXDrAtFPdbEChbJqguC8/04pLoX7 FLvw== X-Received: by 10.224.72.199 with SMTP id n7mr10776140qaj.5.1364919053541; Tue, 02 Apr 2013 09:10:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.180 with SMTP id 20ls415379qef.68.gmail; Tue, 02 Apr 2013 09:10:53 -0700 (PDT) X-Received: by 10.58.188.48 with SMTP id fx16mr13120555vec.22.1364919053338; Tue, 02 Apr 2013 09:10:53 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id a1si1602009vdk.21.2013.04.02.09.10.53 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Apr 2013 09:10:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 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.169; Received: by mail-vc0-f169.google.com with SMTP id kw10so627436vcb.0 for ; Tue, 02 Apr 2013 09:10:53 -0700 (PDT) X-Received: by 10.52.31.103 with SMTP id z7mr11141030vdh.56.1364919053040; Tue, 02 Apr 2013 09:10:53 -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.59.4.204 with SMTP id cg12csp131818ved; Tue, 2 Apr 2013 09:10:52 -0700 (PDT) X-Received: by 10.180.105.99 with SMTP id gl3mr17232151wib.22.1364919049986; Tue, 02 Apr 2013 09:10:49 -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 t43si3445851eeg.174.2013.04.02.09.10.49 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 02 Apr 2013 09:10:49 -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 1UN3nJ-0004nU-5c; Tue, 02 Apr 2013 17:10:45 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Magnus Damm , Anthony Liguori , David Gibson Subject: [PATCH 2/2] qdev: Drop taddr properties Date: Tue, 2 Apr 2013 17:10:44 +0100 Message-Id: <1364919044-18413-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1364919044-18413-1-git-send-email-peter.maydell@linaro.org> References: <1364919044-18413-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQnBcz0Q6HHMwHGZMHUYdjWfDeuNZzPRYdJ00KEAyT6/42a26haY+oZRn2zIMvFm2nGzjXJI X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.169 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/Makefile.objs | 1 - hw/fdc.c | 1 - hw/milkymist-hw.h | 1 - hw/milkymist-minimac2.c | 1 - hw/qdev-addr.c | 78 ------------------------------------------------- hw/qdev-addr.h | 10 ------- hw/sm501.c | 1 - hw/sparc/sun4m.c | 1 - hw/tcx.c | 1 - hw/xilinx_axidma.c | 1 - 10 files changed, 96 deletions(-) delete mode 100644 hw/qdev-addr.c delete mode 100644 hw/qdev-addr.h diff --git a/hw/Makefile.objs b/hw/Makefile.objs index d0b2ecb..bee5736 100644 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@ -134,7 +134,6 @@ common-obj-$(CONFIG_ESP) += esp.o common-obj-$(CONFIG_ESP_PCI) += esp-pci.o common-obj-y += sysbus.o isa-bus.o -common-obj-y += qdev-addr.o # VGA common-obj-$(CONFIG_VGA_PCI) += vga-pci.o diff --git a/hw/fdc.c b/hw/fdc.c index a4bb129..3220538 100644 --- a/hw/fdc.c +++ b/hw/fdc.c @@ -33,7 +33,6 @@ #include "qemu/timer.h" #include "hw/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/milkymist-hw.h b/hw/milkymist-hw.h index 4e86c4e..5317ce6 100644 --- a/hw/milkymist-hw.h +++ b/hw/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/milkymist-minimac2.c b/hw/milkymist-minimac2.c index 29618e8..4ef6318 100644 --- a/hw/milkymist-minimac2.c +++ b/hw/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/qdev-addr.c b/hw/qdev-addr.c deleted file mode 100644 index 80a38bb..0000000 --- a/hw/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/qdev-addr.h b/hw/qdev-addr.h deleted file mode 100644 index 79708e6..0000000 --- a/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 diff --git a/hw/sm501.c b/hw/sm501.c index 0ef6b8a..5f89fb2 100644 --- a/hw/sm501.c +++ b/hw/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/sparc/sun4m.c b/hw/sparc/sun4m.c index 9ebda02..fc282e2 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -37,7 +37,6 @@ #include "hw/fw_cfg.h" #include "hw/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/hw/tcx.c b/hw/tcx.c index c44068e..55abaee 100644 --- a/hw/tcx.c +++ b/hw/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/xilinx_axidma.c b/hw/xilinx_axidma.c index 8db1a74..997b06e 100644 --- a/hw/xilinx_axidma.c +++ b/hw/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 "hw/stream.h"