[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 6/8] cpus: Change tcg_cpu_exec arg to cpu, not en
From: |
Peter Crosthwaite |
Subject: |
[Qemu-devel] [PATCH v3 6/8] cpus: Change tcg_cpu_exec arg to cpu, not env |
Date: |
Thu, 18 Jun 2015 10:24:53 -0700 |
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().
Reviewed-by: Andreas Färber <address@hidden>
Signed-off-by: Peter Crosthwaite <address@hidden>
---
Changed since v1:
Add () to ENV_GET_CPU() in commit message
---
cpus.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/cpus.c b/cpus.c
index b85fb5f..131fa3b 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1343,9 +1343,9 @@ int vm_stop_force_state(RunState state)
}
}
-static int tcg_cpu_exec(CPUArchState *env)
+static int tcg_cpu_exec(CPUState *cpu)
{
- CPUState *cpu = ENV_GET_CPU(env);
+ CPUArchState *env = cpu->env_ptr;
int ret;
#ifdef CONFIG_PROFILER
int64_t ti;
@@ -1407,13 +1407,12 @@ static void tcg_exec_all(void)
}
for (; next_cpu != NULL && !exit_request; next_cpu = CPU_NEXT(next_cpu)) {
CPUState *cpu = next_cpu;
- CPUArchState *env = cpu->env_ptr;
qemu_clock_enable(QEMU_CLOCK_VIRTUAL,
(cpu->singlestep_enabled & SSTEP_NOTIMER) == 0);
if (cpu_can_run(cpu)) {
- r = tcg_cpu_exec(env);
+ r = tcg_cpu_exec(cpu);
if (r == EXCP_DEBUG) {
cpu_handle_guest_debug(cpu);
break;
--
1.9.1
- [Qemu-devel] [PATCH v3 0/8] More core code ENV_GET_CPU removals, Peter Crosthwaite, 2015/06/18
- [Qemu-devel] [PATCH v3 1/8] cpus: Add Error argument to cpu_exec_init(), Peter Crosthwaite, 2015/06/18
- [Qemu-devel] [PATCH v3 3/8] ppc: Move cpu_exec_init() call to realize function, Peter Crosthwaite, 2015/06/18
- [Qemu-devel] [PATCH v3 5/8] gdbserver: _fork: Change fn to accept cpu instead of env, Peter Crosthwaite, 2015/06/18
- [Qemu-devel] [PATCH v3 4/8] translate-all: Change tb_flush() env argument to cpu, Peter Crosthwaite, 2015/06/18
- [Qemu-devel] [PATCH v3 6/8] cpus: Change tcg_cpu_exec arg to cpu, not env,
Peter Crosthwaite <=
- [Qemu-devel] [PATCH v3 2/8] cpus: Convert cpu_index into a bitmap, Peter Crosthwaite, 2015/06/18
- [Qemu-devel] [PATCH v3 7/8] cpus: Change exec_init() arg to cpu, not env, Peter Crosthwaite, 2015/06/18
- [Qemu-devel] [PATCH v3 8/8] cpu-exec: Purge all uses of ENV_GET_CPU(), Peter Crosthwaite, 2015/06/18