diff options
author | Laurent Vivier <laurent@vivier.eu> | 2018-04-11 20:56:33 +0200 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2018-04-30 09:47:55 +0200 |
commit | cd71c0896454d75e23518bbcec76abdf3cfa0772 (patch) | |
tree | dada99c8fdf6a90833d9013883412f422613fc4e /linux-user/main.c | |
parent | cb6ac802efea73605288f5d18e28611cbc97d9d2 (diff) |
linux-user: create a dummy per arch cpu_loop.c
Create a cpu_loop-common.h for future use by
these new files and use it in the existing
main.c
Introduce target_cpu_copy_regs():
declare the function in cpu_loop-common.h
and an empty function for each target,
to move all the cpu_loop prologues to this function.
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20180411185651.21351-2-laurent@vivier.eu>
Diffstat (limited to 'linux-user/main.c')
-rw-r--r-- | linux-user/main.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/linux-user/main.c b/linux-user/main.c index 8907a84114..09045f877c 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -33,9 +33,9 @@ #include "qemu/timer.h" #include "qemu/envlist.h" #include "elf.h" -#include "exec/log.h" #include "trace/control.h" #include "target_elf.h" +#include "cpu_loop-common.h" char *exec_path; @@ -50,17 +50,6 @@ unsigned long mmap_min_addr; unsigned long guest_base; int have_guest_base; -#define EXCP_DUMP(env, fmt, ...) \ -do { \ - CPUState *cs = ENV_GET_CPU(env); \ - fprintf(stderr, fmt , ## __VA_ARGS__); \ - cpu_dump_state(cs, stderr, fprintf, 0); \ - if (qemu_log_separate()) { \ - qemu_log(fmt, ## __VA_ARGS__); \ - log_cpu_state(cs, 0); \ - } \ -} while (0) - /* * When running 32-on-64 we should make sure we can fit all of the possible * guest address space into a contiguous chunk of virtual host memory. @@ -4736,6 +4725,8 @@ int main(int argc, char **argv, char **envp) tcg_prologue_init(tcg_ctx); tcg_region_init(); + target_cpu_copy_regs(env, regs); + #if defined(TARGET_I386) env->cr[0] = CR0_PG_MASK | CR0_WP_MASK | CR0_PE_MASK; env->hflags |= HF_PE_MASK | HF_CPL_MASK; @@ -5125,8 +5116,6 @@ int main(int argc, char **argv, char **envp) env->sregs[WINDOW_START] = regs->windowstart; env->pc = regs->pc; } -#else -#error unsupported target CPU #endif #if defined(TARGET_ARM) || defined(TARGET_M68K) |