summaryrefslogtreecommitdiff
path: root/src/target/etm.c
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-18 05:36:18 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-18 15:51:07 -0800
commit410fab9ea8c6632da2e4967d960f66eecc7821ec (patch)
tree51f6d5146aa04bc13ea8809963f31d03b71fd3bc /src/target/etm.c
parent75a37eb5b37386768327e9670acfedc7811d529f (diff)
downloadopenocd+libswd-410fab9ea8c6632da2e4967d960f66eecc7821ec.tar.gz
openocd+libswd-410fab9ea8c6632da2e4967d960f66eecc7821ec.tar.bz2
openocd+libswd-410fab9ea8c6632da2e4967d960f66eecc7821ec.tar.xz
openocd+libswd-410fab9ea8c6632da2e4967d960f66eecc7821ec.zip
use COMMAND_PARSE_ENABLE macro where appropriate
Updates all command parsing of simple "enable" and "disable" arguments. A few case in the tree use a tri-state or extended arguments, which cannot use this simple macro. Simlifies the xscale icache/dcache command handler logic.
Diffstat (limited to 'src/target/etm.c')
-rw-r--r--src/target/etm.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/target/etm.c b/src/target/etm.c
index 3b5fa61f..85cc6ebd 100644
--- a/src/target/etm.c
+++ b/src/target/etm.c
@@ -1214,25 +1214,14 @@ static COMMAND_HELPER(handle_etm_tracemode_command_update,
return ERROR_INVALID_ARGUMENTS;
}
- if (strcmp(CMD_ARGV[2], "enable") == 0)
+ bool etmv1_cycle_accurate;
+ COMMAND_PARSE_ENABLE(CMD_ARGV[2], etmv1_cycle_accurate);
+ if (etmv1_cycle_accurate)
tracemode |= ETMV1_CYCLE_ACCURATE;
- else if (strcmp(CMD_ARGV[2], "disable") == 0)
- tracemode |= 0;
- else
- {
- command_print(CMD_CTX, "invalid option '%s'", CMD_ARGV[2]);
- return ERROR_INVALID_ARGUMENTS;
- }
- if (strcmp(CMD_ARGV[3], "enable") == 0)
+ bool etmv1_branch_output;
+ COMMAND_PARSE_ENABLE(CMD_ARGV[3], etmv1_branch_output);
tracemode |= ETMV1_BRANCH_OUTPUT;
- else if (strcmp(CMD_ARGV[3], "disable") == 0)
- tracemode |= 0;
- else
- {
- command_print(CMD_CTX, "invalid option '%s'", CMD_ARGV[3]);
- return ERROR_INVALID_ARGUMENTS;
- }
/* IGNORED:
* - CPRT tracing (coprocessor register transfers)