From 44e782d55bf1ce0d924c082281082496cdc2495e Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Thu, 16 Jan 2025 22:33:48 -0500 Subject: [PATCH] target/arc: allow reading memory while target runs There is no reason that ARC can't support reading from memory over JTAG while the target is executing, and this is in fact required for RTT support. Remove this check from arc_mem_read and arc_mem_write Change-Id: I2accfb4b99bf77c5473d133623e0eb0632cb45f6 Signed-off-by: Daniel DeGrasse Reviewed-on: https://review.openocd.org/c/openocd/+/8721 Tested-by: jenkins Reviewed-by: Evgeniy Didin Reviewed-by: Antonio Borneo --- src/target/arc_mem.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/target/arc_mem.c b/src/target/arc_mem.c index 3daed1cbb..5132aca3d 100644 --- a/src/target/arc_mem.c +++ b/src/target/arc_mem.c @@ -161,11 +161,6 @@ int arc_mem_write(struct target *target, target_addr_t address, uint32_t size, LOG_TARGET_DEBUG(target, "address: 0x%08" TARGET_PRIxADDR ", size: %" PRIu32 ", count: %" PRIu32, address, size, count); - if (target->state != TARGET_HALTED) { - LOG_TARGET_ERROR(target, "not halted"); - return ERROR_TARGET_NOT_HALTED; - } - /* sanitize arguments */ if (((size != 4) && (size != 2) && (size != 1)) || !(count) || !(buffer)) return ERROR_COMMAND_SYNTAX_ERROR; @@ -246,11 +241,6 @@ int arc_mem_read(struct target *target, target_addr_t address, uint32_t size, LOG_TARGET_DEBUG(target, "Read memory: addr=0x%08" TARGET_PRIxADDR ", size=%" PRIu32 ", count=%" PRIu32, address, size, count); - if (target->state != TARGET_HALTED) { - LOG_TARGET_WARNING(target, "target not halted"); - return ERROR_TARGET_NOT_HALTED; - } - /* Sanitize arguments */ if (((size != 4) && (size != 2) && (size != 1)) || !(count) || !(buffer)) return ERROR_COMMAND_SYNTAX_ERROR;