From a63a34bfbcb44a1fa02358257c09796564a64493 Mon Sep 17 00:00:00 2001 From: Agustin Gianni Date: Thu, 5 Jan 2017 00:00:15 +0100 Subject: [PATCH] Allow the client to write to CPSR --- qemu/target-arm/unicorn_arm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu/target-arm/unicorn_arm.c b/qemu/target-arm/unicorn_arm.c index 9e7cf575..69f7363a 100644 --- a/qemu/target-arm/unicorn_arm.c +++ b/qemu/target-arm/unicorn_arm.c @@ -98,6 +98,9 @@ int arm_reg_write(struct uc_struct *uc, unsigned int *regs, void* const* vals, i ARM_CPU(uc, mycpu)->env.vfp.regs[regid - UC_ARM_REG_D0] = *(float64 *)value; else { switch(regid) { + case UC_ARM_REG_CPSR: + cpsr_write(&ARM_CPU(uc, mycpu)->env, *(uint32_t *)value, ~0); + break; //case UC_ARM_REG_SP: case UC_ARM_REG_R13: ARM_CPU(uc, mycpu)->env.regs[13] = *(uint32_t *)value;