From: OpenOCD-Gerrit <ope...@us...> - 2020-11-15 21:09:20
|
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 fc91936be7bac7a84636d6b907ac545876263f3e (commit) via d811d2838b9edc230946a308917aedc28c9d111e (commit) from 4d336e8ffb7507f893640d344326b46f4bd8762d (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 fc91936be7bac7a84636d6b907ac545876263f3e Author: Tomas Vanek <va...@fb...> Date: Sun Oct 20 14:27:36 2019 +0200 target/armv7m: use arch_info[i].value instead of allocated memory Change-Id: I9422cab484d0769404516947e16da1baa001a4e0 Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: http://openocd.zylin.com/5328 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/armv7m.c b/src/target/armv7m.c index 7e9b72a8e..13370b54b 100644 --- a/src/target/armv7m.c +++ b/src/target/armv7m.c @@ -741,10 +741,7 @@ struct reg_cache *armv7m_build_reg_cache(struct target *target) reg_list[i].name = armv7m_regs[i].name; reg_list[i].size = armv7m_regs[i].bits; - size_t storage_size = DIV_ROUND_UP(armv7m_regs[i].bits, 8); - if (storage_size < 4) - storage_size = 4; - reg_list[i].value = calloc(1, storage_size); + reg_list[i].value = arch_info[i].value; reg_list[i].dirty = false; reg_list[i].valid = false; reg_list[i].hidden = i == ARMV7M_PMSK_BPRI_FLTMSK_CTRL; @@ -798,7 +795,6 @@ void armv7m_free_reg_cache(struct target *target) free(reg->feature); free(reg->reg_data_type); - free(reg->value); } free(cache->reg_list[0].arch_info); diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index ced7a8a67..7b3f3c70e 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -2044,7 +2044,6 @@ int cortex_m_examine(struct target *target) for (idx = ARMV7M_NUM_CORE_REGS_NOFP; idx < armv7m->arm.core_cache->num_regs; idx++) { - free(armv7m->arm.core_cache->reg_list[idx].value); free(armv7m->arm.core_cache->reg_list[idx].feature); free(armv7m->arm.core_cache->reg_list[idx].reg_data_type); } commit d811d2838b9edc230946a308917aedc28c9d111e Author: Antonio Borneo <bor...@gm...> Date: Wed Oct 21 16:12:27 2020 +0200 cortex_m: use the new enum ARMV7M_REGSEL_name Register xPSR is indexed directly with its value 16 or with the incorrect enum ARMV7M_xPSR. Replace them with the new enum ARMV7M_REGSEL_xPSR. Change-Id: I86600e7f78e39002ce45f66d4792d5067c1f541b Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/5873 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/flash/nor/psoc6.c b/src/flash/nor/psoc6.c index 30bf88501..19d483bab 100644 --- a/src/flash/nor/psoc6.c +++ b/src/flash/nor/psoc6.c @@ -153,7 +153,7 @@ static int sromalgo_prepare(struct target *target) /* Restore THUMB bit in xPSR register */ const struct armv7m_common *cm = target_to_armv7m(target); - hr = cm->store_core_reg_u32(target, ARMV7M_xPSR, 0x01000000); + hr = cm->store_core_reg_u32(target, ARMV7M_REGSEL_xPSR, 0x01000000); if (hr != ERROR_OK) return hr; diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 72a2bd322..ced7a8a67 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -530,7 +530,7 @@ static int cortex_m_debug_entry(struct target *target) /* For IT instructions xPSR must be reloaded on resume and clear on debug exec */ if (xPSR & 0xf00) { r->dirty = r->valid; - cortex_m_store_core_reg_u32(target, 16, xPSR & ~0xff); + cortex_m_store_core_reg_u32(target, ARMV7M_REGSEL_xPSR, xPSR & ~0xff); } /* Are we in an exception handler */ ----------------------------------------------------------------------- Summary of changes: src/flash/nor/psoc6.c | 2 +- src/target/armv7m.c | 6 +----- src/target/cortex_m.c | 3 +-- 3 files changed, 3 insertions(+), 8 deletions(-) hooks/post-receive -- Main OpenOCD repository |