[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH 3/6] hw/timer/omap_synctimer.c: Don't use old_mmio
From: |
Peter Maydell |
Subject: |
[Qemu-arm] [PATCH 3/6] hw/timer/omap_synctimer.c: Don't use old_mmio |
Date: |
Sat, 16 Sep 2017 17:46:15 +0100 |
Don't use the old_mmio in the memory region ops struct.
Signed-off-by: Peter Maydell <address@hidden>
---
hw/timer/omap_synctimer.c | 35 +++++++++++++++++++++--------------
1 file changed, 21 insertions(+), 14 deletions(-)
diff --git a/hw/timer/omap_synctimer.c b/hw/timer/omap_synctimer.c
index 9ee6519..0d75a90 100644
--- a/hw/timer/omap_synctimer.c
+++ b/hw/timer/omap_synctimer.c
@@ -68,25 +68,32 @@ static uint32_t omap_synctimer_readh(void *opaque, hwaddr
addr)
}
}
-static void omap_synctimer_write(void *opaque, hwaddr addr,
- uint32_t value)
+static uint64_t omap_synctimer_readfn(void *opaque, hwaddr addr,
+ unsigned size)
+{
+ switch (size) {
+ case 1:
+ return omap_badwidth_read32(opaque, addr);
+ case 2:
+ return omap_synctimer_readh(opaque, addr);
+ case 4:
+ return omap_synctimer_readw(opaque, addr);
+ default:
+ g_assert_not_reached();
+ }
+}
+
+static void omap_synctimer_writefn(void *opaque, hwaddr addr,
+ uint64_t value, unsigned size)
{
OMAP_BAD_REG(addr);
}
static const MemoryRegionOps omap_synctimer_ops = {
- .old_mmio = {
- .read = {
- omap_badwidth_read32,
- omap_synctimer_readh,
- omap_synctimer_readw,
- },
- .write = {
- omap_badwidth_write32,
- omap_synctimer_write,
- omap_synctimer_write,
- },
- },
+ .read = omap_synctimer_readfn,
+ .write = omap_synctimer_writefn,
+ .valid.min_access_size = 1,
+ .valid.max_access_size = 4,
.endianness = DEVICE_NATIVE_ENDIAN,
};
--
2.7.4
- [Qemu-arm] [PATCH 0/6] convert some omap/palm devices from using old_mmio, Peter Maydell, 2017/09/16
- [Qemu-arm] [PATCH 6/6] hw/arm/omap2.c: Don't use old_mmio, Peter Maydell, 2017/09/16
- [Qemu-arm] [PATCH 5/6] hw/i2c/omap_i2c.c: Don't use old_mmio, Peter Maydell, 2017/09/16
- [Qemu-arm] [PATCH 3/6] hw/timer/omap_synctimer.c: Don't use old_mmio,
Peter Maydell <=
- [Qemu-arm] [PATCH 4/6] hw/timer/omap_gptimer: Don't use old_mmio, Peter Maydell, 2017/09/16
- [Qemu-arm] [PATCH 2/6] hw/gpio/omap_gpio.c: Don't use old_mmio, Peter Maydell, 2017/09/16
- [Qemu-arm] [PATCH 1/6] hw/arm/palm.c: Don't use old_mmio for static_ops, Peter Maydell, 2017/09/16
- Re: [Qemu-arm] [Qemu-devel] [PATCH 0/6] convert some omap/palm devices from using old_mmio, Mark Cave-Ayland, 2017/09/17