From: openocd-gerrit <ope...@us...> - 2025-08-09 15:01:21
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via d3c25a45f6536b09917e0fc3e6e51a6adbd4f992 (commit) from 66ea461846a3a4a96687c9287c3f61ae8ce0b775 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d3c25a45f6536b09917e0fc3e6e51a6adbd4f992 Author: Samuel Obuch <sam...@es...> Date: Tue Jul 8 22:04:08 2025 +0200 target/xtensa: fix unaligned memory read on retry When we read unaligned memory there is an offset in the albuff buffer, that we account for when copying back to original buffer. But in case the first access failed, the retry call already removed the offset, so doing it a second time shifts the returned memory. Change-Id: Ie255c367ca6a001bfe7038a76cf8a6443e398c51 Signed-off-by: Samuel Obuch <sam...@es...> Reviewed-on: https://review.openocd.org/c/openocd/+/8987 Tested-by: jenkins Reviewed-by: Ian Thompson <ia...@ca...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/xtensa/xtensa.c b/src/target/xtensa/xtensa.c index 1a402743f..f8c36b01d 100644 --- a/src/target/xtensa/xtensa.c +++ b/src/target/xtensa/xtensa.c @@ -2077,17 +2077,16 @@ int xtensa_read_memory(struct target *target, target_addr_t address, uint32_t si /* Disable fast memory access instructions and retry before reporting an error */ LOG_TARGET_DEBUG(target, "Disabling LDDR32.P/SDDR32.P"); xtensa->probe_lsddr32p = 0; - res = xtensa_read_memory(target, address, size, count, albuff); - bswap = false; + res = xtensa_read_memory(target, address, size, count, buffer); } else { LOG_TARGET_WARNING(target, "Failed reading %d bytes at address "TARGET_ADDR_FMT, count * size, address); } + } else { + if (bswap) + buf_bswap32(albuff, albuff, addrend_al - addrstart_al); + memcpy(buffer, albuff + (address & 3), (size * count)); } - - if (bswap) - buf_bswap32(albuff, albuff, addrend_al - addrstart_al); - memcpy(buffer, albuff + (address & 3), (size * count)); free(albuff); return res; } ----------------------------------------------------------------------- Summary of changes: src/target/xtensa/xtensa.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) hooks/post-receive -- Main OpenOCD repository |