From 4bad9e392e788a218967167a38ce2ae7a32a6231 Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Tue, 23 Jun 2015 19:31:18 -0700 Subject: cpu: Change cpu_exec_init() arg to cpu, not env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The callers (most of them in target-foo/cpu.c) to this function all have the cpu pointer handy. Just pass it to avoid an ENV_GET_CPU() from core code (in exec.c). Cc: Paolo Bonzini Cc: Richard Henderson Cc: Peter Maydell Cc: "Edgar E. Iglesias" Cc: Eduardo Habkost Cc: Michael Walle Cc: Leon Alrae Cc: Anthony Green Cc: Jia Liu Cc: Alexander Graf Cc: Blue Swirl Cc: Mark Cave-Ayland Cc: Bastian Koppelmann Cc: Guan Xuetao Cc: Max Filippov Reviewed-by: Andreas Färber Reviewed-by: Aurelien Jarno Signed-off-by: Peter Crosthwaite Signed-off-by: Andreas Färber --- exec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'exec.c') diff --git a/exec.c b/exec.c index b92c74d..7d60e15 100644 --- a/exec.c +++ b/exec.c @@ -571,9 +571,8 @@ void cpu_exec_exit(CPUState *cpu) } #endif -void cpu_exec_init(CPUArchState *env, Error **errp) +void cpu_exec_init(CPUState *cpu, Error **errp) { - CPUState *cpu = ENV_GET_CPU(env); CPUClass *cc = CPU_GET_CLASS(cpu); int cpu_index; Error *local_err = NULL; @@ -604,7 +603,7 @@ void cpu_exec_init(CPUArchState *env, Error **errp) } #if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY) register_savevm(NULL, "cpu", cpu_index, CPU_SAVE_VERSION, - cpu_save, cpu_load, env); + cpu_save, cpu_load, cpu->env_ptr); assert(cc->vmsd == NULL); assert(qdev_get_vmsd(DEVICE(cpu)) == NULL); #endif -- cgit v1.1