diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-06-13 15:33:41 +0200 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2023-06-20 10:01:30 +0200 |
commit | 6a14058677dd2af838f0b2daa9896ce569259a57 (patch) | |
tree | 4f04f3c56aa5be315f86c65c1a257b4cf47a1c74 /target/m68k/cpu.c | |
parent | 66352d7ef2e304047006ee1e2dab08d01518f1c4 (diff) | |
download | qemu-6a14058677dd2af838f0b2daa9896ce569259a57.zip qemu-6a14058677dd2af838f0b2daa9896ce569259a57.tar.gz qemu-6a14058677dd2af838f0b2daa9896ce569259a57.tar.bz2 |
target/m68k: Check for USER_ONLY definition instead of SOFTMMU one
Since we *might* have user emulation with softmmu,
replace the system emulation check by !user emulation one.
Invert some if() ladders for clarity.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230613133347.82210-4-philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/m68k/cpu.c')
-rw-r--r-- | target/m68k/cpu.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 99af1ab..70d5847 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -80,10 +80,10 @@ static void m68k_cpu_reset_hold(Object *obj) } memset(env, 0, offsetof(CPUM68KState, end_reset_fields)); -#ifdef CONFIG_SOFTMMU - cpu_m68k_set_sr(env, SR_S | SR_I); -#else +#ifdef CONFIG_USER_ONLY cpu_m68k_set_sr(env, 0); +#else + cpu_m68k_set_sr(env, SR_S | SR_I); #endif for (i = 0; i < 8; i++) { env->fregs[i].d = nan; @@ -334,7 +334,7 @@ static void m68k_cpu_initfn(Object *obj) cpu_set_cpustate_pointers(cpu); } -#if defined(CONFIG_SOFTMMU) +#if !defined(CONFIG_USER_ONLY) static bool fpu_needed(void *opaque) { M68kCPU *s = opaque; @@ -525,15 +525,13 @@ static const VMStateDescription vmstate_m68k_cpu = { NULL }, }; -#endif -#ifndef CONFIG_USER_ONLY #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps m68k_sysemu_ops = { .get_phys_page_debug = m68k_cpu_get_phys_page_debug, }; -#endif +#endif /* !CONFIG_USER_ONLY */ #include "hw/core/tcg-cpu-ops.h" @@ -568,7 +566,7 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) cc->get_pc = m68k_cpu_get_pc; cc->gdb_read_register = m68k_cpu_gdb_read_register; cc->gdb_write_register = m68k_cpu_gdb_write_register; -#if defined(CONFIG_SOFTMMU) +#if !defined(CONFIG_USER_ONLY) dc->vmsd = &vmstate_m68k_cpu; cc->sysemu_ops = &m68k_sysemu_ops; #endif |