summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-11-16 16:36:09 -0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-11-16 16:36:09 -0800
commitf86137066a6b42c46c457c9837a8015990bf71e6 (patch)
treeae2e1008558aecdcb52079ef2503bc5293e94968 /src
parent7c393679c0cd8f7609a0d6b2329a1877de0f3d31 (diff)
downloadopenocd+libswd-f86137066a6b42c46c457c9837a8015990bf71e6.tar.gz
openocd+libswd-f86137066a6b42c46c457c9837a8015990bf71e6.tar.bz2
openocd+libswd-f86137066a6b42c46c457c9837a8015990bf71e6.tar.xz
openocd+libswd-f86137066a6b42c46c457c9837a8015990bf71e6.zip
ARM: "armv4_5" command prefix becomes "arm"
Rename the "armv4_5" command prefix to straight "arm" so it makes more sense for newer cores. Add a simple compatibility script. Make sure all the commands give the same "not an ARM" diagnostic message (and fail properly) when called against non-ARM targets. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src')
-rw-r--r--src/helper/startup.tcl9
-rw-r--r--src/target/armv4_5.c18
2 files changed, 18 insertions, 9 deletions
diff --git a/src/helper/startup.tcl b/src/helper/startup.tcl
index 73c4cf19..096f03a8 100644
--- a/src/helper/startup.tcl
+++ b/src/helper/startup.tcl
@@ -142,6 +142,15 @@ proc ocd_gdb_restart {target_id} {
reset halt
}
+#########
+
+# Temporary migration aid. May be removed starting in January 2011.
+proc armv4_5 params {
+ echo "DEPRECATED! use 'arm $params' not 'armv4_5 $params'"
+ arm $params
+}
+
+#########
# This reset logic may be overridden by board/target/... scripts as needed
# to provide a reset that, if possible, is close to a power-up reset.
diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c
index e112e7b1..7c4861ff 100644
--- a/src/target/armv4_5.c
+++ b/src/target/armv4_5.c
@@ -363,10 +363,10 @@ COMMAND_HANDLER(handle_armv4_5_reg_command)
struct target *target = get_current_target(cmd_ctx);
struct armv4_5_common_s *armv4_5 = target_to_armv4_5(target);
- if (armv4_5->common_magic != ARMV4_5_COMMON_MAGIC)
+ if (!is_arm(armv4_5))
{
- command_print(cmd_ctx, "current target isn't an ARMV4/5 target");
- return ERROR_OK;
+ command_print(cmd_ctx, "current target isn't an ARM");
+ return ERROR_FAIL;
}
if (target->state != TARGET_HALTED)
@@ -412,10 +412,10 @@ COMMAND_HANDLER(handle_armv4_5_core_state_command)
struct target *target = get_current_target(cmd_ctx);
struct armv4_5_common_s *armv4_5 = target_to_armv4_5(target);
- if (armv4_5->common_magic != ARMV4_5_COMMON_MAGIC)
+ if (!is_arm(armv4_5))
{
- command_print(cmd_ctx, "current target isn't an ARMV4/5 target");
- return ERROR_OK;
+ command_print(cmd_ctx, "current target isn't an ARM");
+ return ERROR_FAIL;
}
if (argc > 0)
@@ -471,7 +471,7 @@ COMMAND_HANDLER(handle_armv4_5_disassemble_command)
default:
usage:
command_print(cmd_ctx,
- "usage: armv4_5 disassemble <address> [<count> ['thumb']]");
+ "usage: arm disassemble <address> [<count> ['thumb']]");
count = 0;
retval = ERROR_FAIL;
}
@@ -510,9 +510,9 @@ int armv4_5_register_commands(struct command_context *cmd_ctx)
{
struct command *armv4_5_cmd;
- armv4_5_cmd = register_command(cmd_ctx, NULL, "armv4_5",
+ armv4_5_cmd = register_command(cmd_ctx, NULL, "arm",
NULL, COMMAND_ANY,
- "armv4/5 specific commands");
+ "generic ARM commands");
register_command(cmd_ctx, armv4_5_cmd, "reg",
handle_armv4_5_reg_command, COMMAND_EXEC,