fixes an issue with ARM APSR register handling: (#1317)
- Q flag / GE flag were not included in APSR register (read/write) - UC_ARM_REG_APSR_NZCV register constant was ignored completely. - regression test added
This commit is contained in:
@ -69,6 +69,9 @@ int arm_reg_read(struct uc_struct *uc, unsigned int *regs, void **vals, int coun
|
||||
else {
|
||||
switch(regid) {
|
||||
case UC_ARM_REG_APSR:
|
||||
*(int32_t *)value = cpsr_read(&ARM_CPU(uc, mycpu)->env) & (CPSR_NZCV | CPSR_Q | CPSR_GE);
|
||||
break;
|
||||
case UC_ARM_REG_APSR_NZCV:
|
||||
*(int32_t *)value = cpsr_read(&ARM_CPU(uc, mycpu)->env) & CPSR_NZCV;
|
||||
break;
|
||||
case UC_ARM_REG_CPSR:
|
||||
@ -132,6 +135,9 @@ int arm_reg_write(struct uc_struct *uc, unsigned int *regs, void* const* vals, i
|
||||
else {
|
||||
switch(regid) {
|
||||
case UC_ARM_REG_APSR:
|
||||
cpsr_write(&ARM_CPU(uc, mycpu)->env, *(uint32_t *)value, (CPSR_NZCV | CPSR_Q | CPSR_GE));
|
||||
break;
|
||||
case UC_ARM_REG_APSR_NZCV:
|
||||
cpsr_write(&ARM_CPU(uc, mycpu)->env, *(uint32_t *)value, CPSR_NZCV);
|
||||
break;
|
||||
case UC_ARM_REG_CPSR:
|
||||
|
Reference in New Issue
Block a user