mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-09 00:55:31 +00:00
cpu: Change tcg_cpu_exec() arg to cpu, not env
The sole caller of this function navigates the cpu->env_ptr only for this function to take it back the cpu pointer straight away. Pass in cpu pointer instead and grab the env pointer locally in the function. Removes a core code usage of ENV_GET_CPU(). Backports commit 3d57f7893c90d911d786cb2c622b0926fc808b57 from qemu
This commit is contained in:
parent
8200453545
commit
50b6fa93a8
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
static bool cpu_can_run(CPUState *cpu);
|
static bool cpu_can_run(CPUState *cpu);
|
||||||
static void cpu_handle_guest_debug(CPUState *cpu);
|
static void cpu_handle_guest_debug(CPUState *cpu);
|
||||||
static int tcg_cpu_exec(struct uc_struct *uc, CPUArchState *env);
|
static int tcg_cpu_exec(struct uc_struct *uc, CPUState *cpu);
|
||||||
static bool tcg_exec_all(struct uc_struct* uc);
|
static bool tcg_exec_all(struct uc_struct* uc);
|
||||||
static int qemu_tcg_init_vcpu(CPUState *cpu);
|
static int qemu_tcg_init_vcpu(CPUState *cpu);
|
||||||
static void *qemu_tcg_cpu_loop(struct uc_struct *uc);
|
static void *qemu_tcg_cpu_loop(struct uc_struct *uc);
|
||||||
|
@ -115,8 +115,9 @@ static int qemu_tcg_init_vcpu(CPUState *cpu)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcg_cpu_exec(struct uc_struct *uc, CPUArchState *env)
|
static int tcg_cpu_exec(struct uc_struct *uc, CPUState *cpu)
|
||||||
{
|
{
|
||||||
|
CPUArchState *env = cpu->env_ptr;
|
||||||
return cpu_exec(uc, env);
|
return cpu_exec(uc, env);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +133,7 @@ static bool tcg_exec_all(struct uc_struct* uc)
|
||||||
// (cpu->singlestep_enabled & SSTEP_NOTIMER) == 0);
|
// (cpu->singlestep_enabled & SSTEP_NOTIMER) == 0);
|
||||||
if (cpu_can_run(cpu)) {
|
if (cpu_can_run(cpu)) {
|
||||||
uc->quit_request = false;
|
uc->quit_request = false;
|
||||||
r = tcg_cpu_exec(uc, env);
|
r = tcg_cpu_exec(uc, cpu);
|
||||||
|
|
||||||
// quit current TB but continue emulating?
|
// quit current TB but continue emulating?
|
||||||
if (uc->quit_request) {
|
if (uc->quit_request) {
|
||||||
|
|
Loading…
Reference in a new issue