+static const struct command_registration target_exec_command_handlers[] = {
+ {
+ .name = "fast_load_image",
+ .handler = handle_fast_load_image_command,
+ .mode = COMMAND_ANY,
+ .help = "Load image into server memory for later use by "
+ "fast_load; primarily for profiling",
+ .usage = "filename address ['bin'|'ihex'|'elf'|'s19'] "
+ "[min_address [max_length]]",
+ },
+ {
+ .name = "fast_load",
+ .handler = handle_fast_load_command,
+ .mode = COMMAND_EXEC,
+ .help = "loads active fast load image to current target "
+ "- mainly for profiling purposes",
+ .usage = "",
+ },
+ {
+ .name = "profile",
+ .handler = handle_profile_command,
+ .mode = COMMAND_EXEC,
+ .usage = "seconds filename",
+ .help = "profiling samples the CPU PC",
+ },
+ /** @todo don't register virt2phys() unless target supports it */
+ {
+ .name = "virt2phys",
+ .handler = handle_virt2phys_command,
+ .mode = COMMAND_ANY,
+ .help = "translate a virtual address into a physical address",
+ .usage = "virtual_address",
+ },
+ {
+ .name = "reg",
+ .handler = handle_reg_command,
+ .mode = COMMAND_EXEC,
+ .help = "display or set a register; with no arguments, "
+ "displays all registers and their values",
+ .usage = "[(register_name|register_number) [value]]",
+ },
+ {
+ .name = "poll",
+ .handler = handle_poll_command,
+ .mode = COMMAND_EXEC,
+ .help = "poll target state; or reconfigure background polling",
+ .usage = "['on'|'off']",
+ },
+ {
+ .name = "wait_halt",
+ .handler = handle_wait_halt_command,
+ .mode = COMMAND_EXEC,
+ .help = "wait up to the specified number of milliseconds "
+ "(default 5) for a previously requested halt",
+ .usage = "[milliseconds]",
+ },
+ {
+ .name = "halt",
+ .handler = handle_halt_command,
+ .mode = COMMAND_EXEC,
+ .help = "request target to halt, then wait up to the specified"
+ "number of milliseconds (default 5) for it to complete",
+ .usage = "[milliseconds]",
+ },
+ {
+ .name = "resume",
+ .handler = handle_resume_command,
+ .mode = COMMAND_EXEC,
+ .help = "resume target execution from current PC or address",
+ .usage = "[address]",
+ },
+ {
+ .name = "reset",
+ .handler = handle_reset_command,
+ .mode = COMMAND_EXEC,
+ .usage = "[run|halt|init]",
+ .help = "Reset all targets into the specified mode."
+ "Default reset mode is run, if not given.",
+ },
+ {
+ .name = "soft_reset_halt",
+ .handler = handle_soft_reset_halt_command,
+ .mode = COMMAND_EXEC,
+ .usage = "",
+ .help = "halt the target and do a soft reset",
+ },
+ {
+ .name = "step",
+ .handler = handle_step_command,
+ .mode = COMMAND_EXEC,
+ .help = "step one instruction from current PC or address",
+ .usage = "[address]",
+ },
+ {
+ .name = "mdw",
+ .handler = handle_md_command,
+ .mode = COMMAND_EXEC,
+ .help = "display memory words",
+ .usage = "['phys'] address [count]",
+ },
+ {
+ .name = "mdh",
+ .handler = handle_md_command,
+ .mode = COMMAND_EXEC,
+ .help = "display memory half-words",
+ .usage = "['phys'] address [count]",
+ },
+ {
+ .name = "mdb",
+ .handler = handle_md_command,
+ .mode = COMMAND_EXEC,
+ .help = "display memory bytes",
+ .usage = "['phys'] address [count]",
+ },
+ {
+ .name = "mww",
+ .handler = handle_mw_command,
+ .mode = COMMAND_EXEC,
+ .help = "write memory word",
+ .usage = "['phys'] address value [count]",
+ },
+ {
+ .name = "mwh",
+ .handler = handle_mw_command,
+ .mode = COMMAND_EXEC,
+ .help = "write memory half-word",
+ .usage = "['phys'] address value [count]",
+ },
+ {
+ .name = "mwb",
+ .handler = handle_mw_command,
+ .mode = COMMAND_EXEC,
+ .help = "write memory byte",
+ .usage = "['phys'] address value [count]",
+ },
+ {
+ .name = "bp",
+ .handler = handle_bp_command,
+ .mode = COMMAND_EXEC,
+ .help = "list or set hardware or software breakpoint",
+ .usage = "<address> [<asid>]<length> ['hw'|'hw_ctx']",
+ },
+ {
+ .name = "rbp",
+ .handler = handle_rbp_command,
+ .mode = COMMAND_EXEC,
+ .help = "remove breakpoint",
+ .usage = "address",
+ },
+ {
+ .name = "wp",
+ .handler = handle_wp_command,
+ .mode = COMMAND_EXEC,
+ .help = "list (no params) or create watchpoints",
+ .usage = "[address length [('r'|'w'|'a') value [mask]]]",
+ },
+ {
+ .name = "rwp",
+ .handler = handle_rwp_command,
+ .mode = COMMAND_EXEC,
+ .help = "remove watchpoint",
+ .usage = "address",
+ },
+ {
+ .name = "load_image",
+ .handler = handle_load_image_command,
+ .mode = COMMAND_EXEC,
+ .usage = "filename address ['bin'|'ihex'|'elf'|'s19'] "
+ "[min_address] [max_length]",
+ },
+ {
+ .name = "dump_image",
+ .handler = handle_dump_image_command,
+ .mode = COMMAND_EXEC,
+ .usage = "filename address size",
+ },
+ {
+ .name = "verify_image",
+ .handler = handle_verify_image_command,
+ .mode = COMMAND_EXEC,
+ .usage = "filename [offset [type]]",
+ },
+ {
+ .name = "test_image",
+ .handler = handle_test_image_command,
+ .mode = COMMAND_EXEC,
+ .usage = "filename [offset [type]]",
+ },
+ {
+ .name = "mem2array",
+ .mode = COMMAND_EXEC,
+ .jim_handler = jim_mem2array,
+ .help = "read 8/16/32 bit memory and return as a TCL array "
+ "for script processing",
+ .usage = "arrayname bitwidth address count",
+ },
+ {
+ .name = "array2mem",
+ .mode = COMMAND_EXEC,
+ .jim_handler = jim_array2mem,
+ .help = "convert a TCL array to memory locations "
+ "and write the 8/16/32 bit values",
+ .usage = "arrayname bitwidth address count",
+ },
+ {
+ .name = "reset_nag",
+ .handler = handle_target_reset_nag,
+ .mode = COMMAND_ANY,
+ .help = "Nag after each reset about options that could have been "
+ "enabled to improve performance. ",
+ .usage = "['enable'|'disable']",
+ },
+ COMMAND_REGISTRATION_DONE
+};
+static int target_register_user_commands(struct command_context *cmd_ctx)