mips: support reading and writing of hi/lo regs

This commit is contained in:
George Hotz 2021-10-27 13:00:14 -07:00 committed by lazymio
parent 8732cff287
commit 7268c2a19b
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873
1 changed files with 12 additions and 0 deletions

View File

@ -77,6 +77,12 @@ static void reg_read(CPUMIPSState *env, unsigned int regid, void *value)
switch (regid) {
default:
break;
case UC_MIPS_REG_HI:
*(mipsreg_t *)value = env->active_tc.HI[0];
break;
case UC_MIPS_REG_LO:
*(mipsreg_t *)value = env->active_tc.LO[0];
break;
case UC_MIPS_REG_PC:
*(mipsreg_t *)value = env->active_tc.PC;
break;
@ -103,6 +109,12 @@ static void reg_write(CPUMIPSState *env, unsigned int regid, const void *value)
switch (regid) {
default:
break;
case UC_MIPS_REG_HI:
env->active_tc.HI[0] = *(mipsreg_t *)value;
break;
case UC_MIPS_REG_LO:
env->active_tc.LO[0] = *(mipsreg_t *)value;
break;
case UC_MIPS_REG_PC:
env->active_tc.PC = *(mipsreg_t *)value;
break;