From: openocd-gerrit <ope...@us...> - 2024-06-23 09:28:37
|
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 bcd6a1022322f67f25f74af2dfe40d440d382e74 (commit) via 91043cecee396209bd4d616fe6e78d835bebd978 (commit) from c5358c84ad0d3e7497498e0457cec7785f72910a (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 bcd6a1022322f67f25f74af2dfe40d440d382e74 Author: Antonio Borneo <bor...@gm...> Date: Mon May 13 17:20:52 2024 +0200 target: armv8_dpm: silence error on register R/W The command 'gdb_report_register_access_error' is used to silence errors while reading registers and not reporting them to GDB. Nevertheless, the error is printed by a LOG_ERROR() in armv8_dpm. Change the message to LOG_DEBUG(). It will still cause the error to be propagated and eventually printed by the caller (e.g. by the command 'reg'). Change-Id: Ic0db74fa28235d686ddd21a5960c52ae003e0931 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8267 Tested-by: jenkins diff --git a/src/target/armv8_dpm.c b/src/target/armv8_dpm.c index 8bb24f225..271bd91c3 100644 --- a/src/target/armv8_dpm.c +++ b/src/target/armv8_dpm.c @@ -677,7 +677,7 @@ static int dpmv8_read_reg(struct arm_dpm *dpm, struct reg *r, unsigned regnum) } if (retval != ERROR_OK) - LOG_ERROR("Failed to read %s register", r->name); + LOG_DEBUG("Failed to read %s register", r->name); return retval; } @@ -719,7 +719,7 @@ static int dpmv8_write_reg(struct arm_dpm *dpm, struct reg *r, unsigned regnum) } if (retval != ERROR_OK) - LOG_ERROR("Failed to write %s register", r->name); + LOG_DEBUG("Failed to write %s register", r->name); return retval; } commit 91043cecee396209bd4d616fe6e78d835bebd978 Author: Antonio Borneo <bor...@gm...> Date: Mon May 13 15:40:15 2024 +0200 target: aarch64: align armv8_read_reg() and armv8_read_reg32() These functions are today always called with non-NULL parameter regval, so the actual check is not needed. Anyway, for any future code change, check the parameter at the entry of the functions and return error if it is not valid. Simplify the check to assign the result value and align the code of the two functions. Change-Id: Ie4d98063006d70d9e2bcfc00bc930133caf33515 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8266 Tested-by: jenkins diff --git a/src/target/armv8.c b/src/target/armv8.c index bf582ff80..8d97902f5 100644 --- a/src/target/armv8.c +++ b/src/target/armv8.c @@ -282,6 +282,9 @@ static int armv8_read_reg(struct armv8_common *armv8, int regnum, uint64_t *regv uint32_t value; uint64_t value_64; + if (!regval) + return ERROR_FAIL; + switch (regnum) { case 0 ... 30: retval = dpm->instr_read_data_dcc_64(dpm, @@ -361,10 +364,8 @@ static int armv8_read_reg(struct armv8_common *armv8, int regnum, uint64_t *regv break; } - if (retval == ERROR_OK && regval) + if (retval == ERROR_OK) *regval = value_64; - else - retval = ERROR_FAIL; return retval; } @@ -512,6 +513,9 @@ static int armv8_read_reg32(struct armv8_common *armv8, int regnum, uint64_t *re uint32_t value = 0; int retval; + if (!regval) + return ERROR_FAIL; + switch (regnum) { case ARMV8_R0 ... ARMV8_R14: /* return via DCC: "MCR p14, 0, Rnum, c0, c5, 0" */ @@ -587,7 +591,7 @@ static int armv8_read_reg32(struct armv8_common *armv8, int regnum, uint64_t *re break; } - if (retval == ERROR_OK && regval) + if (retval == ERROR_OK) *regval = value; return retval; ----------------------------------------------------------------------- Summary of changes: src/target/armv8.c | 12 ++++++++---- src/target/armv8_dpm.c | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) hooks/post-receive -- Main OpenOCD repository |