mirror of
https://github.com/Cxbx-Reloaded/unicorn.git
synced 2024-11-27 21:30:55 +00:00
Merge pull request #655 from angr/fix/slow_mem_mapping
Remove unmapped/freed memory regions from the object property list.
This commit is contained in:
commit
99f3647d2e
@ -2176,7 +2176,6 @@
|
|||||||
#define object_property_allow_set_link object_property_allow_set_link_aarch64
|
#define object_property_allow_set_link object_property_allow_set_link_aarch64
|
||||||
#define object_property_del object_property_del_aarch64
|
#define object_property_del object_property_del_aarch64
|
||||||
#define object_property_del_all object_property_del_all_aarch64
|
#define object_property_del_all object_property_del_all_aarch64
|
||||||
#define object_property_del_child object_property_del_child_aarch64
|
|
||||||
#define object_property_find object_property_find_aarch64
|
#define object_property_find object_property_find_aarch64
|
||||||
#define object_property_get object_property_get_aarch64
|
#define object_property_get object_property_get_aarch64
|
||||||
#define object_property_get_bool object_property_get_bool_aarch64
|
#define object_property_get_bool object_property_get_bool_aarch64
|
||||||
|
@ -2176,7 +2176,6 @@
|
|||||||
#define object_property_allow_set_link object_property_allow_set_link_arm
|
#define object_property_allow_set_link object_property_allow_set_link_arm
|
||||||
#define object_property_del object_property_del_arm
|
#define object_property_del object_property_del_arm
|
||||||
#define object_property_del_all object_property_del_all_arm
|
#define object_property_del_all object_property_del_all_arm
|
||||||
#define object_property_del_child object_property_del_child_arm
|
|
||||||
#define object_property_find object_property_find_arm
|
#define object_property_find object_property_find_arm
|
||||||
#define object_property_get object_property_get_arm
|
#define object_property_get object_property_get_arm
|
||||||
#define object_property_get_bool object_property_get_bool_arm
|
#define object_property_get_bool object_property_get_bool_arm
|
||||||
|
@ -2182,7 +2182,6 @@ symbols = (
|
|||||||
'object_property_allow_set_link',
|
'object_property_allow_set_link',
|
||||||
'object_property_del',
|
'object_property_del',
|
||||||
'object_property_del_all',
|
'object_property_del_all',
|
||||||
'object_property_del_child',
|
|
||||||
'object_property_find',
|
'object_property_find',
|
||||||
'object_property_get',
|
'object_property_get',
|
||||||
'object_property_get_bool',
|
'object_property_get_bool',
|
||||||
|
@ -810,6 +810,8 @@ ObjectProperty *object_property_add(Object *obj, const char *name,
|
|||||||
|
|
||||||
void object_property_del(struct uc_struct *uc, Object *obj, const char *name, Error **errp);
|
void object_property_del(struct uc_struct *uc, Object *obj, const char *name, Error **errp);
|
||||||
|
|
||||||
|
void object_property_del_child(struct uc_struct *uc, Object *obj, Object *child, Error **errp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* object_property_find:
|
* object_property_find:
|
||||||
* @obj: the object
|
* @obj: the object
|
||||||
|
@ -2176,7 +2176,6 @@
|
|||||||
#define object_property_allow_set_link object_property_allow_set_link_m68k
|
#define object_property_allow_set_link object_property_allow_set_link_m68k
|
||||||
#define object_property_del object_property_del_m68k
|
#define object_property_del object_property_del_m68k
|
||||||
#define object_property_del_all object_property_del_all_m68k
|
#define object_property_del_all object_property_del_all_m68k
|
||||||
#define object_property_del_child object_property_del_child_m68k
|
|
||||||
#define object_property_find object_property_find_m68k
|
#define object_property_find object_property_find_m68k
|
||||||
#define object_property_get object_property_get_m68k
|
#define object_property_get object_property_get_m68k
|
||||||
#define object_property_get_bool object_property_get_bool_m68k
|
#define object_property_get_bool object_property_get_bool_m68k
|
||||||
|
@ -66,6 +66,8 @@ MemoryRegion *memory_map_ptr(struct uc_struct *uc, hwaddr begin, size_t size, ui
|
|||||||
return ram;
|
return ram;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void memory_region_update_container_subregions(MemoryRegion *subregion);
|
||||||
|
|
||||||
void memory_unmap(struct uc_struct *uc, MemoryRegion *mr)
|
void memory_unmap(struct uc_struct *uc, MemoryRegion *mr)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -79,7 +81,6 @@ void memory_unmap(struct uc_struct *uc, MemoryRegion *mr)
|
|||||||
tlb_flush_page(uc->current_cpu, addr);
|
tlb_flush_page(uc->current_cpu, addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mr->enabled = false;
|
|
||||||
memory_region_del_subregion(get_system_memory(uc), mr);
|
memory_region_del_subregion(get_system_memory(uc), mr);
|
||||||
|
|
||||||
for (i = 0; i < uc->mapped_block_count; i++) {
|
for (i = 0; i < uc->mapped_block_count; i++) {
|
||||||
@ -94,6 +95,7 @@ void memory_unmap(struct uc_struct *uc, MemoryRegion *mr)
|
|||||||
g_free(mr->ioeventfds);
|
g_free(mr->ioeventfds);
|
||||||
g_free((char *)mr->name);
|
g_free((char *)mr->name);
|
||||||
mr->name = NULL;
|
mr->name = NULL;
|
||||||
|
object_property_del_child(mr->uc, qdev_get_machine(mr->uc), obj, &error_abort);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,7 +107,6 @@ int memory_free(struct uc_struct *uc)
|
|||||||
Object *obj;
|
Object *obj;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
get_system_memory(uc)->enabled = false;
|
|
||||||
for (i = 0; i < uc->mapped_block_count; i++) {
|
for (i = 0; i < uc->mapped_block_count; i++) {
|
||||||
mr = uc->mapped_blocks[i];
|
mr = uc->mapped_blocks[i];
|
||||||
mr->enabled = false;
|
mr->enabled = false;
|
||||||
@ -115,6 +116,7 @@ int memory_free(struct uc_struct *uc)
|
|||||||
obj->ref = 1;
|
obj->ref = 1;
|
||||||
obj->free = g_free;
|
obj->free = g_free;
|
||||||
g_free(mr->ioeventfds);
|
g_free(mr->ioeventfds);
|
||||||
|
object_property_del_child(mr->uc, qdev_get_machine(mr->uc), obj, &error_abort);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2176,7 +2176,6 @@
|
|||||||
#define object_property_allow_set_link object_property_allow_set_link_mips
|
#define object_property_allow_set_link object_property_allow_set_link_mips
|
||||||
#define object_property_del object_property_del_mips
|
#define object_property_del object_property_del_mips
|
||||||
#define object_property_del_all object_property_del_all_mips
|
#define object_property_del_all object_property_del_all_mips
|
||||||
#define object_property_del_child object_property_del_child_mips
|
|
||||||
#define object_property_find object_property_find_mips
|
#define object_property_find object_property_find_mips
|
||||||
#define object_property_get object_property_get_mips
|
#define object_property_get object_property_get_mips
|
||||||
#define object_property_get_bool object_property_get_bool_mips
|
#define object_property_get_bool object_property_get_bool_mips
|
||||||
|
@ -2176,7 +2176,6 @@
|
|||||||
#define object_property_allow_set_link object_property_allow_set_link_mips64
|
#define object_property_allow_set_link object_property_allow_set_link_mips64
|
||||||
#define object_property_del object_property_del_mips64
|
#define object_property_del object_property_del_mips64
|
||||||
#define object_property_del_all object_property_del_all_mips64
|
#define object_property_del_all object_property_del_all_mips64
|
||||||
#define object_property_del_child object_property_del_child_mips64
|
|
||||||
#define object_property_find object_property_find_mips64
|
#define object_property_find object_property_find_mips64
|
||||||
#define object_property_get object_property_get_mips64
|
#define object_property_get object_property_get_mips64
|
||||||
#define object_property_get_bool object_property_get_bool_mips64
|
#define object_property_get_bool object_property_get_bool_mips64
|
||||||
|
@ -2176,7 +2176,6 @@
|
|||||||
#define object_property_allow_set_link object_property_allow_set_link_mips64el
|
#define object_property_allow_set_link object_property_allow_set_link_mips64el
|
||||||
#define object_property_del object_property_del_mips64el
|
#define object_property_del object_property_del_mips64el
|
||||||
#define object_property_del_all object_property_del_all_mips64el
|
#define object_property_del_all object_property_del_all_mips64el
|
||||||
#define object_property_del_child object_property_del_child_mips64el
|
|
||||||
#define object_property_find object_property_find_mips64el
|
#define object_property_find object_property_find_mips64el
|
||||||
#define object_property_get object_property_get_mips64el
|
#define object_property_get object_property_get_mips64el
|
||||||
#define object_property_get_bool object_property_get_bool_mips64el
|
#define object_property_get_bool object_property_get_bool_mips64el
|
||||||
|
@ -2176,7 +2176,6 @@
|
|||||||
#define object_property_allow_set_link object_property_allow_set_link_mipsel
|
#define object_property_allow_set_link object_property_allow_set_link_mipsel
|
||||||
#define object_property_del object_property_del_mipsel
|
#define object_property_del object_property_del_mipsel
|
||||||
#define object_property_del_all object_property_del_all_mipsel
|
#define object_property_del_all object_property_del_all_mipsel
|
||||||
#define object_property_del_child object_property_del_child_mipsel
|
|
||||||
#define object_property_find object_property_find_mipsel
|
#define object_property_find object_property_find_mipsel
|
||||||
#define object_property_get object_property_get_mipsel
|
#define object_property_get object_property_get_mipsel
|
||||||
#define object_property_get_bool object_property_get_bool_mipsel
|
#define object_property_get_bool object_property_get_bool_mipsel
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#define memory_map_ptr memory_map_ptr_powerpc
|
#define memory_map_ptr memory_map_ptr_powerpc
|
||||||
#define memory_unmap memory_unmap_powerpc
|
#define memory_unmap memory_unmap_powerpc
|
||||||
#define memory_free memory_free_powerpc
|
#define memory_free memory_free_powerpc
|
||||||
|
#define free_code_gen_buffer free_code_gen_buffer_powerpc
|
||||||
#define helper_raise_exception helper_raise_exception_powerpc
|
#define helper_raise_exception helper_raise_exception_powerpc
|
||||||
#define tcg_enabled tcg_enabled_powerpc
|
#define tcg_enabled tcg_enabled_powerpc
|
||||||
#define tcg_exec_init tcg_exec_init_powerpc
|
#define tcg_exec_init tcg_exec_init_powerpc
|
||||||
@ -2175,7 +2176,6 @@
|
|||||||
#define object_property_allow_set_link object_property_allow_set_link_powerpc
|
#define object_property_allow_set_link object_property_allow_set_link_powerpc
|
||||||
#define object_property_del object_property_del_powerpc
|
#define object_property_del object_property_del_powerpc
|
||||||
#define object_property_del_all object_property_del_all_powerpc
|
#define object_property_del_all object_property_del_all_powerpc
|
||||||
#define object_property_del_child object_property_del_child_powerpc
|
|
||||||
#define object_property_find object_property_find_powerpc
|
#define object_property_find object_property_find_powerpc
|
||||||
#define object_property_get object_property_get_powerpc
|
#define object_property_get object_property_get_powerpc
|
||||||
#define object_property_get_bool object_property_get_bool_powerpc
|
#define object_property_get_bool object_property_get_bool_powerpc
|
||||||
|
@ -371,7 +371,7 @@ static void object_property_del_all(struct uc_struct *uc, Object *obj)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void object_property_del_child(struct uc_struct *uc, Object *obj, Object *child, Error **errp)
|
void object_property_del_child(struct uc_struct *uc, Object *obj, Object *child, Error **errp)
|
||||||
{
|
{
|
||||||
ObjectProperty *prop;
|
ObjectProperty *prop;
|
||||||
|
|
||||||
|
@ -2176,7 +2176,6 @@
|
|||||||
#define object_property_allow_set_link object_property_allow_set_link_sparc
|
#define object_property_allow_set_link object_property_allow_set_link_sparc
|
||||||
#define object_property_del object_property_del_sparc
|
#define object_property_del object_property_del_sparc
|
||||||
#define object_property_del_all object_property_del_all_sparc
|
#define object_property_del_all object_property_del_all_sparc
|
||||||
#define object_property_del_child object_property_del_child_sparc
|
|
||||||
#define object_property_find object_property_find_sparc
|
#define object_property_find object_property_find_sparc
|
||||||
#define object_property_get object_property_get_sparc
|
#define object_property_get object_property_get_sparc
|
||||||
#define object_property_get_bool object_property_get_bool_sparc
|
#define object_property_get_bool object_property_get_bool_sparc
|
||||||
|
@ -2176,7 +2176,6 @@
|
|||||||
#define object_property_allow_set_link object_property_allow_set_link_sparc64
|
#define object_property_allow_set_link object_property_allow_set_link_sparc64
|
||||||
#define object_property_del object_property_del_sparc64
|
#define object_property_del object_property_del_sparc64
|
||||||
#define object_property_del_all object_property_del_all_sparc64
|
#define object_property_del_all object_property_del_all_sparc64
|
||||||
#define object_property_del_child object_property_del_child_sparc64
|
|
||||||
#define object_property_find object_property_find_sparc64
|
#define object_property_find object_property_find_sparc64
|
||||||
#define object_property_get object_property_get_sparc64
|
#define object_property_get object_property_get_sparc64
|
||||||
#define object_property_get_bool object_property_get_bool_sparc64
|
#define object_property_get_bool object_property_get_bool_sparc64
|
||||||
|
@ -2176,7 +2176,6 @@
|
|||||||
#define object_property_allow_set_link object_property_allow_set_link_x86_64
|
#define object_property_allow_set_link object_property_allow_set_link_x86_64
|
||||||
#define object_property_del object_property_del_x86_64
|
#define object_property_del object_property_del_x86_64
|
||||||
#define object_property_del_all object_property_del_all_x86_64
|
#define object_property_del_all object_property_del_all_x86_64
|
||||||
#define object_property_del_child object_property_del_child_x86_64
|
|
||||||
#define object_property_find object_property_find_x86_64
|
#define object_property_find object_property_find_x86_64
|
||||||
#define object_property_get object_property_get_x86_64
|
#define object_property_get object_property_get_x86_64
|
||||||
#define object_property_get_bool object_property_get_bool_x86_64
|
#define object_property_get_bool object_property_get_bool_x86_64
|
||||||
|
Loading…
Reference in New Issue
Block a user