diff options
author | Peter Crosthwaite <peter.crosthwaite@xilinx.com> | 2014-06-05 23:17:01 -0700 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-07-01 10:20:41 +0200 |
commit | d33382da9abe21cb42f26b55945845b56ce9324a (patch) | |
tree | 5b68134e26126b8563ac5cfc93a619bf225238fe /memory.c | |
parent | 409ddd0139c101f813d16e8ebaa7c7d4b4afb96e (diff) |
memory: MemoryRegion: Add may-overlap and priority props
QOM propertyify the .may-overlap and .priority fields. The setters
will re-add the memory as a subregion if needed (i.e. the values change
when the memory region is already contained).
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
[Remove setters. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -955,6 +955,22 @@ static Object *memory_region_resolve_container(Object *obj, void *opaque, return OBJECT(mr->container); } +static void memory_region_get_priority(Object *obj, Visitor *v, void *opaque, + const char *name, Error **errp) +{ + MemoryRegion *mr = MEMORY_REGION(obj); + int32_t value = mr->priority; + + visit_type_int32(v, &value, name, errp); +} + +static bool memory_region_get_may_overlap(Object *obj, Error **errp) +{ + MemoryRegion *mr = MEMORY_REGION(obj); + + return mr->may_overlap; +} + static void memory_region_initfn(Object *obj) { MemoryRegion *mr = MEMORY_REGION(obj); @@ -978,6 +994,14 @@ static void memory_region_initfn(Object *obj) memory_region_get_addr, NULL, /* memory_region_set_addr */ NULL, NULL, &error_abort); + object_property_add(OBJECT(mr), "priority", "uint32", + memory_region_get_priority, + NULL, /* memory_region_set_priority */ + NULL, NULL, &error_abort); + object_property_add_bool(OBJECT(mr), "may-overlap", + memory_region_get_may_overlap, + NULL, /* memory_region_set_may_overlap */ + &error_abort); } static uint64_t unassigned_mem_read(void *opaque, hwaddr addr, |