All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: patches@linaro.org
Subject: [Qemu-devel] [PATCH 6/6] hw/arm/omap2.c: Don't use old_mmio
Date: Sat, 16 Sep 2017 17:46:18 +0100	[thread overview]
Message-ID: <1505580378-9044-7-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1505580378-9044-1-git-send-email-peter.maydell@linaro.org>

Don't use old_mmio in the memory region ops struct.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/omap2.c | 49 +++++++++++++++++++++++++++++++++++++------------
 1 file changed, 37 insertions(+), 12 deletions(-)

diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c
index ece25ae..f35d265 100644
--- a/hw/arm/omap2.c
+++ b/hw/arm/omap2.c
@@ -2087,19 +2087,44 @@ static void omap_sysctl_write(void *opaque, hwaddr addr,
     }
 }
 
+static uint64_t omap_sysctl_readfn(void *opaque, hwaddr addr,
+                                   unsigned size)
+{
+    switch (size) {
+    case 1:
+        return omap_sysctl_read8(opaque, addr);
+    case 2:
+        return omap_badwidth_read32(opaque, addr); /* TODO */
+    case 4:
+        return omap_sysctl_read(opaque, addr);
+    default:
+        g_assert_not_reached();
+    }
+}
+
+static void omap_sysctl_writefn(void *opaque, hwaddr addr,
+                                uint64_t value, unsigned size)
+{
+    switch (size) {
+    case 1:
+        omap_sysctl_write8(opaque, addr, value);
+        break;
+    case 2:
+        omap_badwidth_write32(opaque, addr, value); /* TODO */
+        break;
+    case 4:
+        omap_sysctl_write(opaque, addr, value);
+        break;
+    default:
+        g_assert_not_reached();
+    }
+}
+
 static const MemoryRegionOps omap_sysctl_ops = {
-    .old_mmio = {
-        .read = {
-            omap_sysctl_read8,
-            omap_badwidth_read32,	/* TODO */
-            omap_sysctl_read,
-        },
-        .write = {
-            omap_sysctl_write8,
-            omap_badwidth_write32,	/* TODO */
-            omap_sysctl_write,
-        },
-    },
+    .read = omap_sysctl_readfn,
+    .write = omap_sysctl_writefn,
+    .valid.min_access_size = 1,
+    .valid.max_access_size = 4,
     .endianness = DEVICE_NATIVE_ENDIAN,
 };
 
-- 
2.7.4

  parent reply	other threads:[~2017-09-16 16:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-16 16:46 [Qemu-devel] [PATCH 0/6] convert some omap/palm devices from using old_mmio Peter Maydell
2017-09-16 16:46 ` [Qemu-devel] [PATCH 1/6] hw/arm/palm.c: Don't use old_mmio for static_ops Peter Maydell
2017-09-20 20:59   ` Richard Henderson
2017-09-16 16:46 ` [Qemu-devel] [PATCH 2/6] hw/gpio/omap_gpio.c: Don't use old_mmio Peter Maydell
2017-09-20 21:00   ` Richard Henderson
2017-09-16 16:46 ` [Qemu-devel] [PATCH 3/6] hw/timer/omap_synctimer.c: " Peter Maydell
2017-09-20 21:02   ` Richard Henderson
2017-09-16 16:46 ` [Qemu-devel] [PATCH 4/6] hw/timer/omap_gptimer: " Peter Maydell
2017-09-20 21:02   ` Richard Henderson
2017-09-16 16:46 ` [Qemu-devel] [PATCH 5/6] hw/i2c/omap_i2c.c: " Peter Maydell
2017-09-20 21:03   ` Richard Henderson
2017-09-16 16:46 ` Peter Maydell [this message]
2017-09-20 21:04   ` [Qemu-devel] [PATCH 6/6] hw/arm/omap2.c: " Richard Henderson
2017-09-17 13:21 ` [Qemu-devel] [PATCH 0/6] convert some omap/palm devices from using old_mmio Mark Cave-Ayland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1505580378-9044-7-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=patches@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.