fix(arm): correct write to ARM coprocessor (#2099)

This code was commented out since 2021, but by default, the error
codewas initialized to `UC_REG_OK`, so there was no error returned
untila result, any write to `UC_ARM_REG_C1_C0_2` returned an error.
This commit is contained in:
Amaan Qureshi
2025-02-13 06:25:26 -05:00
committed by GitHub
parent 967dbc4179
commit 6b9c1c851c
2 changed files with 26 additions and 4 deletions

View File

@@ -440,10 +440,10 @@ uc_err reg_write(void *_env, int mode, unsigned int regid, const void *value,
env->regs[15] = (*(uint32_t *)value & ~1);
*setpc = 1;
break;
// case UC_ARM_REG_C1_C0_2:
// env->cp15.c1_coproc = *(int32_t *)value;
// break;
case UC_ARM_REG_C1_C0_2:
CHECK_REG_TYPE(int32_t);
env->cp15.cpacr_el1 = *(int32_t *)value;
break;
case UC_ARM_REG_C13_C0_3:
CHECK_REG_TYPE(int32_t);
env->cp15.tpidrro_el[0] = *(int32_t *)value;