mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
memory: MemoryRegion: QOMify
QOMify memory regions as an Object. The former init() and destroy() routines become instance_init() and instance_finalize() resp. memory_region_init() is re-implemented to be: object_initialize() + set fields memory_region_destroy() is re-implemented to call unparent(). Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> [Add newly-created MR as child, unparent on destruction. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
b5c2c3d0c8
commit
b4fefef9d5
3 changed files with 113 additions and 26 deletions
|
@ -32,10 +32,15 @@
|
|||
#include "qemu/int128.h"
|
||||
#include "qemu/notify.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define MAX_PHYS_ADDR_SPACE_BITS 62
|
||||
#define MAX_PHYS_ADDR (((hwaddr)1 << MAX_PHYS_ADDR_SPACE_BITS) - 1)
|
||||
|
||||
#define TYPE_MEMORY_REGION "qemu:memory-region"
|
||||
#define MEMORY_REGION(obj) \
|
||||
OBJECT_CHECK(MemoryRegion, (obj), TYPE_MEMORY_REGION)
|
||||
|
||||
typedef struct MemoryRegionOps MemoryRegionOps;
|
||||
typedef struct MemoryRegionMmio MemoryRegionMmio;
|
||||
|
||||
|
@ -131,6 +136,7 @@ typedef struct CoalescedMemoryRange CoalescedMemoryRange;
|
|||
typedef struct MemoryRegionIoeventfd MemoryRegionIoeventfd;
|
||||
|
||||
struct MemoryRegion {
|
||||
Object parent_obj;
|
||||
/* All fields are private - violators will be prosecuted */
|
||||
const MemoryRegionOps *ops;
|
||||
const MemoryRegionIOMMUOps *iommu_ops;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue