From bdde9460b923ab61fad678bf1e3f0da04e1d94ee Mon Sep 17 00:00:00 2001 From: David Brownell Date: Fri, 4 Dec 2009 16:51:48 -0800 Subject: 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 --- src/target/arm7_9_common.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/target/arm7_9_common.c') 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; } -- cgit v1.2.3