summaryrefslogtreecommitdiff
path: root/src/target/xscale.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-08-25 07:09:48 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-08-25 07:09:48 +0000
commitfd4c0f33b119a9242b05c9141237a5fb744ec985 (patch)
tree8d4e38c57a59d85c53a030a615d71895bdb866fb /src/target/xscale.c
parentae4c224459f95d82cc65b2392fcc89ed7c1e8b3e (diff)
downloadopenocd+libswd-fd4c0f33b119a9242b05c9141237a5fb744ec985.tar.gz
openocd+libswd-fd4c0f33b119a9242b05c9141237a5fb744ec985.tar.bz2
openocd+libswd-fd4c0f33b119a9242b05c9141237a5fb744ec985.tar.xz
openocd+libswd-fd4c0f33b119a9242b05c9141237a5fb744ec985.zip
Michael Schwingen <rincewind@discworld.dascon.de> The attached patch adds a "xscale vector_table" command that allows to set
the values that are written in the mini-IC (plus documentation updates that describe why this is needed). git-svn-id: svn://svn.berlios.de/openocd/trunk@2613 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/xscale.c')
-rw-r--r--src/target/xscale.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/target/xscale.c b/src/target/xscale.c
index 71edee2e..cc90eb31 100644
--- a/src/target/xscale.c
+++ b/src/target/xscale.c
@@ -5,6 +5,9 @@
* Copyright (C) 2007,2008 Øyvind Harboe *
* oyvind.harboe@zylin.com *
* *
+ * Copyright (C) 2009 Michael Schwingen *
+ * michael@schwingen.org *
+ * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
@@ -3384,6 +3387,65 @@ int xscale_handle_vector_catch_command(command_context_t *cmd_ctx, char *cmd, ch
}
+int xscale_handle_vector_table_command(command_context_t *cmd_ctx, char *cmd, char **args, int argc)
+{
+ target_t *target = get_current_target(cmd_ctx);
+ armv4_5_common_t *armv4_5;
+ xscale_common_t *xscale;
+ int err = 0;
+
+ if (xscale_get_arch_pointers(target, &armv4_5, &xscale) != ERROR_OK)
+ {
+ return ERROR_OK;
+ }
+
+ if (argc == 0) /* print current settings */
+ {
+ int idx;
+
+ command_print(cmd_ctx, "active user-set static vectors:");
+ for (idx = 1; idx < 8; idx++)
+ if (xscale->static_low_vectors_set & (1 << idx))
+ command_print(cmd_ctx, "low %d: 0x%x", idx, xscale->static_low_vectors[idx]);
+ for (idx = 1; idx < 8; idx++)
+ if (xscale->static_high_vectors_set & (1 << idx))
+ command_print(cmd_ctx, "high %d: 0x%x", idx, xscale->static_high_vectors[idx]);
+ return ERROR_OK;
+ }
+
+ if (argc != 3)
+ err = 1;
+ else
+ {
+ int idx;
+ uint32_t vec;
+ idx = strtoul(args[1], NULL, 0);
+ vec = strtoul(args[2], NULL, 0);
+
+ if (idx < 1 || idx >= 8)
+ err = 1;
+
+ if (!err && strcmp(args[0], "low") == 0)
+ {
+ xscale->static_low_vectors_set |= (1<<idx);
+ xscale->static_low_vectors[idx] = vec;
+ }
+ else if (!err && (strcmp(args[0], "high") == 0))
+ {
+ xscale->static_high_vectors_set |= (1<<idx);
+ xscale->static_high_vectors[idx] = vec;
+ }
+ else
+ err = 1;
+ }
+
+ if (err)
+ command_print(cmd_ctx, "usage: xscale vector_table <high|low> <index> <code>");
+
+ return ERROR_OK;
+}
+
+
int xscale_handle_trace_buffer_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
target_t *target = get_current_target(cmd_ctx);
@@ -3692,6 +3754,7 @@ int xscale_register_commands(struct command_context_s *cmd_ctx)
register_command(cmd_ctx, xscale_cmd, "dcache", xscale_handle_idcache_command, COMMAND_EXEC, "['enable'|'disable'] the DCache");
register_command(cmd_ctx, xscale_cmd, "vector_catch", xscale_handle_vector_catch_command, COMMAND_EXEC, "<mask> of vectors that should be catched");
+ register_command(cmd_ctx, xscale_cmd, "vector_table", xscale_handle_vector_table_command, COMMAND_EXEC, "<high|low> <index> <code> set static code for exception handler entry");
register_command(cmd_ctx, xscale_cmd, "trace_buffer", xscale_handle_trace_buffer_command, COMMAND_EXEC, "<enable | disable> ['fill' [n]|'wrap']");