summaryrefslogtreecommitdiff
path: root/src/target/arm920t.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-11-17 23:50:26 -0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-11-17 23:50:26 -0800
commit181d401d59419ec2f5a5d89e2600d9a6dbf8f9ed (patch)
tree0a7919ba0218d5a8a81b309a7cd2acc9a7a93839 /src/target/arm920t.c
parentec93209f51afc09e273a4742dc0b5f2cefc15e76 (diff)
downloadopenocd+libswd-181d401d59419ec2f5a5d89e2600d9a6dbf8f9ed.tar.gz
openocd+libswd-181d401d59419ec2f5a5d89e2600d9a6dbf8f9ed.tar.bz2
openocd+libswd-181d401d59419ec2f5a5d89e2600d9a6dbf8f9ed.tar.xz
openocd+libswd-181d401d59419ec2f5a5d89e2600d9a6dbf8f9ed.zip
ARM: add is_arm_mode()
Add a new is_arm_mode() predicate, and use it to replace almost all calls to current armv4_5_mode_to_number(). Eventually those internal mode numbers should vanish... along with their siblings in the armv7a.c file. Remove a handful of superfluous checks ... e.g. the mode number was just initialized, or (debug entry methods) already validated. Move one of the macros using internal mode numbers into the only file which uses that macro. Make the tables manipulated with those numbers be read-only and, where possible, static so they're not confused with part of the generic ARM interface. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/target/arm920t.c')
-rw-r--r--src/target/arm920t.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/target/arm920t.c b/src/target/arm920t.c
index e1dcea7a..29f7917d 100644
--- a/src/target/arm920t.c
+++ b/src/target/arm920t.c
@@ -244,7 +244,7 @@ static int arm920t_read_cp15_interpreted(struct target *target,
LOG_DEBUG("cp15_opcode: %8.8x, address: %8.8x, value: %8.8x", cp15_opcode, address, *value);
#endif
- if (armv4_5_mode_to_number(armv4_5->core_mode)==-1)
+ if (!is_arm_mode(armv4_5->core_mode))
return ERROR_FAIL;
ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5->core_mode, 0).dirty = 1;
@@ -284,7 +284,7 @@ int arm920t_write_cp15_interpreted(struct target *target,
LOG_DEBUG("cp15_opcode: %8.8x, value: %8.8x, address: %8.8x", cp15_opcode, value, address);
#endif
- if (armv4_5_mode_to_number(armv4_5->core_mode)==-1)
+ if (!is_arm_mode(armv4_5->core_mode))
return ERROR_FAIL;
ARMV4_5_CORE_REG_MODE(armv4_5->core_cache, armv4_5->core_mode, 0).dirty = 1;
@@ -889,7 +889,7 @@ COMMAND_HANDLER(arm920t_handle_read_cache_command)
fclose(output);
- if (armv4_5_mode_to_number(armv4_5->core_mode)==-1)
+ if (!is_arm_mode(armv4_5->core_mode))
return ERROR_FAIL;
/* mark registers dirty. */
@@ -1172,7 +1172,7 @@ COMMAND_HANDLER(arm920t_handle_read_mmu_command)
fclose(output);
- if (armv4_5_mode_to_number(armv4_5->core_mode)==-1)
+ if (!is_arm_mode(armv4_5->core_mode))
return ERROR_FAIL;
/* mark registers dirty */