Merge branch 'uc_mode_fix' of https://github.com/xorstream/unicorn into xorstream-uc_mode_fix

This commit is contained in:
Nguyen Anh Quynh 2016-01-23 09:59:17 +08:00
commit b52665fae2

View file

@ -42,7 +42,6 @@ int arm_reg_read(struct uc_struct *uc, unsigned int regid, void *value)
mycpu = first_cpu; mycpu = first_cpu;
if (!(uc->mode & ~UC_MODE_ARM_MASK) {
if (regid >= UC_ARM_REG_R0 && regid <= UC_ARM_REG_R12) if (regid >= UC_ARM_REG_R0 && regid <= UC_ARM_REG_R12)
*(int32_t *)value = ARM_CPU(uc, mycpu)->env.regs[regid - UC_ARM_REG_R0]; *(int32_t *)value = ARM_CPU(uc, mycpu)->env.regs[regid - UC_ARM_REG_R0];
else { else {
@ -64,7 +63,6 @@ int arm_reg_read(struct uc_struct *uc, unsigned int regid, void *value)
break; break;
} }
} }
}
return 0; return 0;
} }
@ -78,7 +76,6 @@ int arm_reg_write(struct uc_struct *uc, unsigned int regid, const void *value)
{ {
CPUState *mycpu = first_cpu; CPUState *mycpu = first_cpu;
if (!(uc->mode & ~UC_MODE_ARM_MASK) {
if (regid >= UC_ARM_REG_R0 && regid <= UC_ARM_REG_R12) if (regid >= UC_ARM_REG_R0 && regid <= UC_ARM_REG_R12)
ARM_CPU(uc, mycpu)->env.regs[regid - UC_ARM_REG_R0] = *(uint32_t *)value; ARM_CPU(uc, mycpu)->env.regs[regid - UC_ARM_REG_R0] = *(uint32_t *)value;
else { else {
@ -97,7 +94,6 @@ int arm_reg_write(struct uc_struct *uc, unsigned int regid, const void *value)
break; break;
} }
} }
}
return 0; return 0;
} }