modified the sparc reg get/set functions to use the current reg window ptr
This commit is contained in:
@@ -57,10 +57,10 @@ int sparc_reg_read(struct uc_struct *uc, unsigned int regid, void *value)
|
|||||||
*(int32_t *)value = SPARC_CPU(uc, mycpu)->env.pc;
|
*(int32_t *)value = SPARC_CPU(uc, mycpu)->env.pc;
|
||||||
break;
|
break;
|
||||||
case UC_SPARC_REG_SP:
|
case UC_SPARC_REG_SP:
|
||||||
*(int32_t *)value = SPARC_CPU(uc, mycpu)->env.regbase[6];
|
*(int32_t *)value = SPARC_CPU(uc, mycpu)->env.regwptr[6];
|
||||||
break;
|
break;
|
||||||
case UC_SPARC_REG_FP:
|
case UC_SPARC_REG_FP:
|
||||||
*(int32_t *)value = SPARC_CPU(uc, mycpu)->env.regbase[22];
|
*(int32_t *)value = SPARC_CPU(uc, mycpu)->env.regwptr[22];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,10 +88,10 @@ int sparc_reg_write(struct uc_struct *uc, unsigned int regid, const void *value)
|
|||||||
SPARC_CPU(uc, mycpu)->env.npc = *(uint32_t *)value + 4;
|
SPARC_CPU(uc, mycpu)->env.npc = *(uint32_t *)value + 4;
|
||||||
break;
|
break;
|
||||||
case UC_SPARC_REG_SP:
|
case UC_SPARC_REG_SP:
|
||||||
SPARC_CPU(uc, mycpu)->env.regbase[6] = *(uint32_t *)value;
|
SPARC_CPU(uc, mycpu)->env.regwptr[6] = *(uint32_t *)value;
|
||||||
break;
|
break;
|
||||||
case UC_SPARC_REG_FP:
|
case UC_SPARC_REG_FP:
|
||||||
SPARC_CPU(uc, mycpu)->env.regbase[22] = *(uint32_t *)value;
|
SPARC_CPU(uc, mycpu)->env.regwptr[22] = *(uint32_t *)value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,10 +40,10 @@ int sparc_reg_read(struct uc_struct *uc, unsigned int regid, void *value)
|
|||||||
*(int64_t *)value = SPARC_CPU(uc, mycpu)->env.pc;
|
*(int64_t *)value = SPARC_CPU(uc, mycpu)->env.pc;
|
||||||
break;
|
break;
|
||||||
case UC_SPARC_REG_SP:
|
case UC_SPARC_REG_SP:
|
||||||
*(int64_t *)value = SPARC_CPU(uc, mycpu)->env.regbase[6];
|
*(int64_t *)value = SPARC_CPU(uc, mycpu)->env.regwptr[6];
|
||||||
break;
|
break;
|
||||||
case UC_SPARC_REG_FP:
|
case UC_SPARC_REG_FP:
|
||||||
*(int64_t *)value = SPARC_CPU(uc, mycpu)->env.regbase[22];
|
*(int64_t *)value = SPARC_CPU(uc, mycpu)->env.regwptr[22];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,10 +71,10 @@ int sparc_reg_write(struct uc_struct *uc, unsigned int regid, const void *value)
|
|||||||
SPARC_CPU(uc, mycpu)->env.npc = *(uint64_t *)value + 8;
|
SPARC_CPU(uc, mycpu)->env.npc = *(uint64_t *)value + 8;
|
||||||
break;
|
break;
|
||||||
case UC_SPARC_REG_SP:
|
case UC_SPARC_REG_SP:
|
||||||
SPARC_CPU(uc, mycpu)->env.regbase[6] = *(uint64_t *)value;
|
SPARC_CPU(uc, mycpu)->env.regwptr[6] = *(uint64_t *)value;
|
||||||
break;
|
break;
|
||||||
case UC_SPARC_REG_FP:
|
case UC_SPARC_REG_FP:
|
||||||
SPARC_CPU(uc, mycpu)->env.regbase[22] = *(uint64_t *)value;
|
SPARC_CPU(uc, mycpu)->env.regwptr[22] = *(uint64_t *)value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user