fix HI/LO register read/write issue in MIPS (#1319)

* fix HI/LO register read/write issue in MIPS

* fix typo
This commit is contained in:
Jhe 2020-09-21 10:40:01 +08:00 committed by GitHub
parent 473405797d
commit 19f8991cbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,6 +100,10 @@ int mips_reg_read(struct uc_struct *uc, unsigned int *regs, void **vals, int cou
case UC_MIPS_REG_CP0_USERLOCAL:
*(mipsreg_t *)value = MIPS_CPU(uc, mycpu)->env.active_tc.CP0_UserLocal;
break;
case UC_MIPS_REG_HI:
*(mipsreg_t *)value = MIPS_CPU(uc, mycpu)->env.active_tc.HI[0];
case UC_MIPS_REG_LO:
*(mipsreg_t *)value = MIPS_CPU(uc, mycpu)->env.active_tc.LO[0];
}
}
}
@ -132,6 +136,12 @@ int mips_reg_write(struct uc_struct *uc, unsigned int *regs, void *const *vals,
case UC_MIPS_REG_CP0_USERLOCAL:
MIPS_CPU(uc, mycpu)->env.active_tc.CP0_UserLocal = *(mipsreg_t *)value;
break;
case UC_MIPS_REG_HI:
MIPS_CPU(uc, mycpu)->env.active_tc.HI[0] = *(mipsreg_t *)value;
break;
case UC_MIPS_REG_LO:
MIPS_CPU(uc, mycpu)->env.active_tc.LO[0] = *(mipsreg_t *)value;
break;
}
}
}