From 74901c3bd06a02b54f23172cb870127b49390bd0 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Tue, 26 Jul 2011 14:26:10 +0300 Subject: memory: add backward compatibility for old mmio registration This eases the transition to the new API. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori --- memory.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'memory.h') diff --git a/memory.h b/memory.h index 40ab95a98c..003c999219 100644 --- a/memory.h +++ b/memory.h @@ -28,6 +28,7 @@ typedef struct MemoryRegionOps MemoryRegionOps; typedef struct MemoryRegion MemoryRegion; typedef struct MemoryRegionPortio MemoryRegionPortio; +typedef struct MemoryRegionMmio MemoryRegionMmio; /* Must match *_DIRTY_FLAGS in cpu-all.h. To be replaced with dynamic * registration. @@ -36,6 +37,11 @@ typedef struct MemoryRegionPortio MemoryRegionPortio; #define DIRTY_MEMORY_CODE 1 #define DIRTY_MEMORY_MIGRATION 3 +struct MemoryRegionMmio { + CPUReadMemoryFunc *read[3]; + CPUWriteMemoryFunc *write[3]; +}; + /* * Memory region callbacks */ @@ -85,6 +91,10 @@ struct MemoryRegionOps { * backwards compatibility with old portio registration */ const MemoryRegionPortio *old_portio; + /* If .read and .write are not present, old_mmio may be used for + * backwards compatibility with old mmio registration + */ + const MemoryRegionMmio old_mmio; }; typedef struct CoalescedMemoryRange CoalescedMemoryRange; -- cgit v1.2.1