Skip to content

Commit

Permalink
Fix #1525
Browse files Browse the repository at this point in the history
  • Loading branch information
wtdcode committed Jan 5, 2022
1 parent 3f64491 commit 7a886f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qemu/target/arm/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -7983,11 +7983,11 @@ void cpsr_write(CPUARMState *env, uint32_t val, uint32_t mask,
* to switch mode. (Those are caught by translate.c for writes
* triggered by guest instructions.)
*/
mask &= ~CPSR_M;

// Unicorn: No, it can also be uc_reg_write, let user switch registers banks.
if (write_type == CPSRWriteByUnicorn) {
switch_mode(env, val & CPSR_M);
} else {
mask &= ~CPSR_M;
}
} else if (bad_mode_switch(env, val & CPSR_M, write_type)) {
/* Attempt to switch to an invalid mode: this is UNPREDICTABLE in
Expand Down

0 comments on commit 7a886f5

Please sign in to comment.