remove redundant uc_struct.ram

This commit is contained in:
Nguyen Anh Quynh 2015-08-30 10:51:28 +08:00
parent b4d7347fa8
commit c23d387e2f
2 changed files with 4 additions and 5 deletions

View File

@ -95,7 +95,6 @@ struct uc_struct {
void* cpu;
MemoryRegion *system_memory; // qemu/exec.c
MemoryRegion *ram;
MemoryRegion io_mem_rom; // qemu/exec.c
MemoryRegion io_mem_notdirty; // qemu/exec.c
MemoryRegion io_mem_unassigned; // qemu/exec.c

View File

@ -33,16 +33,16 @@
// Unicorn engine
MemoryRegion *memory_map(struct uc_struct *uc, ram_addr_t begin, size_t size, uint32_t perms)
{
uc->ram = g_new(MemoryRegion, 1);
MemoryRegion *ram = g_new(MemoryRegion, 1);
memory_region_init_ram(uc, uc->ram, NULL, "pc.ram", size, perms, &error_abort);
memory_region_init_ram(uc, ram, NULL, "pc.ram", size, perms, &error_abort);
memory_region_add_subregion(get_system_memory(uc), begin, uc->ram);
memory_region_add_subregion(get_system_memory(uc), begin, ram);
if (uc->current_cpu)
tlb_flush(uc->current_cpu, 1);
return uc->ram;
return ram;
}
int memory_free(struct uc_struct *uc)