target/armv8: fix 128-bit register writes
Assert checking was recently added to the "buf_get_u64()" procedure for the buffer size argument. For 128-bit register writes, instead of calling "buf_get_u64()" with a 128-bit argument which fails the assert check, use two 64-bit calls. Change-Id: I32ddbdb7bbe68c43f3b0a27738537391a227b08c Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8801 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
committed by
Antonio Borneo
parent
b2016dc443
commit
f5dd564a7b
@@ -1686,12 +1686,12 @@ static int armv8_set_core_reg(struct reg *reg, uint8_t *buf)
|
||||
struct arm_reg *armv8_reg = reg->arch_info;
|
||||
struct target *target = armv8_reg->target;
|
||||
struct arm *arm = target_to_arm(target);
|
||||
uint64_t value = buf_get_u64(buf, 0, reg->size);
|
||||
|
||||
if (target->state != TARGET_HALTED)
|
||||
return ERROR_TARGET_NOT_HALTED;
|
||||
|
||||
if (reg->size <= 64) {
|
||||
uint64_t value = buf_get_u64(buf, 0, reg->size);
|
||||
if (reg == arm->cpsr)
|
||||
armv8_set_cpsr(arm, (uint32_t)value);
|
||||
else {
|
||||
@@ -1699,6 +1699,7 @@ static int armv8_set_core_reg(struct reg *reg, uint8_t *buf)
|
||||
reg->valid = true;
|
||||
}
|
||||
} else if (reg->size <= 128) {
|
||||
uint64_t value = buf_get_u64(buf, 0, 64);
|
||||
uint64_t hvalue = buf_get_u64(buf + 8, 0, reg->size - 64);
|
||||
|
||||
buf_set_u64(reg->value, 0, 64, value);
|
||||
|
||||
Reference in New Issue
Block a user