This commit is contained in:
lazymio 2022-01-05 19:38:22 +01:00
parent 3f64491fda
commit 7a886f59df
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873
1 changed files with 2 additions and 2 deletions

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
* 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