mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
memory: add backward compatibility for old portio registration
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
658b222401
commit
627a0e90dc
2 changed files with 49 additions and 0 deletions
17
memory.h
17
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
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue