mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-25 12:26:53 +00:00
cleanup
This commit is contained in:
parent
036763d6ae
commit
580bc7b56a
15
qemu/cpus.c
15
qemu/cpus.c
|
@ -77,7 +77,7 @@ void pause_all_vcpus(struct uc_struct *uc)
|
||||||
CPUState *cpu;
|
CPUState *cpu;
|
||||||
|
|
||||||
CPU_FOREACH(cpu) {
|
CPU_FOREACH(cpu) {
|
||||||
qemu_thread_join(uc, cpu->thread); // qq: fix qemu_thread_join() to work for instance
|
qemu_thread_join(uc, cpu->thread);
|
||||||
free(cpu->thread);
|
free(cpu->thread);
|
||||||
cpu->thread = NULL;
|
cpu->thread = NULL;
|
||||||
}
|
}
|
||||||
|
@ -149,17 +149,6 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
#if 0
|
|
||||||
int count = 0;
|
|
||||||
if (count < 10) {
|
|
||||||
count++;
|
|
||||||
unsigned int eip = X86_CPU(mycpu)->env.eip;
|
|
||||||
printf(">>> current EIP = %x\n", eip);
|
|
||||||
printf(">>> ECX = %x\n", (unsigned int)X86_CPU(mycpu)->env.regs[R_ECX]);
|
|
||||||
printf(">>> EDX = %x\n", (unsigned int)X86_CPU(mycpu)->env.regs[R_EDX]);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (tcg_exec_all(uc))
|
if (tcg_exec_all(uc))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -170,7 +159,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
|
||||||
qemu_cond_destroy(cpu->halt_cond);
|
qemu_cond_destroy(cpu->halt_cond);
|
||||||
free(cpu->halt_cond);
|
free(cpu->halt_cond);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if(cpu->hThread)
|
if (cpu->hThread)
|
||||||
CloseHandle(cpu->hThread);
|
CloseHandle(cpu->hThread);
|
||||||
#endif
|
#endif
|
||||||
cpu->halt_cond = NULL;
|
cpu->halt_cond = NULL;
|
||||||
|
|
|
@ -78,17 +78,15 @@ static void release_common(void *t)
|
||||||
|
|
||||||
g_free(uc->system_memory);
|
g_free(uc->system_memory);
|
||||||
|
|
||||||
if(uc->qemu_thread_data)
|
if (uc->qemu_thread_data)
|
||||||
free(uc->qemu_thread_data);
|
free(uc->qemu_thread_data);
|
||||||
|
|
||||||
#if TCG_TARGET_REG_BITS == 32
|
#if TCG_TARGET_REG_BITS == 32
|
||||||
for(int i = 0; i < s->nb_globals; i++)
|
for(int i = 0; i < s->nb_globals; i++) {
|
||||||
{
|
|
||||||
TCGTemp *ts = &s->temps[i];
|
TCGTemp *ts = &s->temps[i];
|
||||||
if(ts->base_type == TCG_TYPE_I64)
|
if (ts->base_type == TCG_TYPE_I64) {
|
||||||
{
|
if (ts->name && ((strcmp(ts->name+(strlen(ts->name)-2), "_0") == 0) ||
|
||||||
if(ts->name && ((strcmp(ts->name+(strlen(ts->name)-2), "_0") == 0) || (strcmp(ts->name+(strlen(ts->name)-2), "_1") == 0)))
|
(strcmp(ts->name+(strlen(ts->name)-2), "_1") == 0))) {
|
||||||
{
|
|
||||||
free((void *)ts->name);
|
free((void *)ts->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,8 +107,7 @@ int machine_initialize(struct uc_struct *uc)
|
||||||
module_call_init(uc, MODULE_INIT_MACHINE);
|
module_call_init(uc, MODULE_INIT_MACHINE);
|
||||||
// this will auto initialize all register objects above.
|
// this will auto initialize all register objects above.
|
||||||
machine_class = find_default_machine(uc, uc->arch);
|
machine_class = find_default_machine(uc, uc->arch);
|
||||||
if(!uc->machine_state)
|
if (!uc->machine_state) {
|
||||||
{
|
|
||||||
if (machine_class == NULL) {
|
if (machine_class == NULL) {
|
||||||
//fprintf(stderr, "No machine specified, and there is no default.\n"
|
//fprintf(stderr, "No machine specified, and there is no default.\n"
|
||||||
// "Use -machine help to list supported machines!\n");
|
// "Use -machine help to list supported machines!\n");
|
||||||
|
|
3
uc.c
3
uc.c
|
@ -277,9 +277,6 @@ uc_err uc_close(uc_engine *uc)
|
||||||
free(uc->ram_list.dirty_memory[i]);
|
free(uc->ram_list.dirty_memory[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove uc->root (created with object_new())
|
|
||||||
//uc->root->free(uc->root);
|
|
||||||
|
|
||||||
free(uc->hook_callbacks);
|
free(uc->hook_callbacks);
|
||||||
|
|
||||||
free(uc->mapped_blocks);
|
free(uc->mapped_blocks);
|
||||||
|
|
Loading…
Reference in a new issue