From: openocd-gerrit <ope...@us...> - 2025-06-29 07:43:23
|
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 7f1f18399ce626e30d5176fb9740ed5fcd312c43 (commit) via ff274122dc2fbf509b24480e97a98291db53a338 (commit) from e8dca112453ae01bdfa04e1a1da8d20d5eb08d8f (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 7f1f18399ce626e30d5176fb9740ed5fcd312c43 Author: Antonio Borneo <bor...@gm...> Date: Sun Jun 22 11:03:41 2025 +0200 jtag/drivers: dmem: fix build on Linux 32 bits On 32 bits machine both 'uintptr_t' and pointers are 32 bit. The cast (volatile uint32_t *)((uintptr_t)dmem_emu_virt_base_addr + addr) fails with error error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] in lines 100 and 109 because: - 'addr' is a 'uint64_t'; - adding 'uintptr_t' and 'uint64_t' returns a 64 bit value; - cast the 64 bit to 'uint32_t *' is an error. In the code the value passed to 'addr' is always 32 bit wide, so there is no need to pass it as 'uint64_t'. Change the type of 'addr' to 'uint32_t'. Fix also some format string to fit both 32 and 64 bits machines. Change-Id: I90ff7cd3731cb24a0fc91fe7b69c532b5c698ba0 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8974 Reviewed-by: Nishanth Menon <nm...@ti...> Tested-by: jenkins Reviewed-by: R. Diez <rdi...@rd...> diff --git a/src/jtag/drivers/dmem.c b/src/jtag/drivers/dmem.c index e50e84aee..c1eb5b80d 100644 --- a/src/jtag/drivers/dmem.c +++ b/src/jtag/drivers/dmem.c @@ -93,14 +93,14 @@ static bool dmem_is_emulated_ap(struct adiv5_ap *ap, unsigned int *idx) return false; } -static void dmem_emu_set_ap_reg(uint64_t addr, uint32_t val) +static void dmem_emu_set_ap_reg(uint32_t addr, uint32_t val) { addr &= ~ARM_APB_PADDR31; *(volatile uint32_t *)((uintptr_t)dmem_emu_virt_base_addr + addr) = val; } -static uint32_t dmem_emu_get_ap_reg(uint64_t addr) +static uint32_t dmem_emu_get_ap_reg(uint32_t addr) { uint32_t val; @@ -113,7 +113,7 @@ static uint32_t dmem_emu_get_ap_reg(uint64_t addr) static int dmem_emu_ap_q_read(unsigned int ap_idx, unsigned int reg, uint32_t *data) { - uint64_t addr; + uint32_t addr; int ret = ERROR_OK; struct dmem_emu_ap_info *ap_info = &dmem_emu_ap_list[ap_idx]; @@ -164,7 +164,7 @@ static int dmem_emu_ap_q_read(unsigned int ap_idx, unsigned int reg, uint32_t *d static int dmem_emu_ap_q_write(unsigned int ap_idx, unsigned int reg, uint32_t data) { - uint64_t addr; + uint32_t addr; int ret = ERROR_OK; struct dmem_emu_ap_info *ap_info = &dmem_emu_ap_list[ap_idx]; @@ -519,7 +519,7 @@ static int dmem_dap_init(void) MAP_SHARED, dmem_fd, dmem_mapped_start); if (dmem_map_base == MAP_FAILED) { - LOG_ERROR("Mapping address 0x%lx for 0x%lx bytes failed!", + LOG_ERROR("Mapping address 0x%zx for 0x%zx bytes failed!", dmem_mapped_start, dmem_mapped_size); goto error_fail; } @@ -543,7 +543,7 @@ static int dmem_dap_init(void) MAP_SHARED, dmem_fd, dmem_mapped_start); if (dmem_emu_map_base == MAP_FAILED) { - LOG_ERROR("Mapping EMU address 0x%lx for 0x%lx bytes failed!", + LOG_ERROR("Mapping EMU address 0x%" PRIx64 " for 0x%" PRIx64 " bytes failed!", dmem_emu_base_address, dmem_emu_size); goto error_fail; } commit ff274122dc2fbf509b24480e97a98291db53a338 Author: Tim Newsome <ti...@si...> Date: Thu Nov 10 10:32:23 2022 -0800 gdb_server: Improve info message. Add target name and state to "Not running when halt was requested" message. Imported from https://github.com/riscv-collab/riscv-openocd/pull/763 Change-Id: Ic84e9a884b57caa270cfee0ca6fa6a0dd8e5d2bd Signed-off-by: Tim Newsome <ti...@si...> Reviewed-on: https://review.openocd.org/c/openocd/+/8916 Tested-by: jenkins Reviewed-by: Evgeniy Naydanov <evg...@sy...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index b5007d927..3eba15070 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -3761,7 +3761,8 @@ static int gdb_input_inner(struct connection *connection) target_call_event_callbacks(target, TARGET_EVENT_GDB_HALT); gdb_con->ctrl_c = false; } else { - LOG_INFO("The target is not running when halt was requested, stopping GDB."); + LOG_TARGET_INFO(target, "Not running when halt was requested, stopping GDB. (state=%d)", + target->state); target_call_event_callbacks(target, TARGET_EVENT_GDB_HALT); } } ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/dmem.c | 12 ++++++------ src/server/gdb_server.c | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) hooks/post-receive -- Main OpenOCD repository |