OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | etm_reg_info |
Macros | |
#define | ADDR_COMPARATOR(i) |
#define | DATA_COMPARATOR(i) |
#define | ETM_COUNTER(i) |
#define | ETM_OUTPUT(i) |
#define | ETM_SEQ(i) |
#define | TRACEMODE_MASK |
Enumerations | |
enum | { RO , WO , RW } |
Functions | |
COMMAND_HANDLER (handle_etm_analyze_command) | |
COMMAND_HANDLER (handle_etm_config_command) | |
COMMAND_HANDLER (handle_etm_dump_command) | |
COMMAND_HANDLER (handle_etm_image_command) | |
COMMAND_HANDLER (handle_etm_info_command) | |
COMMAND_HANDLER (handle_etm_load_command) | |
COMMAND_HANDLER (handle_etm_start_command) | |
COMMAND_HANDLER (handle_etm_status_command) | |
COMMAND_HANDLER (handle_etm_stop_command) | |
COMMAND_HANDLER (handle_etm_tracemode_command) | |
COMMAND_HANDLER (handle_etm_trigger_debug_command) | |
static | COMMAND_HELPER (handle_etm_tracemode_command_update, uint32_t *mode) |
struct reg_cache * | etm_build_reg_cache (struct target *target, struct arm_jtag *jtag_info, struct etm_context *etm_ctx) |
static int | etm_get_reg (struct reg *reg) |
static int | etm_read_instruction (struct etm_context *ctx, struct arm_instruction *instruction) |
static int | etm_read_reg (struct reg *reg) |
static int | etm_read_reg_w_check (struct reg *reg, uint8_t *check_value, uint8_t *check_mask) |
static void | etm_reg_add (unsigned bcd_vers, struct arm_jtag *jtag_info, struct reg_cache *cache, struct etm_reg *ereg, const struct etm_reg_info *r, unsigned nreg) |
static struct reg * | etm_reg_lookup (struct etm_context *etm_ctx, unsigned id) |
static int | etm_register_user_commands (struct command_context *cmd_ctx) |
static int | etm_set_reg (struct reg *reg, uint32_t value) |
static int | etm_set_reg_w_exec (struct reg *reg, uint8_t *buf) |
int | etm_setup (struct target *target) |
static int | etm_store_reg (struct reg *reg) |
static int | etm_write_reg (struct reg *reg, uint32_t value) |
static int | etmv1_analyze_trace (struct etm_context *ctx, struct command_invocation *cmd) |
static int | etmv1_branch_address (struct etm_context *ctx) |
static int | etmv1_data (struct etm_context *ctx, int size, uint32_t *data) |
static int | etmv1_next_packet (struct etm_context *ctx, uint8_t *packet, int apo) |
Variables | |
static const struct etm_reg_info | etm_addr_comp [] |
static const struct etm_reg_info | etm_basic [] |
static struct etm_capture_driver * | etm_capture_drivers [] |
const struct command_registration | etm_command_handlers [] |
static const struct command_registration | etm_config_command_handlers [] |
static const struct etm_reg_info | etm_core [] |
static const struct etm_reg_info | etm_counters [] |
static const struct etm_reg_info | etm_data_comp [] |
static const struct command_registration | etm_exec_command_handlers [] |
static const struct etm_reg_info | etm_fifofull [] |
static const struct etm_reg_info | etm_outputs [] |
static const struct reg_arch_type | etm_scan6_type |
static const struct etm_reg_info | etm_sequencer [] |
#define ADDR_COMPARATOR | ( | i | ) |
#define DATA_COMPARATOR | ( | i | ) |
#define ETM_COUNTER | ( | i | ) |
#define ETM_OUTPUT | ( | i | ) |
#define ETM_SEQ | ( | i | ) |
#define TRACEMODE_MASK |
COMMAND_HANDLER | ( | handle_etm_analyze_command | ) |
Definition at line 1950 of file etm.c.
References CMD, CMD_CTX, command_print(), ERROR_ETM_ANALYSIS_FAILED, ERROR_FAIL, ERROR_OK, ERROR_TRACE_IMAGE_UNAVAILABLE, ERROR_TRACE_INSTRUCTION_UNAVAILABLE, arm::etm, etmv1_analyze_trace(), get_current_target(), is_arm(), target, and target_to_arm().
COMMAND_HANDLER | ( | handle_etm_config_command | ) |
Definition at line 1301 of file etm.c.
References ARM_STATE_ARM, etm_context::capture_driver, CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, command_print(), etm_context::control, etm_context::core_state, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, arm::etm, etm_capture_drivers, ETM_PORT_16BIT, ETM_PORT_1BIT, ETM_PORT_24BIT, ETM_PORT_2BIT, ETM_PORT_32BIT, ETM_PORT_48BIT, ETM_PORT_4BIT, ETM_PORT_64BIT, ETM_PORT_8BIT, ETM_PORT_DEMUXED, ETM_PORT_FULL_CLOCK, ETM_PORT_HALF_CLOCK, ETM_PORT_MUXED, ETM_PORT_NORMAL, etm_register_user_commands(), get_target(), is_arm(), LOG_DEBUG, LOG_ERROR, name, NULL, register_commands(), target, etm_context::target, target_name(), target_to_arm(), target_type_name(), and etm_context::trace_data.
COMMAND_HANDLER | ( | handle_etm_dump_command | ) |
Definition at line 1685 of file etm.c.
References etm_context::capture_driver, etm_context::capture_status, CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, command_print(), etm_context::control, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, arm::etm, fileio::file, FILEIO_BINARY, fileio_close(), fileio_open(), FILEIO_WRITE, fileio_write_u32(), etmv1_trace_data::flags, get_current_target(), is_arm(), etmv1_trace_data::packet, etmv1_trace_data::pipestat, etm_capture_driver::read_trace, etm_capture_driver::status, target, target_to_arm(), etm_context::trace_data, etm_context::trace_depth, TRACE_IDLE, and TRACE_RUNNING.
COMMAND_HANDLER | ( | handle_etm_image_command | ) |
Definition at line 1636 of file etm.c.
References image::base_address, image::base_address_set, CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, arm::etm, get_current_target(), etm_context::image, image_close(), image_open(), is_arm(), NULL, image::start_address_set, target, and target_to_arm().
COMMAND_HANDLER | ( | handle_etm_info_command | ) |
Definition at line 1437 of file etm.c.
References etm_context::bcd_vers, buf_get_u32(), CMD, CMD_CTX, command_print(), config, etm_context::config, ERROR_FAIL, ERROR_OK, arm::etm, etm_get_reg(), etm_reg_lookup(), ETM_SYS_CONFIG, get_current_target(), is_arm(), LOG_DEBUG, LOG_ERROR, target, target_to_arm(), and reg::value.
COMMAND_HANDLER | ( | handle_etm_load_command | ) |
Definition at line 1742 of file etm.c.
References etm_context::capture_driver, etm_context::capture_status, CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, command_print(), etm_context::control, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, arm::etm, fileio::file, FILEIO_BINARY, fileio_close(), fileio_open(), FILEIO_READ, fileio_read_u32(), fileio_size(), etmv1_trace_data::flags, get_current_target(), is_arm(), NULL, etmv1_trace_data::packet, etmv1_trace_data::pipestat, etm_capture_driver::status, target, target_to_arm(), etm_context::trace_data, etm_context::trace_depth, and TRACE_RUNNING.
COMMAND_HANDLER | ( | handle_etm_start_command | ) |
Definition at line 1820 of file etm.c.
References buf_set_u32(), etm_context::capture_driver, etm_context::capture_status, CMD, CMD_CTX, command_print(), ERROR_FAIL, ERROR_OK, arm::etm, ETM_CTRL, etm_get_reg(), etm_reg_lookup(), etm_store_reg(), get_current_target(), is_arm(), jtag_execute_queue(), NULL, etm_capture_driver::start_capture, target, target_to_arm(), etm_context::trace_data, etm_context::trace_depth, TRACE_IDLE, and reg::value.
COMMAND_HANDLER | ( | handle_etm_status_command | ) |
Definition at line 1566 of file etm.c.
References etm_context::bcd_vers, buf_get_u32(), etm_context::capture_driver, CMD, CMD_CTX, command_print(), ERROR_FAIL, ERROR_OK, arm::etm, etm_get_reg(), etm_reg_lookup(), ETM_STATUS, get_current_target(), is_arm(), etm_capture_driver::name, reg::size, etm_capture_driver::status, target, target_to_arm(), etm_context::trace_depth, TRACE_IDLE, TRACE_OVERFLOWED, TRACE_RUNNING, TRACE_TRIGGERED, and reg::value.
COMMAND_HANDLER | ( | handle_etm_stop_command | ) |
Definition at line 1865 of file etm.c.
References buf_set_u32(), etm_context::capture_driver, CMD, CMD_CTX, command_print(), ERROR_FAIL, ERROR_OK, arm::etm, ETM_CTRL, etm_get_reg(), etm_reg_lookup(), etm_store_reg(), get_current_target(), is_arm(), jtag_execute_queue(), etm_capture_driver::stop_capture, target, target_to_arm(), and reg::value.
COMMAND_HANDLER | ( | handle_etm_tracemode_command | ) |
todo: fail if parameters were invalid for this hardware, or couldn't be written; display actual hardware state...
Definition at line 1189 of file etm.c.
References buf_set_u32(), CALL_COMMAND_HANDLER, etm_context::capture_status, CMD, CMD_ARGC, CMD_CTX, command_print(), etm_context::control, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, arm::etm, ETM_CTRL, ETM_CTRL_BRANCH_OUTPUT, ETM_CTRL_CONTEXTID_16, ETM_CTRL_CONTEXTID_32, ETM_CTRL_CONTEXTID_8, ETM_CTRL_CONTEXTID_MASK, ETM_CTRL_CONTEXTID_NONE, ETM_CTRL_CYCLE_ACCURATE, ETM_CTRL_TRACE_ADDR, ETM_CTRL_TRACE_DATA, ETM_CTRL_TRACE_MASK, etm_reg_lookup(), etm_store_reg(), get_current_target(), is_arm(), NULL, target_to_arm(), etm_context::trace_data, etm_context::trace_depth, TRACE_IDLE, TRACEMODE_MASK, and reg::value.
COMMAND_HANDLER | ( | handle_etm_trigger_debug_command | ) |
Definition at line 1902 of file etm.c.
References buf_set_u32(), CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_ENABLE, command_print(), etm_context::control, ERROR_FAIL, ERROR_OK, arm::etm, ETM_CTRL, ETM_CTRL_DBGRQ, etm_reg_lookup(), get_current_target(), is_arm(), target, target_name(), target_to_arm(), and reg::value.
|
static |
Definition at line 1130 of file etm.c.
References CMD, CMD_ARGV, COMMAND_PARSE_ENABLE, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ETM_CTRL_BRANCH_OUTPUT, ETM_CTRL_CONTEXTID_16, ETM_CTRL_CONTEXTID_32, ETM_CTRL_CONTEXTID_8, ETM_CTRL_CONTEXTID_NONE, ETM_CTRL_CYCLE_ACCURATE, ETM_CTRL_TRACE_ADDR, ETM_CTRL_TRACE_DATA, and mode.
struct reg_cache* etm_build_reg_cache | ( | struct target * | target, |
struct arm_jtag * | jtag_info, | ||
struct etm_context * | etm_ctx | ||
) |
Definition at line 278 of file etm.c.
References ARRAY_SIZE, etm_context::bcd_vers, buf_get_u32(), etm_context::capture_driver, etm_context::capture_driver_priv, config, etm_context::config, etb_build_reg_cache(), etm_addr_comp, etm_basic, etm_core, etm_counters, etb::etm_ctx, etm_data_comp, etm_fifofull, etm_get_reg(), etm_outputs, etm_reg_add(), etm_sequencer, etm_context::id, etm_reg::jtag_info, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, etm_capture_driver::name, reg_cache::name, reg_cache::next, NULL, reg_cache::num_regs, etb::reg_cache, etm_context::reg_cache, reg_cache::reg_list, and etm_reg::value.
Referenced by arm11_examine(), and arm7_9_examine().
|
static |
Definition at line 467 of file etm.c.
References ERROR_OK, etm_read_reg(), jtag_execute_queue(), and LOG_ERROR.
Referenced by COMMAND_HANDLER(), etm_build_reg_cache(), and etm_setup().
|
static |
Definition at line 632 of file etm.c.
References arm_evaluate_opcode(), ARM_STATE_ARM, ARM_STATE_JAZELLE, ARM_STATE_THUMB, imagesection::base_address, etm_context::core_state, etm_context::current_pc, ERROR_FAIL, ERROR_OK, ERROR_TRACE_IMAGE_UNAVAILABLE, ERROR_TRACE_INSTRUCTION_UNAVAILABLE, etm_context::image, image_read_section(), LOG_ERROR, image::num_sections, image::sections, imagesection::size, etm_context::target, target_buffer_get_u16(), target_buffer_get_u32(), and thumb_evaluate_opcode().
Referenced by etmv1_analyze_trace().
|
static |
Definition at line 407 of file etm.c.
References etm_read_reg_w_check(), and NULL.
Referenced by etm_get_reg().
|
static |
Definition at line 486 of file etm.c.
References etm_reg_info::addr, reg::arch_info, arm_jtag_scann(), arm_jtag_set_instr(), buf_set_u32(), scan_field::check_mask, scan_field::check_value, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, scan_field::in_value, arm_jtag::intest_instr, jtag_add_dr_scan(), jtag_add_dr_scan_check(), etm_reg::jtag_info, LOG_DEBUG, LOG_ERROR, etm_reg_info::mode, etm_reg_info::name, NULL, scan_field::num_bits, scan_field::out_value, etm_reg::reg_info, arm_jtag::tap, TAP_IDLE, reg::value, and WO.
Referenced by etm_read_reg().
|
static |
Definition at line 241 of file etm.c.
References reg::arch_info, etm_reg_info::bcd_vers, etm_scan6_type, etm_reg::jtag_info, LOG_ERROR, etm_reg_info::name, reg::name, reg_cache::num_regs, etm_reg::reg_info, reg_cache::reg_list, etm_reg_info::size, reg::size, reg::type, etm_reg::value, and reg::value.
Referenced by etm_build_reg_cache().
|
static |
Definition at line 223 of file etm.c.
References reg::arch_info, LOG_ERROR, NULL, reg_cache::num_regs, etm_context::reg_cache, and reg_cache::reg_list.
Referenced by COMMAND_HANDLER(), and etm_setup().
|
static |
Definition at line 2096 of file etm.c.
References etm_exec_command_handlers, and register_commands().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 546 of file etm.c.
References buf_set_u32(), reg::dirty, ERROR_OK, etm_write_reg(), LOG_ERROR, reg::size, reg::valid, and reg::value.
Referenced by etm_set_reg_w_exec().
|
static |
Definition at line 561 of file etm.c.
References buf_get_u32(), ERROR_OK, etm_set_reg(), jtag_execute_queue(), LOG_ERROR, and reg::size.
int etm_setup | ( | struct target * | target | ) |
Definition at line 417 of file etm.c.
References buf_get_u32(), buf_set_u32(), etm_context::capture_driver, etm_context::control, ERROR_OK, arm::etm, ETM_CTRL, ETM_CTRL_DBGRQ, ETM_CTRL_POWERDOWN, etm_get_reg(), ETM_PORT_CLOCK_MASK, ETM_PORT_MODE_MASK, ETM_PORT_WIDTH_MASK, etm_reg_lookup(), etm_store_reg(), etm_capture_driver::init, jtag_execute_queue(), LOG_ERROR, target_to_arm(), and reg::value.
Referenced by arm11_examine(), and arm7_9_examine().
|
static |
Definition at line 412 of file etm.c.
References buf_get_u32(), etm_write_reg(), reg::size, and reg::value.
Referenced by COMMAND_HANDLER(), and etm_setup().
|
static |
Definition at line 575 of file etm.c.
References etm_reg_info::addr, reg::arch_info, arm_jtag_scann(), arm_jtag_set_instr(), buf_set_u32(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, scan_field::in_value, arm_jtag::intest_instr, jtag_add_dr_scan(), etm_reg::jtag_info, LOG_DEBUG, LOG_ERROR, etm_reg_info::mode, etm_reg_info::name, NULL, scan_field::num_bits, scan_field::out_value, etm_reg::reg_info, RO, arm_jtag::tap, and TAP_IDLE.
Referenced by etm_set_reg(), and etm_store_reg().
|
static |
Definition at line 848 of file etm.c.
References arm_access_size(), ARM_B, ARM_BL, ARM_BLX, ARM_LDM, ARM_LDR, ARM_STATE_ARM, ARM_STM, ARM_STRH, arm_instruction::b_bl_bx_blx, etm_context::capture_driver, cmd, command_print(), etm_context::control, etm_context::core_state, etm_context::current_pc, etm_context::data_half, etm_context::data_index, ERROR_ETM_ANALYSIS_FAILED, ERROR_FAIL, ERROR_OK, ERROR_TRACE_IMAGE_UNAVAILABLE, ERROR_TRACE_INSTRUCTION_UNAVAILABLE, ETM_CTRL_CYCLE_ACCURATE, ETM_CTRL_TRACE_ADDR, ETM_CTRL_TRACE_DATA, etm_read_instruction(), etmv1_branch_address(), etmv1_data(), etmv1_next_packet(), ETMV1_TRIGGER_CYCLE, etmv1_trace_data::flags, arm_instruction::info, etm_context::last_branch, etm_context::last_branch_reason, etm_context::last_instruction, etm_context::last_ptr, arm_instruction::load_store_multiple, LOG_ERROR, LOG_WARNING, etm_context::pc_ok, etm_context::pipe_index, etmv1_trace_data::pipestat, etm_context::ptr_ok, etm_capture_driver::read_trace, arm_load_store_multiple_instr::register_list, STAT_BD, STAT_BE, STAT_ID, STAT_IE, STAT_IN, STAT_TD, STAT_WT, arm_b_bl_bx_blx_instr::target_address, arm_instruction::text, etm_context::trace_data, etm_context::trace_depth, and arm_instruction::type.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 746 of file etm.c.
References ARM_STATE_ARM, ARM_STATE_JAZELLE, ARM_STATE_THUMB, etm_context::core_state, etm_context::data_index, etmv1_next_packet(), ETMV1_TRACESYNC_CYCLE, etm_context::last_branch, etm_context::last_branch_reason, etm_context::pc_ok, etm_context::pipe_index, etmv1_trace_data::pipestat, etm_context::trace_data, and etm_context::trace_depth.
Referenced by etmv1_analyze_trace().
|
static |
Definition at line 821 of file etm.c.
References etmv1_next_packet(), LOG_ERROR, size, etm_context::target, target_buffer_get_u16(), and target_buffer_get_u32().
Referenced by etmv1_analyze_trace().
|
static |
Definition at line 692 of file etm.c.
References etm_context::control, etm_context::data_half, etm_context::data_index, ETM_PORT_16BIT, ETM_PORT_8BIT, ETM_PORT_WIDTH_MASK, ETMV1_TRACESYNC_CYCLE, ETMV1_TRIGGER_CYCLE, etmv1_trace_data::flags, etmv1_trace_data::packet, etmv1_trace_data::pipestat, STAT_TD, etm_context::trace_data, and etm_context::trace_depth.
Referenced by etmv1_analyze_trace(), etmv1_branch_address(), and etmv1_data().
|
static |
Definition at line 1 of file etm.c.
Referenced by etm_build_reg_cache().
|
static |
Definition at line 1 of file etm.c.
Referenced by etm_build_reg_cache().
|
static |
Definition at line 626 of file etm.c.
Referenced by COMMAND_HANDLER().
const struct command_registration etm_command_handlers[] |
|
static |
|
static |
|
static |
Definition at line 1 of file etm.c.
Referenced by etm_build_reg_cache().
|
static |
Definition at line 1 of file etm.c.
Referenced by etm_build_reg_cache().
|
static |
Definition at line 1950 of file etm.c.
Referenced by etm_register_user_commands().
|
static |
|
static |
Definition at line 1 of file etm.c.
Referenced by etm_build_reg_cache().
|
static |
Definition at line 213 of file etm.c.
Referenced by etm_reg_add().
|
static |