From cffe7b3249319003d776481b8a4b72d35db71355 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sat, 13 Sep 2014 09:45:12 -0700 Subject: qom: Add cpu_exec_enter and cpu_exec_exit hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In preparation for removing a bunch of ifdefs from cpu_exec. Cc: Andreas Färber Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Message-id: 1410626734-3804-2-git-send-email-rth@twiddle.net Signed-off-by: Peter Maydell --- cpu-exec.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'cpu-exec.c') diff --git a/cpu-exec.c b/cpu-exec.c index bd93165..d5b86d0 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -317,10 +317,7 @@ volatile sig_atomic_t exit_request; int cpu_exec(CPUArchState *env) { CPUState *cpu = ENV_GET_CPU(env); -#if !(defined(CONFIG_USER_ONLY) && \ - (defined(TARGET_M68K) || defined(TARGET_PPC) || defined(TARGET_S390X))) CPUClass *cc = CPU_GET_CLASS(cpu); -#endif #ifdef TARGET_I386 X86CPU *x86_cpu = X86_CPU(cpu); #endif @@ -382,9 +379,8 @@ int cpu_exec(CPUArchState *env) #elif defined(TARGET_XTENSA) #elif defined(TARGET_TRICORE) /* XXXXX */ -#else -#error unsupported target CPU #endif + cc->cpu_exec_enter(cpu); cpu->exception_index = -1; /* Calculate difference between guest clock and host clock. @@ -856,9 +852,8 @@ int cpu_exec(CPUArchState *env) #elif defined(TARGET_S390X) #elif defined(TARGET_XTENSA) /* XXXXX */ -#else -#error unsupported target CPU #endif + cc->cpu_exec_exit(cpu); /* fail safe : never use current_cpu outside cpu_exec() */ current_cpu = NULL; -- cgit v1.1