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;
|
||||
|
||||
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);
|
||||
cpu->thread = NULL;
|
||||
}
|
||||
@ -149,17 +149,6 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
|
||||
}
|
||||
|
||||
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))
|
||||
break;
|
||||
}
|
||||
@ -170,7 +159,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
|
||||
qemu_cond_destroy(cpu->halt_cond);
|
||||
free(cpu->halt_cond);
|
||||
#ifdef _WIN32
|
||||
if(cpu->hThread)
|
||||
if (cpu->hThread)
|
||||
CloseHandle(cpu->hThread);
|
||||
#endif
|
||||
cpu->halt_cond = NULL;
|
||||
|
@ -78,17 +78,15 @@ static void release_common(void *t)
|
||||
|
||||
g_free(uc->system_memory);
|
||||
|
||||
if(uc->qemu_thread_data)
|
||||
if (uc->qemu_thread_data)
|
||||
free(uc->qemu_thread_data);
|
||||
|
||||
#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];
|
||||
if(ts->base_type == TCG_TYPE_I64)
|
||||
{
|
||||
if(ts->name && ((strcmp(ts->name+(strlen(ts->name)-2), "_0") == 0) || (strcmp(ts->name+(strlen(ts->name)-2), "_1") == 0)))
|
||||
{
|
||||
if (ts->base_type == TCG_TYPE_I64) {
|
||||
if (ts->name && ((strcmp(ts->name+(strlen(ts->name)-2), "_0") == 0) ||
|
||||
(strcmp(ts->name+(strlen(ts->name)-2), "_1") == 0))) {
|
||||
free((void *)ts->name);
|
||||
}
|
||||
}
|
||||
|
@ -107,8 +107,7 @@ int machine_initialize(struct uc_struct *uc)
|
||||
module_call_init(uc, MODULE_INIT_MACHINE);
|
||||
// this will auto initialize all register objects above.
|
||||
machine_class = find_default_machine(uc, uc->arch);
|
||||
if(!uc->machine_state)
|
||||
{
|
||||
if (!uc->machine_state) {
|
||||
if (machine_class == NULL) {
|
||||
//fprintf(stderr, "No machine specified, and there is no default.\n"
|
||||
// "Use -machine help to list supported machines!\n");
|
||||
|
Loading…
Reference in New Issue
Block a user