diff options
author | Tomas Vanek <vanekt@fbl.cz> | 2019-10-20 14:27:36 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2020-11-15 21:08:26 +0000 |
commit | fc91936be7bac7a84636d6b907ac545876263f3e (patch) | |
tree | d5683a45d09fe05642713d5f152a6d111d59ebc9 /src/target/armv7m.c | |
parent | d811d2838b9edc230946a308917aedc28c9d111e (diff) | |
download | riscv-openocd-fc91936be7bac7a84636d6b907ac545876263f3e.zip riscv-openocd-fc91936be7bac7a84636d6b907ac545876263f3e.tar.gz riscv-openocd-fc91936be7bac7a84636d6b907ac545876263f3e.tar.bz2 |
target/armv7m: use arch_info[i].value instead of allocated memory
Change-Id: I9422cab484d0769404516947e16da1baa001a4e0
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5328
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/target/armv7m.c')
-rw-r--r-- | src/target/armv7m.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/target/armv7m.c b/src/target/armv7m.c index 7e9b72a..13370b5 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); |