This commit is contained in:
lazymio
2022-01-05 19:38:22 +01:00
parent 3f64491fda
commit 7a886f59df

View File

@ -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 * to switch mode. (Those are caught by translate.c for writes
* triggered by guest instructions.) * triggered by guest instructions.)
*/ */
mask &= ~CPSR_M;
// Unicorn: No, it can also be uc_reg_write, let user switch registers banks. // Unicorn: No, it can also be uc_reg_write, let user switch registers banks.
if (write_type == CPSRWriteByUnicorn) { if (write_type == CPSRWriteByUnicorn) {
switch_mode(env, val & CPSR_M); switch_mode(env, val & CPSR_M);
} else {
mask &= ~CPSR_M;
} }
} else if (bad_mode_switch(env, val & CPSR_M, write_type)) { } else if (bad_mode_switch(env, val & CPSR_M, write_type)) {
/* Attempt to switch to an invalid mode: this is UNPREDICTABLE in /* Attempt to switch to an invalid mode: this is UNPREDICTABLE in