Skip to content

Commit

Permalink
i#1569 AArch64: Make drreg work.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Zhou authored and egrimley-arm committed Jul 11, 2016
1 parent a9f37bd commit dea5f2e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ext/drreg/drreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,10 @@ drreg_reserve_reg_internal(void *drcontext, instrlist_t *ilist, instr_t *where,
continue;
if (reg == dr_get_stolen_reg()
IF_ARM(|| reg == DR_REG_PC)
/* Avoid xsp, even if it appears dead in things like OP_sysenter */
IF_X86(|| reg == DR_REG_XSP))
/* Avoid xsp, even if it appears dead in things like OP_sysenter.
* On AArch64 use of SP is very restricted.
*/
IF_NOT_ARM(|| reg == DR_REG_XSP))
continue;
if (reg_allowed != NULL && drvector_get_entry(reg_allowed, idx) == NULL)
continue;
Expand Down Expand Up @@ -1002,7 +1004,7 @@ drreg_spill_aflags(void *drcontext, instrlist_t *ilist, instr_t *where, per_thre
drvector_get_entry(&pt->reg[DR_REG_XAX-DR_REG_START_GPR].live, pt->live_idx) ==
REG_LIVE)
restore_reg(drcontext, pt, DR_REG_XAX, temp_slot, ilist, where, true);
#elif defined(ARM)
#elif defined(AARCHXX)
drreg_status_t res = DRREG_SUCCESS;
reg_id_t scratch;
res = drreg_reserve_reg_internal(drcontext, ilist, where, NULL, false, &scratch);
Expand Down Expand Up @@ -1046,7 +1048,7 @@ drreg_restore_aflags(void *drcontext, instrlist_t *ilist, instr_t *where,
drvector_get_entry(&pt->reg[DR_REG_XAX-DR_REG_START_GPR].live, pt->live_idx) ==
REG_LIVE)
restore_reg(drcontext, pt, DR_REG_XAX, temp_slot, ilist, where, true);
#elif defined(ARM)
#elif defined(AARCHXX)
drreg_status_t res = DRREG_SUCCESS;
reg_id_t scratch;
res = drreg_reserve_reg_internal(drcontext, ilist, where, NULL, false, &scratch);
Expand Down

0 comments on commit dea5f2e

Please sign in to comment.