diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-04-16 10:11:17 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-04-16 10:11:17 +0100 |
commit | ae2b1b4e1bb89ea949446597c8776255da0a79d3 (patch) | |
tree | 41ea1c0f801547d89d13ce9587bc39509f377867 | |
parent | 801bc56336a127d9b351b3a2cc0336e4d0cb2686 (diff) | |
parent | 000761dc0c97d70e7314db3e8f52783880325a22 (diff) |
Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.12-pull-request' into staging
# gpg: Signature made Sun 15 Apr 2018 10:45:59 BST
# gpg: using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>"
# gpg: aka "Laurent Vivier <laurent@vivier.eu>"
# gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C
* remotes/vivier/tags/m68k-for-2.12-pull-request:
m68k: fix exception stack frame for 68000
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | target/m68k/op_helper.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index 3a7f7f2219..8d09ed91c4 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -287,22 +287,25 @@ static inline void do_stack_frame(CPUM68KState *env, uint32_t *sp, uint16_t format, uint16_t sr, uint32_t addr, uint32_t retaddr) { - CPUState *cs = CPU(m68k_env_get_cpu(env)); - switch (format) { - case 4: - *sp -= 4; - cpu_stl_kernel(env, *sp, env->pc); - *sp -= 4; - cpu_stl_kernel(env, *sp, addr); - break; - case 3: - case 2: - *sp -= 4; - cpu_stl_kernel(env, *sp, addr); - break; + if (m68k_feature(env, M68K_FEATURE_QUAD_MULDIV)) { + /* all except 68000 */ + CPUState *cs = CPU(m68k_env_get_cpu(env)); + switch (format) { + case 4: + *sp -= 4; + cpu_stl_kernel(env, *sp, env->pc); + *sp -= 4; + cpu_stl_kernel(env, *sp, addr); + break; + case 3: + case 2: + *sp -= 4; + cpu_stl_kernel(env, *sp, addr); + break; + } + *sp -= 2; + cpu_stw_kernel(env, *sp, (format << 12) + (cs->exception_index << 2)); } - *sp -= 2; - cpu_stw_kernel(env, *sp, (format << 12) + (cs->exception_index << 2)); *sp -= 4; cpu_stl_kernel(env, *sp, retaddr); *sp -= 2; |