arm64: handle SP register. this fixes issue #122

This commit is contained in:
Nguyen Anh Quynh 2015-09-08 08:40:42 +08:00
parent 4e9af41345
commit c1dd9fbfdf

View file

@ -51,6 +51,9 @@ int arm64_reg_read(struct uc_struct *uc, unsigned int regid, void *value)
case UC_ARM64_REG_PC:
*(uint64_t *)value = ARM_CPU(uc, mycpu)->env.pc;
break;
case UC_ARM64_REG_SP:
*(int64_t *)value = ARM_CPU(uc, mycpu)->env.xregs[31];
break;
}
}
@ -80,6 +83,9 @@ int arm64_reg_write(struct uc_struct *uc, unsigned int regid, const void *value)
case UC_ARM64_REG_PC:
ARM_CPU(uc, mycpu)->env.pc = *(uint64_t *)value;
break;
case UC_ARM64_REG_SP:
ARM_CPU(uc, mycpu)->env.xregs[31] = *(uint64_t *)value;
break;
}
}