summaryrefslogtreecommitdiff
path: root/src/target/arm7_9_common.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-12-04 16:51:48 -0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-12-04 16:51:48 -0800
commitbdde9460b923ab61fad678bf1e3f0da04e1d94ee (patch)
tree455782ac27db2b2acbffee591159fd30558df7d2 /src/target/arm7_9_common.c
parentacd6d3399486110e69db8d5ec752e10067c29ad0 (diff)
downloadopenocd_libswd-bdde9460b923ab61fad678bf1e3f0da04e1d94ee.tar.gz
openocd_libswd-bdde9460b923ab61fad678bf1e3f0da04e1d94ee.tar.bz2
openocd_libswd-bdde9460b923ab61fad678bf1e3f0da04e1d94ee.tar.xz
openocd_libswd-bdde9460b923ab61fad678bf1e3f0da04e1d94ee.zip
ARM: remove semihosting globals
Store a flag and errno in in "struct arm". Have "poll" output report when semihosting is active. Shrink some of the affected lines. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/target/arm7_9_common.c')
-rw-r--r--src/target/arm7_9_common.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c
index 7318b5f3..b4116726 100644
--- a/src/target/arm7_9_common.c
+++ b/src/target/arm7_9_common.c
@@ -2831,22 +2831,32 @@ COMMAND_HANDLER(handle_arm7_9_semihosting_command)
if (CMD_ARGC > 0)
{
- COMMAND_PARSE_ENABLE(CMD_ARGV[0], semihosting_active);
+ int semihosting;
+
+ COMMAND_PARSE_ENABLE(CMD_ARGV[0], semihosting);
/* TODO: support other methods if vector catch is unavailable */
if (arm7_9->has_vector_catch) {
- struct reg *vector_catch = &arm7_9->eice_cache->reg_list[EICE_VEC_CATCH];
+ struct reg *vector_catch = &arm7_9->eice_cache
+ ->reg_list[EICE_VEC_CATCH];
+
if (!vector_catch->valid)
embeddedice_read_reg(vector_catch);
- buf_set_u32(vector_catch->value, 2, 1, semihosting_active);
+ buf_set_u32(vector_catch->value, 2, 1, semihosting);
embeddedice_store_reg(vector_catch);
- } else if (semihosting_active) {
+
+ /* FIXME never let that "catch" be dropped! */
+
+ arm7_9->armv4_5_common.is_semihosting = semihosting;
+
+ } else if (semihosting) {
command_print(CMD_CTX, "vector catch unavailable");
- semihosting_active = 0;
}
}
- command_print(CMD_CTX, "semihosting is %s", (semihosting_active) ? "enabled" : "disabled");
+ command_print(CMD_CTX, "semihosting is %s",
+ arm7_9->armv4_5_common.is_semihosting
+ ? "enabled" : "disabled");
return ERROR_OK;
}