aboutsummaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2014-03-19 08:20:36 -0700
committerPaul Fertser <fercerpav@gmail.com>2014-03-29 07:18:09 +0000
commit947a459e188994bf247f3582f18e6cb3eefb217b (patch)
tree8839ad02e6f504b299b8af694bc720dd1cab8adc /src/target
parent91a36fcf0a8f1f44cb74ffdddb04c46f732b8a4b (diff)
downloadriscv-openocd-947a459e188994bf247f3582f18e6cb3eefb217b.zip
riscv-openocd-947a459e188994bf247f3582f18e6cb3eefb217b.tar.gz
riscv-openocd-947a459e188994bf247f3582f18e6cb3eefb217b.tar.bz2
armv7m: Do not ignore 'value' parameter in armv7m_write_core_reg
Ignoring the value parameter in that function makes its code rather misleading. Also the only caller of it, armv7m_restore_context already does the whole "buf_get_u32" conversion business, so using 'value' also removes the waste of doing the conversion twice. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Change-Id: I515979c314d9b59ee1065c55b5bb5747c7e93f01 Reviewed-on: http://openocd.zylin.com/2057 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/target')
-rw-r--r--src/target/armv7m.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/target/armv7m.c b/src/target/armv7m.c
index 7716139..130504c 100644
--- a/src/target/armv7m.c
+++ b/src/target/armv7m.c
@@ -216,24 +216,22 @@ static int armv7m_write_core_reg(struct target *target, struct reg *r,
int num, enum arm_mode mode, uint32_t value)
{
int retval;
- uint32_t reg_value;
struct arm_reg *armv7m_core_reg;
struct armv7m_common *armv7m = target_to_armv7m(target);
assert(num < (int)armv7m->arm.core_cache->num_regs);
- reg_value = buf_get_u32(armv7m->arm.core_cache->reg_list[num].value, 0, 32);
armv7m_core_reg = armv7m->arm.core_cache->reg_list[num].arch_info;
retval = armv7m->store_core_reg_u32(target,
- armv7m_core_reg->num,
- reg_value);
+ armv7m_core_reg->num,
+ value);
if (retval != ERROR_OK) {
LOG_ERROR("JTAG failure");
armv7m->arm.core_cache->reg_list[num].dirty = armv7m->arm.core_cache->reg_list[num].valid;
return ERROR_JTAG_DEVICE_ERROR;
}
- LOG_DEBUG("write core reg %i value 0x%" PRIx32 "", num, reg_value);
+ LOG_DEBUG("write core reg %i value 0x%" PRIx32 "", num, value);
armv7m->arm.core_cache->reg_list[num].valid = 1;
armv7m->arm.core_cache->reg_list[num].dirty = 0;