summaryrefslogtreecommitdiff
path: root/src/target/arm_dpm.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2010-02-21 14:34:33 -0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2010-02-21 14:34:33 -0800
commit1aac72d24339380f6e98c50dec4c96ab30537749 (patch)
treeefd8b83082f072d807f168eabf415e1002cf5425 /src/target/arm_dpm.c
parenta299371a9ec109da3851cb43aed3e9157d095358 (diff)
downloadopenocd+libswd-1aac72d24339380f6e98c50dec4c96ab30537749.tar.gz
openocd+libswd-1aac72d24339380f6e98c50dec4c96ab30537749.tar.bz2
openocd+libswd-1aac72d24339380f6e98c50dec4c96ab30537749.tar.xz
openocd+libswd-1aac72d24339380f6e98c50dec4c96ab30537749.zip
ARM: keep a handle to the PC
Keep a handle to the PC in "struct arm", and use it. This register is used a fair amount, so this is a net minor code shrink (other than some line length fixes), but mostly it's to make things more readable. For XScale, fix a dodgy sequence while stepping. It was initializing a variable to a non-NULL value, then updating it to handle the step-over-active-breakpoint case, and then later testing for non-NULL to see if it should reverse that step-over-active logic. It should have done like ARM7/ARM9 does: init to NULL. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/target/arm_dpm.c')
-rw-r--r--src/target/arm_dpm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/target/arm_dpm.c b/src/target/arm_dpm.c
index 0b5e2558..8e8cc17a 100644
--- a/src/target/arm_dpm.c
+++ b/src/target/arm_dpm.c
@@ -453,8 +453,8 @@ int arm_dpm_write_dirty_registers(struct arm_dpm *dpm, bool bpwp)
retval = dpm_modeswitch(dpm, ARM_MODE_ANY);
arm->cpsr->dirty = false;
- retval = dpm_write_reg(dpm, &cache->reg_list[15], 15);
- cache->reg_list[15].dirty = false;
+ retval = dpm_write_reg(dpm, arm->pc, 15);
+ arm->pc->dirty = false;
/* flush R0 -- it's *very* dirty by now */
retval = dpm_write_reg(dpm, &cache->reg_list[0], 0);