target: introduce target_memory_ready() test

Use the new test in target memory access functions
instead of target_was_examined()

Drop the test from target_read/write_u8/16/32/64() helpers
as they directly call a memory access function which does
the test again.

Change-Id: Ic1753e461d2a4b91ce3a3e1bf3e86eb2be743d46
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/9178
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Tomas Vanek
2025-10-22 21:35:39 +02:00
parent 7025e3fe3d
commit ba12fb9b95
3 changed files with 39 additions and 65 deletions

View File

@@ -590,6 +590,15 @@ int target_run_read_async_algorithm(struct target *target,
uint32_t entry_point, uint32_t exit_point,
void *arch_info);
/**
* Returns true if target memory is ready to read/write.
*
* This routine is a wrapper for target->type->memory_ready.
* If the target specific check is not implemented,
* returns target_was_examined()
*/
bool target_memory_ready(struct target *target);
/**
* Read @a count items of @a size bytes from the memory of @a target at
* the @a address given.