aboutsummaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-11-19 10:47:31 -0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-11-19 10:47:31 -0800
commite3ed06579bd8129c11af0a1636a55d62af08980b (patch)
treeb85f87d6f59acf43b3204255e8e57fc6edc589f9 /src/target
parentc049033fde1592e1bfa922641034c1ab136e0b47 (diff)
downloadriscv-openocd-e3ed06579bd8129c11af0a1636a55d62af08980b.zip
riscv-openocd-e3ed06579bd8129c11af0a1636a55d62af08980b.tar.gz
riscv-openocd-e3ed06579bd8129c11af0a1636a55d62af08980b.tar.bz2
Cortex-A8: parts of examine() run just once
The examine() method has some conceptual breakage. Cope with it by manually splitting out the run-once parts from the after-each-reset parts ... this gets rid of memory leaks and speeds up resets after the first one. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/target')
-rw-r--r--src/target/cortex_a8.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c
index d62740c..c0a7466 100644
--- a/src/target/cortex_a8.c
+++ b/src/target/cortex_a8.c
@@ -1362,7 +1362,7 @@ static int cortex_a8_handle_target_request(void *priv)
* Cortex-A8 target information and configuration
*/
-static int cortex_a8_examine(struct target *target)
+static int cortex_a8_examine_first(struct target *target)
{
struct cortex_a8_common *cortex_a8 = target_to_cortex_a8(target);
struct armv7a_common *armv7a = &cortex_a8->armv7a_common;
@@ -1447,10 +1447,21 @@ static int cortex_a8_examine(struct target *target)
LOG_DEBUG("Configured %i hw breakpoint pairs and %i hw watchpoint pairs",
cortex_a8->brp_num , cortex_a8->wrp_num);
- /* Configure core debug access */
- cortex_a8_init_debug_access(target);
-
target_set_examined(target);
+ return ERROR_OK;
+}
+
+static int cortex_a8_examine(struct target *target)
+{
+ int retval = ERROR_OK;
+
+ /* don't re-probe hardware after each reset */
+ if (!target_was_examined(target))
+ retval = cortex_a8_examine_first(target);
+
+ /* Configure core debug access */
+ if (retval == ERROR_OK)
+ retval = cortex_a8_init_debug_access(target);
return retval;
}