Compare commits

...

1 Commits

Author SHA1 Message Date
MerryMage
f4e2494bc0 arm_unicorn: Load/Save FPCR and FPSR to/from context 2018-12-17 22:48:25 +00:00
2 changed files with 5 additions and 1 deletions

View File

@@ -211,6 +211,8 @@ void ARM_Unicorn::SaveContext(ThreadContext& ctx) {
CHECKED(uc_reg_read(uc, UC_ARM64_REG_SP, &ctx.sp));
CHECKED(uc_reg_read(uc, UC_ARM64_REG_PC, &ctx.pc));
CHECKED(uc_reg_read(uc, UC_ARM64_REG_NZCV, &ctx.pstate));
CHECKED(uc_reg_read(uc, UC_ARM64_REG_FPCR, &ctx.fpcr));
CHECKED(uc_reg_read(uc, UC_ARM64_REG_FPSR, &ctx.fpsr));
for (auto i = 0; i < 29; ++i) {
uregs[i] = UC_ARM64_REG_X0 + i;
@@ -238,6 +240,8 @@ void ARM_Unicorn::LoadContext(const ThreadContext& ctx) {
CHECKED(uc_reg_write(uc, UC_ARM64_REG_SP, &ctx.sp));
CHECKED(uc_reg_write(uc, UC_ARM64_REG_PC, &ctx.pc));
CHECKED(uc_reg_write(uc, UC_ARM64_REG_NZCV, &ctx.pstate));
CHECKED(uc_reg_write(uc, UC_ARM64_REG_FPCR, &ctx.fpcr));
CHECKED(uc_reg_write(uc, UC_ARM64_REG_FPSR, &ctx.fpsr));
for (int i = 0; i < 29; ++i) {
uregs[i] = UC_ARM64_REG_X0 + i;