Commit 0cf5c6771b216793d1fe57d25864d842570f32f6
1 parent
87ee1669
M68K status register fixes.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2967 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
6 additions
and
8 deletions
target-m68k/op.c
| @@ -338,10 +338,7 @@ OP(ext16s32) | @@ -338,10 +338,7 @@ OP(ext16s32) | ||
| 338 | 338 | ||
| 339 | OP(flush_flags) | 339 | OP(flush_flags) |
| 340 | { | 340 | { |
| 341 | - int cc_op = PARAM1; | ||
| 342 | - if (cc_op == CC_OP_DYNAMIC) | ||
| 343 | - cc_op = env->cc_op; | ||
| 344 | - cpu_m68k_flush_flags(env, cc_op); | 341 | + cpu_m68k_flush_flags(env, env->cc_op); |
| 345 | FORCE_RET(); | 342 | FORCE_RET(); |
| 346 | } | 343 | } |
| 347 | 344 | ||
| @@ -480,7 +477,7 @@ OP(fp_result) | @@ -480,7 +477,7 @@ OP(fp_result) | ||
| 480 | 477 | ||
| 481 | OP(set_sr) | 478 | OP(set_sr) |
| 482 | { | 479 | { |
| 483 | - env->sr = get_op(PARAM1); | 480 | + env->sr = get_op(PARAM1) & 0xffff; |
| 484 | m68k_switch_sp(env); | 481 | m68k_switch_sp(env); |
| 485 | FORCE_RET(); | 482 | FORCE_RET(); |
| 486 | } | 483 | } |
target-m68k/op_helper.c
| @@ -131,6 +131,8 @@ void do_interrupt(int is_hw) | @@ -131,6 +131,8 @@ void do_interrupt(int is_hw) | ||
| 131 | 131 | ||
| 132 | vector = env->exception_index << 2; | 132 | vector = env->exception_index << 2; |
| 133 | 133 | ||
| 134 | + sp = env->aregs[7]; | ||
| 135 | + | ||
| 134 | fmt |= 0x40000000; | 136 | fmt |= 0x40000000; |
| 135 | fmt |= (sp & 3) << 28; | 137 | fmt |= (sp & 3) << 28; |
| 136 | fmt |= vector << 16; | 138 | fmt |= vector << 16; |
| @@ -143,8 +145,6 @@ void do_interrupt(int is_hw) | @@ -143,8 +145,6 @@ void do_interrupt(int is_hw) | ||
| 143 | } | 145 | } |
| 144 | m68k_switch_sp(env); | 146 | m68k_switch_sp(env); |
| 145 | 147 | ||
| 146 | - sp = env->aregs[7]; | ||
| 147 | - | ||
| 148 | /* ??? This could cause MMU faults. */ | 148 | /* ??? This could cause MMU faults. */ |
| 149 | sp &= ~3; | 149 | sp &= ~3; |
| 150 | sp -= 4; | 150 | sp -= 4; |
target-m68k/translate.c
| @@ -345,7 +345,8 @@ static inline void gen_flush_flags(DisasContext *s) | @@ -345,7 +345,8 @@ static inline void gen_flush_flags(DisasContext *s) | ||
| 345 | { | 345 | { |
| 346 | if (s->cc_op == CC_OP_FLAGS) | 346 | if (s->cc_op == CC_OP_FLAGS) |
| 347 | return; | 347 | return; |
| 348 | - gen_op_flush_flags(s->cc_op); | 348 | + gen_flush_cc_op(s); |
| 349 | + gen_op_flush_flags(); | ||
| 349 | s->cc_op = CC_OP_FLAGS; | 350 | s->cc_op = CC_OP_FLAGS; |
| 350 | } | 351 | } |
| 351 | 352 |