{"id":814532,"url":"http://patchwork.ozlabs.org/api/patches/814532/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/1505580378-9044-2-git-send-email-peter.maydell@linaro.org/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1505580378-9044-2-git-send-email-peter.maydell@linaro.org>","list_archive_url":null,"date":"2017-09-16T16:46:13","name":"[1/6] hw/arm/palm.c: Don't use old_mmio for static_ops","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"c34d59e80dca96f07523bb51f4082331b5f765d3","submitter":{"id":5111,"url":"http://patchwork.ozlabs.org/api/people/5111/?format=json","name":"Peter Maydell","email":"peter.maydell@linaro.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/1505580378-9044-2-git-send-email-peter.maydell@linaro.org/mbox/","series":[{"id":3457,"url":"http://patchwork.ozlabs.org/api/series/3457/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=3457","date":"2017-09-16T16:46:12","name":"convert some omap/palm devices from using old_mmio","version":1,"mbox":"http://patchwork.ozlabs.org/series/3457/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/814532/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/814532/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xvdc65wz0z9s78\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 17 Sep 2017 02:52:37 +1000 (AEST)","from localhost ([::1]:57997 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dtGKZ-0004fR-5t\n\tfor incoming@patchwork.ozlabs.org; Sat, 16 Sep 2017 12:52:35 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:52656)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pm215@archaic.org.uk>) id 1dtGEI-0008HK-2X\n\tfor qemu-devel@nongnu.org; Sat, 16 Sep 2017 12:46:07 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pm215@archaic.org.uk>) id 1dtGEH-0007BL-8c\n\tfor qemu-devel@nongnu.org; Sat, 16 Sep 2017 12:46:06 -0400","from orth.archaic.org.uk ([2001:8b0:1d0::2]:37412)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <pm215@archaic.org.uk>)\n\tid 1dtGEE-00075o-IG; Sat, 16 Sep 2017 12:46:02 -0400","from pm215 by orth.archaic.org.uk with local (Exim 4.89)\n\t(envelope-from <pm215@archaic.org.uk>)\n\tid 1dtGDz-00015X-Gs; Sat, 16 Sep 2017 17:45:47 +0100"],"From":"Peter Maydell <peter.maydell@linaro.org>","To":"qemu-arm@nongnu.org,\n\tqemu-devel@nongnu.org","Date":"Sat, 16 Sep 2017 17:46:13 +0100","Message-Id":"<1505580378-9044-2-git-send-email-peter.maydell@linaro.org>","X-Mailer":"git-send-email 2.7.4","In-Reply-To":"<1505580378-9044-1-git-send-email-peter.maydell@linaro.org>","References":"<1505580378-9044-1-git-send-email-peter.maydell@linaro.org>","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2001:8b0:1d0::2","Subject":"[Qemu-devel] [PATCH 1/6] hw/arm/palm.c: Don't use old_mmio for\n\tstatic_ops","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"patches@linaro.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"Update the static_ops functions to use new-style mmio\nrather than the legacy old_mmio functions.\n\nSigned-off-by: Peter Maydell <peter.maydell@linaro.org>\n---\n hw/arm/palm.c | 30 ++++++++++--------------------\n 1 file changed, 10 insertions(+), 20 deletions(-)","diff":"diff --git a/hw/arm/palm.c b/hw/arm/palm.c\nindex bf070a2..264f5bd 100644\n--- a/hw/arm/palm.c\n+++ b/hw/arm/palm.c\n@@ -30,26 +30,16 @@\n #include \"hw/loader.h\"\n #include \"exec/address-spaces.h\"\n \n-static uint32_t static_readb(void *opaque, hwaddr offset)\n+static uint64_t static_read(void *opaque, hwaddr offset, unsigned size)\n {\n-    uint32_t *val = (uint32_t *) opaque;\n-    return *val >> ((offset & 3) << 3);\n-}\n+    uint32_t *val = (uint32_t *)opaque;\n+    uint32_t sizemask = 7 >> size;\n \n-static uint32_t static_readh(void *opaque, hwaddr offset)\n-{\n-    uint32_t *val = (uint32_t *) opaque;\n-    return *val >> ((offset & 1) << 3);\n-}\n-\n-static uint32_t static_readw(void *opaque, hwaddr offset)\n-{\n-    uint32_t *val = (uint32_t *) opaque;\n-    return *val >> ((offset & 0) << 3);\n+    return *val >> ((offset & sizemask) << 3);\n }\n \n-static void static_write(void *opaque, hwaddr offset,\n-                uint32_t value)\n+static void static_write(void *opaque, hwaddr offset, uint64_t value,\n+                         unsigned size)\n {\n #ifdef SPY\n     printf(\"%s: value %08lx written at \" PA_FMT \"\\n\",\n@@ -58,10 +48,10 @@ static void static_write(void *opaque, hwaddr offset,\n }\n \n static const MemoryRegionOps static_ops = {\n-    .old_mmio = {\n-        .read = { static_readb, static_readh, static_readw, },\n-        .write = { static_write, static_write, static_write, },\n-    },\n+    .read = static_read,\n+    .write = static_write,\n+    .valid.min_access_size = 1,\n+    .valid.max_access_size = 4,\n     .endianness = DEVICE_NATIVE_ENDIAN,\n };\n \n","prefixes":["1/6"]}