summaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-31 11:32:10 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-05-31 11:32:10 +0000
commit4deb42ed004f90058856b1d72dda63c4843b3854 (patch)
treea0fd422d243e6e109f16314f44db13edc31d6d6d /src/target
parentd00ac17e8e06fa06acde570d89ac6a90126359c8 (diff)
downloadopenocd+libswd-4deb42ed004f90058856b1d72dda63c4843b3854.tar.gz
openocd+libswd-4deb42ed004f90058856b1d72dda63c4843b3854.tar.bz2
openocd+libswd-4deb42ed004f90058856b1d72dda63c4843b3854.tar.xz
openocd+libswd-4deb42ed004f90058856b1d72dda63c4843b3854.zip
Add target_examine_one wrapper:
- replaces all calls to target->type->examine. git-svn-id: svn://svn.berlios.de/openocd/trunk@1968 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target')
-rw-r--r--src/target/arm7_9_common.c2
-rw-r--r--src/target/target.c7
-rw-r--r--src/target/target.h6
3 files changed, 13 insertions, 2 deletions
diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c
index f6f27710..9751c213 100644
--- a/src/target/arm7_9_common.c
+++ b/src/target/arm7_9_common.c
@@ -1051,7 +1051,7 @@ int arm7_9_deassert_reset(target_t *target)
{
LOG_WARNING("srst pulls trst - can not reset into halted mode. Issuing halt after reset.");
/* set up embedded ice registers again */
- if ((retval=target->type->examine(target))!=ERROR_OK)
+ if ((retval = target_examine_one(target)) != ERROR_OK)
return retval;
if ((retval=target_poll(target))!=ERROR_OK)
diff --git a/src/target/target.c b/src/target/target.c
index 16d28727..04d162b5 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -467,6 +467,11 @@ static int default_examine(struct target_s *target)
return ERROR_OK;
}
+int target_examine_one(struct target_s *target)
+{
+ return target->type->examine(target);
+}
+
/* Targets that correctly implement init+examine, i.e.
* no communication with target during init:
*
@@ -478,7 +483,7 @@ int target_examine(void)
target_t *target = all_targets;
while (target)
{
- if ((retval = target->type->examine(target))!=ERROR_OK)
+ if ((retval = target_examine_one(target)) != ERROR_OK)
return retval;
target = target->next;
}
diff --git a/src/target/target.h b/src/target/target.h
index 6e282d9e..1eb1ba1b 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -406,6 +406,12 @@ extern target_t *get_target(const char *id);
*/
extern const char *target_get_name(struct target_s *target);
+/**
+ * Examine the specified @a target.
+ *
+ * This routine is a wrapper for target->type->examine.
+ */
+extern int target_examine_one(struct target_s *target);
/// @returns @c true if the target has been examined.
extern bool target_was_examined(struct target_s *target);
/// Sets the @c examined flag for the given target.