From 627a0e90dc6b53504d6b9539b8e29210d82ecf9d Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Tue, 26 Jul 2011 14:26:09 +0300 Subject: memory: add backward compatibility for old portio registration Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori --- memory.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'memory.h') diff --git a/memory.h b/memory.h index 88ba428b7c..40ab95a98c 100644 --- a/memory.h +++ b/memory.h @@ -23,9 +23,11 @@ #include "targphys.h" #include "qemu-queue.h" #include "iorange.h" +#include "ioport.h" typedef struct MemoryRegionOps MemoryRegionOps; typedef struct MemoryRegion MemoryRegion; +typedef struct MemoryRegionPortio MemoryRegionPortio; /* Must match *_DIRTY_FLAGS in cpu-all.h. To be replaced with dynamic * registration. @@ -78,6 +80,11 @@ struct MemoryRegionOps { */ bool unaligned; } impl; + + /* If .read and .write are not present, old_portio may be used for + * backwards compatibility with old portio registration + */ + const MemoryRegionPortio *old_portio; }; typedef struct CoalescedMemoryRange CoalescedMemoryRange; @@ -105,6 +112,16 @@ struct MemoryRegion { uint8_t dirty_log_mask; }; +struct MemoryRegionPortio { + uint32_t offset; + uint32_t len; + unsigned size; + IOPortReadFunc *read; + IOPortWriteFunc *write; +}; + +#define PORTIO_END { } + /** * memory_region_init: Initialize a memory region * -- cgit v1.2.1