summaryrefslogtreecommitdiffstats
path: root/hw/cuda.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2011-09-08 18:51:17 +0200
committerAlexander Graf <agraf@suse.de>2011-10-06 09:48:07 +0200
commitea0a7eb4603d5929d25ac32e27d2e318b5cea910 (patch)
tree45afc8d6d5b587b12d27fad114f0e2cbe110cf5a /hw/cuda.c
parent7a880d9352575c70bae6fb246436c513ff5fe418 (diff)
downloadhqemu-ea0a7eb4603d5929d25ac32e27d2e318b5cea910.zip
hqemu-ea0a7eb4603d5929d25ac32e27d2e318b5cea910.tar.gz
PPC: Fix via-cuda memory registration
Commit 23c5e4ca (convert to memory API) broke the VIA Cuda emulation layer by not registering the IO structs. This patch registers them properly and thus makes -M g3beige and -M mac99 work again. Tested-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/cuda.c')
-rw-r--r--hw/cuda.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/hw/cuda.c b/hw/cuda.c
index 6f05975..4077436 100644
--- a/hw/cuda.c
+++ b/hw/cuda.c
@@ -634,16 +634,20 @@ static uint32_t cuda_readl (void *opaque, target_phys_addr_t addr)
return 0;
}
-static CPUWriteMemoryFunc * const cuda_write[] = {
- &cuda_writeb,
- &cuda_writew,
- &cuda_writel,
-};
-
-static CPUReadMemoryFunc * const cuda_read[] = {
- &cuda_readb,
- &cuda_readw,
- &cuda_readl,
+static MemoryRegionOps cuda_ops = {
+ .old_mmio = {
+ .write = {
+ cuda_writeb,
+ cuda_writew,
+ cuda_writel,
+ },
+ .read = {
+ cuda_readb,
+ cuda_readw,
+ cuda_readl,
+ },
+ },
+ .endianness = DEVICE_NATIVE_ENDIAN,
};
static bool cuda_timer_exist(void *opaque, int version_id)
@@ -740,8 +744,8 @@ void cuda_init (MemoryRegion **cuda_mem, qemu_irq irq)
s->tick_offset = (uint32_t)mktimegm(&tm) + RTC_OFFSET;
s->adb_poll_timer = qemu_new_timer_ns(vm_clock, cuda_adb_poll, s);
- cpu_register_io_memory(cuda_read, cuda_write, s,
- DEVICE_NATIVE_ENDIAN);
+ memory_region_init_io(&s->mem, &cuda_ops, s, "cuda", 0x2000);
+
*cuda_mem = &s->mem;
vmstate_register(NULL, -1, &vmstate_cuda, s);
qemu_register_reset(cuda_reset, s);
OpenPOWER on IntegriCloud