Skip to content

Commit

Permalink
target: Rebuilt the non-halting I/O heuristic, replacing it with a ta…
Browse files Browse the repository at this point in the history
…rget option
  • Loading branch information
dragonmux committed Oct 15, 2024
1 parent 94b1ba7 commit 222a69b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/target/target.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,10 @@ bool target_mem64_write(target_s *const target, const target_addr64_t dest, cons
return target_check_error(target);
}

/* target_mem_access_needs_halt() is true if the target needs to be halted during jtag memory access */

/* Returns true if the target needs halting to access memory on it */
bool target_mem_access_needs_halt(target_s *target)
{
/* assume all arm processors allow memory access while running, and no riscv does. */
bool is_riscv = target && target->core && strstr(target->core, "RVDBG");
return is_riscv;
return !(target->target_options & TOPT_NON_HALTING_MEM_IO);
}

/* Register access functions */
Expand Down
5 changes: 3 additions & 2 deletions src/target/target_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
#include "platform_support.h"
#include "target_probe.h"

#define TOPT_INHIBIT_NRST (1U << 0U)
#define TOPT_IN_SEMIHOSTING_SYSCALL (1U << 31U)
#define TOPT_INHIBIT_NRST (1U << 0U) /* Target misbehaves if reset using nRST line */
#define TOPT_NON_HALTING_MEM_IO (1U << 30U) /* Target does not need halting for memory I/O */
#define TOPT_IN_SEMIHOSTING_SYSCALL (1U << 31U) /* Target is currently in a semihosting syscall */

extern target_s *target_list;

Expand Down

0 comments on commit 222a69b

Please sign in to comment.