OpenOCD
|
Go to the source code of this file.
Functions | |
int | arc_add_auxreg_actionpoint (struct target *target, uint32_t auxreg_addr, uint32_t transaction) |
static int | arc_add_breakpoint (struct target *target, struct breakpoint *breakpoint) |
static int | arc_add_watchpoint (struct target *target, struct watchpoint *watchpoint) |
static int | arc_arch_state (struct target *target) |
static int | arc_assert_reset (struct target *target) |
static int | arc_build_bcr_reg_cache (struct target *target) |
static int | arc_build_reg_cache (struct target *target) |
int | arc_cache_flush (struct target *target) |
int | arc_cache_invalidate (struct target *target) |
static int | arc_config_step (struct target *target, int enable_step) |
static int | arc_configure (struct target *target) |
static int | arc_configure_actionpoint (struct target *target, uint32_t ap_num, uint32_t match_value, uint32_t control_tt, uint32_t control_at) |
static int | arc_configure_dccm (struct target *target) |
static int | arc_configure_iccm (struct target *target) |
static int | arc_dcache_flush (struct target *target) |
static int | arc_dcache_invalidate (struct target *target) |
static int | arc_deassert_reset (struct target *target) |
static int | arc_debug_entry (struct target *target) |
static void | arc_deinit_target (struct target *target) |
static int | arc_enable_breakpoints (struct target *target) |
static int | arc_enable_interrupts (struct target *target, int enable) |
static int | arc_enable_watchpoints (struct target *target) |
static int | arc_examine (struct target *target) |
static int | arc_examine_debug_reason (struct target *target) |
static int | arc_exit_debug (struct target *target) |
static void | arc_free_reg_cache (struct reg_cache *cache) |
static int | arc_get_gdb_reg_list (struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class) |
static int | arc_get_register (struct reg *reg) |
static int | arc_get_register_value (struct target *target, const char *reg_name, uint32_t *value_ptr) |
static int | arc_halt (struct target *target) |
static int | arc_hit_watchpoint (struct target *target, struct watchpoint **hit_watchpoint) |
static int | arc_icache_invalidate (struct target *target) |
static int | arc_init_arch_info (struct target *target, struct arc_common *arc, struct jtag_tap *tap) |
static int | arc_init_reg (struct target *target, struct reg *reg, struct arc_reg_desc *reg_desc, unsigned long number) |
static int | arc_init_target (struct command_context *cmd_ctx, struct target *target) |
static int | arc_l2cache_flush (struct target *target) |
static int | arc_l2cache_invalidate (struct target *target) |
static int | arc_poll (struct target *target) |
static int | arc_read_instruction_u32 (struct target *target, uint32_t address, uint32_t *value) |
Read 32-bit instruction from memory. More... | |
int | arc_reg_add (struct target *target, struct arc_reg_desc *arc_reg, const char *const type_name, const size_t type_name_len) |
void | arc_reg_data_type_add (struct target *target, struct arc_reg_data_type *data_type) |
struct reg * | arc_reg_get_by_name (struct reg_cache *first, const char *name, bool search_all) |
Private implementation of register_get_by_name() for ARC that doesn't skip not [yet] existing registers. More... | |
int | arc_reg_get_field (struct target *target, const char *reg_name, const char *field_name, uint32_t *value_ptr) |
int | arc_remove_auxreg_actionpoint (struct target *target, uint32_t auxreg_addr) |
static int | arc_remove_breakpoint (struct target *target, struct breakpoint *breakpoint) |
static int | arc_remove_watchpoint (struct target *target, struct watchpoint *watchpoint) |
static void | arc_reset_actionpoints (struct target *target) |
static int | arc_reset_caches_states (struct target *target) |
Reset internal states of caches. More... | |
static int | arc_restore_context (struct target *target) |
See arc_save_context() for reason why we want to dump all regs at once. More... | |
static int | arc_resume (struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution) |
static int | arc_save_context (struct target *target) |
Read registers that are used in GDB g-packet. More... | |
int | arc_set_actionpoints_num (struct target *target, uint32_t ap_num) |
static int | arc_set_breakpoint (struct target *target, struct breakpoint *breakpoint) |
static int | arc_set_register (struct reg *reg, uint8_t *buf) |
static int | arc_set_register_value (struct target *target, const char *reg_name, uint32_t value) |
static int | arc_set_watchpoint (struct target *target, struct watchpoint *watchpoint) |
static int | arc_single_step_core (struct target *target) |
static int | arc_step (struct target *target, int current, target_addr_t address, int handle_breakpoints) |
static int | arc_target_create (struct target *target, Jim_Interp *interp) |
static int | arc_unset_breakpoint (struct target *target, struct breakpoint *breakpoint) |
static int | arc_unset_watchpoint (struct target *target, struct watchpoint *watchpoint) |
static int | arc_write_instruction_u32 (struct target *target, uint32_t address, uint32_t instr) |
Write 4-byte instruction to memory. More... | |
static int | get_current_actionpoint (struct target *target, struct arc_actionpoint **actionpoint) |
Finds an actionpoint that triggered last actionpoint event, as specified by DEBUG.ASR. More... | |
Variables | |
static const struct reg_arch_type | arc_reg_type |
struct target_type | arcv2_target |
static const char *const | reg_group_general = "general" |
static const char *const | reg_group_other = "" |
int arc_add_auxreg_actionpoint | ( | struct target * | target, |
uint32_t | auxreg_addr, | ||
uint32_t | transaction | ||
) |
Definition at line 1800 of file arc.c.
References arc_common::actionpoints_list, arc_common::actionpoints_num, AP_AC_AT_AUXREG_ADDR, arc_configure_actionpoint(), ERROR_OK, ERROR_TARGET_NOT_HALTED, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_ERROR, arc_actionpoint::reg_address, target::state, TARGET_HALTED, target_to_arc(), and arc_actionpoint::used.
|
static |
Definition at line 1725 of file arc.c.
References arc_set_breakpoint(), ERROR_TARGET_NOT_HALTED, LOG_TARGET_ERROR, target::state, and TARGET_HALTED.
|
static |
Definition at line 1975 of file arc.c.
References arc_set_watchpoint(), CHECK_RETVAL, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_TARGET_ERROR, target::state, and TARGET_HALTED.
|
static |
Definition at line 1149 of file arc.c.
References arc_get_register_value(), CHECK_RETVAL, debug_level, ERROR_OK, LOG_DEBUG, LOG_LVL_DEBUG, and target_state_name().
|
static |
Definition at line 1084 of file arc.c.
References CHECK_RETVAL, arc_common::core_and_aux_cache, ERROR_OK, jtag_add_reset(), jtag_add_sleep(), jtag_get_reset_config(), jtag_reset_config, LOG_DEBUG, register_cache_invalidate(), target::reset_halt, RESET_HAS_SRST, RESET_SRST_NO_GATING, RESET_SRST_PULLS_TRST, srst_asserted, target::state, TARGET_EVENT_RESET_ASSERT, target_halt(), TARGET_HALTED, target_handle_event(), target_has_event_action(), TARGET_RESET, target_resume(), target_state_name(), and target_to_arc().
|
static |
Definition at line 435 of file arc.c.
References arc_init_reg(), arc_common::bcr_cache, arc_common::bcr_cache_built, arc_common::bcr_reg_descriptions, CHECK_RETVAL, arc_common::core_and_aux_cache, ERROR_FAIL, ERROR_OK, reg::exist, feature, group, arc_reg_desc::list, list_empty(), list_for_each_entry, LOG_DEBUG, LOG_ERROR, name, reg_cache::name, reg_cache::next, NULL, arc_common::num_bcr_regs, arc_common::num_regs, reg_cache::num_regs, target::reg_cache, reg_cache::reg_list, register_get_last_cache_p(), and target_to_arc().
Referenced by arc_init_target().
|
static |
Definition at line 346 of file arc.c.
References arc_init_reg(), arc_common::aux_reg_descriptions, CHECK_RETVAL, arc_common::core_and_aux_cache, arc_common::core_aux_cache_built, arc_common::core_reg_descriptions, arc_common::debug_index_in_cache, ERROR_FAIL, ERROR_OK, feature, group, list_empty(), list_for_each_entry, LOG_DEBUG, LOG_ERROR, arc_reg_desc::name, name, reg_cache::name, reg_cache::next, NULL, arc_common::num_aux_regs, arc_common::num_core_regs, arc_common::num_regs, reg_cache::num_regs, arc_common::pc_index_in_cache, target::reg_cache, reg_cache::reg_list, register_get_last_cache_p(), and target_to_arc().
Referenced by arc_init_target().
int arc_cache_flush | ( | struct target * | target | ) |
Definition at line 2314 of file arc.c.
References arc_dcache_flush(), arc_l2cache_flush(), CHECK_RETVAL, and ERROR_OK.
Referenced by arc_mem_read_block(), arc_mem_write_block16(), arc_mem_write_block32(), and arc_mem_write_block8().
int arc_cache_invalidate | ( | struct target * | target | ) |
Definition at line 2237 of file arc.c.
References arc_dcache_invalidate(), arc_icache_invalidate(), arc_l2cache_invalidate(), CHECK_RETVAL, and ERROR_OK.
Referenced by arc_mem_write_block16(), arc_mem_write_block32(), and arc_mem_write_block8().
|
static |
Definition at line 2035 of file arc.c.
References arc_jtag_read_aux_reg_one(), arc_jtag_write_aux_reg_one(), AUX_DEBUG_REG, AUX_STATUS32_REG, CHECK_RETVAL, ERROR_OK, arc_common::jtag_info, LOG_DEBUG, SET_CORE_AE_BIT, SET_CORE_SINGLE_INSTR_STEP, and target_to_arc().
Referenced by arc_single_step_core(), and arc_step().
|
static |
Definition at line 717 of file arc.c.
References arc_configure_dccm(), arc_configure_iccm(), arc_reg_get_by_name(), CHECK_RETVAL, ERROR_OK, LOG_DEBUG, and target::reg_cache.
Referenced by arc_examine().
|
static |
Definition at line 1508 of file arc.c.
References arc_common::actionpoints_num, arc_common::actionpoints_num_avail, AP_AC_TT_DISABLE, arc_set_register_value(), CHECK_RETVAL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_ERROR, and target_to_arc().
Referenced by arc_add_auxreg_actionpoint(), arc_remove_auxreg_actionpoint(), arc_set_breakpoint(), arc_set_watchpoint(), arc_unset_breakpoint(), and arc_unset_watchpoint().
|
static |
Definition at line 638 of file arc.c.
References arc_get_register_value(), arc_reg_get_field(), CHECK_RETVAL, arc_common::dccm_end, arc_common::dccm_start, ERROR_OK, LOG_DEBUG, and target_to_arc().
Referenced by arc_configure().
|
static |
Definition at line 668 of file arc.c.
References arc_get_register_value(), arc_reg_get_field(), CHECK_RETVAL, ERROR_OK, arc_common::iccm0_end, arc_common::iccm0_start, arc_common::iccm1_end, arc_common::iccm1_start, LOG_DEBUG, and target_to_arc().
Referenced by arc_configure().
|
static |
Definition at line 2251 of file arc.c.
References arc_jtag_read_aux_reg_one(), arc_jtag_write_aux_reg_one(), AUX_DC_CTRL_REG, AUX_DC_IVDC_REG, CHECK_RETVAL, DC_CTRL_IM, DC_IVDC_INVALIDATE, arc_common::dcache_flushed, ERROR_OK, arc_common::has_dcache, arc_common::jtag_info, LOG_DEBUG, and target_to_arc().
Referenced by arc_cache_flush().
|
static |
Definition at line 2173 of file arc.c.
References arc_jtag_read_aux_reg_one(), arc_jtag_write_aux_reg_one(), AUX_DC_CTRL_REG, AUX_DC_IVDC_REG, CHECK_RETVAL, DC_CTRL_IM, DC_IVDC_INVALIDATE, arc_common::dcache_invalidated, ERROR_OK, arc_common::has_dcache, arc_common::jtag_info, LOG_DEBUG, and target_to_arc().
Referenced by arc_cache_invalidate().
|
static |
Definition at line 1139 of file arc.c.
References ERROR_OK, jtag_add_reset(), LOG_DEBUG, and target_state_name().
|
static |
Definition at line 1026 of file arc.c.
References arc_examine_debug_reason(), arc_reset_caches_states(), arc_save_context(), CHECK_RETVAL, and ERROR_OK.
Referenced by arc_poll(), arc_single_step_core(), and arc_step().
|
static |
Definition at line 1385 of file arc.c.
References arc_common::actionpoints_list, arc_free_reg_cache(), arc_common::aux_reg_descriptions, arc_common::bcr_cache, arc_common::bcr_cache_built, arc_common::bcr_reg_descriptions, arc_common::core_and_aux_cache, arc_common::core_aux_cache_built, arc_common::core_reg_descriptions, free_reg_desc(), arc_reg_desc::list, list_first_entry, list_for_each_entry_safe, list_for_each_entry_safe_reverse, LOG_DEBUG, arc_common::reg_data_types, REG_TYPE_CLASS_FLAGS, REG_TYPE_CLASS_STRUCT, target_to_arc(), and type.
|
static |
Definition at line 1711 of file arc.c.
References arc_set_breakpoint(), target::breakpoints, CHECK_RETVAL, ERROR_OK, breakpoint::is_set, and breakpoint::next.
Referenced by arc_resume().
|
static |
Definition at line 1251 of file arc.c.
References arc_jtag_read_aux_reg_one(), arc_jtag_write_aux_reg_one(), AUX_STATUS32_REG, CHECK_RETVAL, ERROR_OK, arc_common::jtag_info, LOG_DEBUG, SET_CORE_ENABLE_INTERRUPTS, and target_to_arc().
Referenced by arc_resume(), arc_single_step_core(), and arc_step().
|
static |
Definition at line 1961 of file arc.c.
References arc_set_watchpoint(), CHECK_RETVAL, ERROR_OK, watchpoint::is_set, watchpoint::next, and target::watchpoints.
Referenced by arc_resume().
|
static |
Definition at line 735 of file arc.c.
References arc_configure(), arc_jtag_startup(), ARC_JTAG_STAT_RU, arc_jtag_status(), CHECK_RETVAL, ERROR_OK, arc_common::jtag_info, target::state, status, TARGET_HALTED, TARGET_RUNNING, target_set_examined(), target_to_arc(), and target_was_examined().
|
static |
Definition at line 988 of file arc.c.
References ARC_AP_BREAKPOINT, ARC_AP_WATCHPOINT, arc_reg_get_field(), CHECK_RETVAL, DBG_REASON_BREAKPOINT, DBG_REASON_DBGRQ, DBG_REASON_SINGLESTEP, DBG_REASON_WATCHPOINT, target::debug_reason, ERROR_OK, get_current_actionpoint(), LOG_WARNING, NULL, arc_actionpoint::type, and arc_actionpoint::used.
Referenced by arc_debug_entry().
|
static |
Definition at line 758 of file arc.c.
References alive_sleep(), arc_jtag_read_aux_reg_one(), arc_jtag_write_aux_reg_one(), AUX_DEBUG_REG, AUX_STATUS32_REG, CHECK_RETVAL, debug_level, ERROR_OK, arc_common::jtag_info, LOG_DEBUG, LOG_LVL_DEBUG, SET_CORE_FORCE_HALT, target::state, target_call_event_callbacks(), TARGET_EVENT_HALTED, TARGET_HALTED, and target_to_arc().
Referenced by arc_single_step_core().
|
static |
Definition at line 1379 of file arc.c.
References reg_cache::reg_list.
Referenced by arc_deinit_target().
|
static |
Definition at line 493 of file arc.c.
References ERROR_FAIL, ERROR_OK, reg::exist, arc_common::last_general_reg, LOG_DEBUG, LOG_ERROR, reg_cache::next, arc_common::num_regs, reg_cache::num_regs, target::reg_cache, REG_CLASS_ALL, reg_cache::reg_list, and target_to_arc().
|
static |
Definition at line 219 of file arc.c.
References arc_jtag_read_aux_reg_one(), arc_jtag_read_core_reg_one(), ARC_R61, ARC_R62, reg::arch_info, arc_reg_desc::arch_num, CHECK_RETVAL, reg::dirty, ERROR_FAIL, ERROR_OK, arc_reg_desc::is_core, arc_common::jtag_info, LOG_DEBUG, LOG_ERROR, arc_reg_desc::name, reg::number, target::state, arc_reg_desc::target, target_buffer_get_u32(), target_buffer_set_u32(), TARGET_HALTED, target_to_arc(), reg::valid, and reg::value.
|
static |
Definition at line 597 of file arc.c.
References arc_reg_get_by_name(), CHECK_RETVAL, ERROR_ARC_REGISTER_NOT_FOUND, ERROR_OK, reg_arch_type::get, LOG_DEBUG, target::reg_cache, target_buffer_get_u32(), reg::type, reg::valid, and reg::value.
Referenced by arc_arch_state(), arc_configure_dccm(), arc_configure_iccm(), arc_halt(), and arc_poll().
|
static |
Definition at line 781 of file arc.c.
References alive_sleep(), arc_get_register_value(), arc_jtag_read_aux_reg_one(), arc_jtag_write_aux_reg_one(), AUX_DEBUG_REG, AUX_STATUS32_REG, AUX_STATUS32_REG_IE_BIT, CHECK_RETVAL, DBG_REASON_DBGRQ, debug_level, target::debug_reason, ERROR_OK, ERROR_TARGET_FAILURE, arc_common::irq_state, jtag_get_reset_config(), jtag_get_srst(), arc_common::jtag_info, LOG_DEBUG, LOG_ERROR, LOG_LVL_DEBUG, LOG_WARNING, RESET_SRST_PULLS_TRST, SET_CORE_FORCE_HALT, target::state, target_call_event_callbacks(), TARGET_EVENT_HALTED, TARGET_HALTED, TARGET_RESET, target_state_name(), target_to_arc(), and TARGET_UNKNOWN.
|
static |
Definition at line 2002 of file arc.c.
References watchpoint::address, ARC_AP_WATCHPOINT, arc_actionpoint::bp_value, CHECK_RETVAL, ERROR_FAIL, ERROR_OK, get_current_actionpoint(), LOG_DEBUG, LOG_WARNING, watchpoint::next, NULL, watchpoint::number, arc_actionpoint::type, watchpoint::unique_id, arc_actionpoint::used, and target::watchpoints.
|
static |
Definition at line 2152 of file arc.c.
References arc_jtag_write_aux_reg_one(), AUX_IC_IVIC_REG, CHECK_RETVAL, ERROR_OK, arc_common::has_icache, IC_IVIC_INVALIDATE, arc_common::icache_invalidated, arc_common::jtag_info, LOG_DEBUG, target_to_arc(), and reg::value.
Referenced by arc_cache_invalidate().
|
static |
Definition at line 120 of file arc.c.
References ARC_COMMON_MAGIC, arc_reg_data_type_add(), arc_reset_caches_states(), target::arch_info, ARRAY_SIZE, arc_common::aux_reg_descriptions, arc_common::bcr_reg_descriptions, arc_common::common_magic, arc_common::core_reg_descriptions, arc_reg_data_type::data_type, arc_common::debug_index_in_cache, ERROR_FAIL, ERROR_OK, arc_common::has_dcache, arc_common::has_icache, arc_common::has_l2cache, reg_data_type::id, INIT_LIST_HEAD(), jtag_tap::ir_length, arc_common::jtag_info, arc_common::last_general_reg, LOG_ERROR, arc_common::num_aux_regs, arc_common::num_bcr_regs, arc_common::num_core_regs, arc_common::num_regs, arc_common::pc_index_in_cache, arc_common::reg_data_types, standard_gdb_types, arc_jtag::tap, and reg_data_type::type.
Referenced by arc_target_create().
|
static |
Definition at line 303 of file arc.c.
References arc_reg_type, reg::arch_info, reg::caller_save, arc_reg_desc::data_type, ERROR_OK, arc_reg_desc::feature, reg::feature, arc_reg_desc::gdb_xml_feature, reg::group, arc_reg_desc::is_general, arc_common::last_general_reg, arc_reg_desc::name, reg_feature::name, reg::name, number, reg::number, reg::reg_data_type, reg_group_general, reg_group_other, arc_reg_desc::reg_value, reg::size, target_to_arc(), reg::type, and reg::value.
Referenced by arc_build_bcr_reg_cache(), and arc_build_reg_cache().
|
static |
Definition at line 1371 of file arc.c.
References arc_build_bcr_reg_cache(), arc_build_reg_cache(), CHECK_RETVAL, DBG_REASON_DBGRQ, target::debug_reason, and ERROR_OK.
|
static |
Definition at line 2288 of file arc.c.
References arc_jtag_read_aux_reg_one(), arc_jtag_write_aux_reg_one(), CHECK_RETVAL, ERROR_OK, arc_common::has_l2cache, arc_common::jtag_info, L2_CTRL_BS, L2_FLUSH_FL, arc_common::l2cache_flushed, LOG_DEBUG, SLC_AUX_CACHE_CTRL, SLC_AUX_CACHE_FLUSH, and target_to_arc().
Referenced by arc_cache_flush().
|
static |
Definition at line 2202 of file arc.c.
References arc_jtag_read_aux_reg_one(), arc_jtag_write_aux_reg_one(), CHECK_RETVAL, ERROR_OK, arc_common::has_l2cache, arc_common::jtag_info, L2_CTRL_BS, L2_CTRL_IM, L2_INV_IV, arc_common::l2cache_invalidated, LOG_DEBUG, SLC_AUX_CACHE_CTRL, SLC_AUX_CACHE_INV, and target_to_arc().
Referenced by arc_cache_invalidate().
|
static |
Definition at line 1038 of file arc.c.
References arc_debug_entry(), arc_get_register_value(), ARC_JTAG_STAT_RU, arc_jtag_status(), AUX_STATUS32_REG_HALT_BIT, CHECK_RETVAL, ERROR_OK, arc_common::jtag_info, LOG_DEBUG, LOG_WARNING, target::state, status, target_call_event_callbacks(), TARGET_DEBUG_RUNNING, TARGET_EVENT_DEBUG_HALTED, TARGET_EVENT_HALTED, TARGET_HALTED, TARGET_RESET, TARGET_RUNNING, and target_to_arc().
|
static |
Read 32-bit instruction from memory.
It is like target_read_u32, however in case of little endian ARC instructions are in middle endian format, so different type of conversion should be done.
Definition at line 1477 of file arc.c.
References arc_me_to_h_u32(), be_to_h_u32(), CHECK_RETVAL, target::endianness, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_LITTLE_ENDIAN, target_read_buffer(), and target_was_examined().
Referenced by arc_set_breakpoint(), and arc_unset_breakpoint().
int arc_reg_add | ( | struct target * | target, |
struct arc_reg_desc * | arc_reg, | ||
const char *const | type_name, | ||
const size_t | type_name_len | ||
) |
Definition at line 174 of file arc.c.
References arc_reg_desc::arch_num, arc_common::aux_reg_descriptions, arc_common::bcr_reg_descriptions, arc_common::core_reg_descriptions, arc_reg_desc::data_type, ERROR_ARC_REGTYPE_NOT_FOUND, ERROR_OK, reg_data_type::id, arc_reg_desc::is_bcr, arc_reg_desc::is_core, arc_reg_desc::is_general, arc_reg_data_type::list, arc_reg_desc::list, list_add_tail(), list_for_each_entry, LOG_DEBUG, arc_reg_desc::name, arc_common::num_aux_regs, arc_common::num_bcr_regs, arc_common::num_core_regs, arc_common::num_regs, arc_common::reg_data_types, target_to_arc(), and type.
Referenced by COMMAND_HELPER().
void arc_reg_data_type_add | ( | struct target * | target, |
struct arc_reg_data_type * | data_type | ||
) |
Definition at line 61 of file arc.c.
References data_type, reg_data_type::id, list_add_tail(), LOG_DEBUG, arc_common::reg_data_types, and target_to_arc().
Referenced by arc_init_arch_info(), and COMMAND_HANDLER().
Private implementation of register_get_by_name() for ARC that doesn't skip not [yet] existing registers.
Used in many places for iteration through registers and even for marking required registers as existing.
Definition at line 77 of file arc.c.
References name, reg::name, reg_cache::next, NULL, reg_cache::num_regs, and reg_cache::reg_list.
Referenced by arc_configure(), arc_get_register_value(), arc_reg_get_field(), arc_set_register_value(), and COMMAND_HANDLER().
int arc_reg_get_field | ( | struct target * | target, |
const char * | reg_name, | ||
const char * | field_name, | ||
uint32_t * | value_ptr | ||
) |
Definition at line 549 of file arc.c.
References arc_reg_get_by_name(), reg_data_type_struct_field::bitfield, buf_get_u32(), CHECK_RETVAL, reg_data_type_bitfield::end, ERROR_ARC_FIELD_IS_NOT_BITFIELD, ERROR_ARC_REGISTER_FIELD_NOT_FOUND, ERROR_ARC_REGISTER_IS_NOT_STRUCT, ERROR_ARC_REGISTER_NOT_FOUND, ERROR_OK, reg_data_type_struct::fields, reg_arch_type::get, LOG_DEBUG, LOG_ERROR, reg_data_type_struct_field::name, reg_data_type_struct_field::next, target::reg_cache, reg::reg_data_type, REG_TYPE_ARCH_DEFINED, REG_TYPE_CLASS_STRUCT, reg_data_type::reg_type_struct, reg_data_type_bitfield::start, reg_data_type::type, reg::type, reg_data_type::type_class, reg_data_type_struct_field::use_bitfields, reg::valid, and reg::value.
Referenced by arc_configure_dccm(), arc_configure_iccm(), arc_examine_debug_reason(), COMMAND_HANDLER(), and get_current_actionpoint().
int arc_remove_auxreg_actionpoint | ( | struct target * | target, |
uint32_t | auxreg_addr | ||
) |
Definition at line 1832 of file arc.c.
References arc_common::actionpoints_list, AP_AC_AT_AUXREG_ADDR, AP_AC_TT_DISABLE, arc_configure_actionpoint(), arc_actionpoint::bp_value, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, arc_actionpoint::reg_address, target::state, TARGET_HALTED, target_to_arc(), and arc_actionpoint::used.
Referenced by arc_reset_actionpoints().
|
static |
Definition at line 1736 of file arc.c.
References arc_unset_breakpoint(), CHECK_RETVAL, ERROR_OK, ERROR_TARGET_NOT_HALTED, breakpoint::is_set, LOG_TARGET_ERROR, target::state, and TARGET_HALTED.
Referenced by arc_reset_actionpoints().
|
static |
Definition at line 1988 of file arc.c.
References arc_unset_watchpoint(), CHECK_RETVAL, ERROR_OK, ERROR_TARGET_NOT_HALTED, watchpoint::is_set, LOG_TARGET_ERROR, target::state, and TARGET_HALTED.
Referenced by arc_reset_actionpoints().
|
static |
Definition at line 1750 of file arc.c.
References arc_common::actionpoints_list, arc_common::actionpoints_num, arc_remove_auxreg_actionpoint(), arc_remove_breakpoint(), arc_remove_watchpoint(), target::breakpoints, breakpoint::next, watchpoint::next, breakpoint::orig_instr, target_to_arc(), and target::watchpoints.
Referenced by arc_set_actionpoints_num().
|
static |
Reset internal states of caches.
Must be called when entering debugging.
target | Target for which to reset caches states. |
Definition at line 103 of file arc.c.
References arc_common::dcache_flushed, arc_common::dcache_invalidated, ERROR_OK, arc_common::icache_invalidated, arc_common::l2cache_flushed, arc_common::l2cache_invalidated, LOG_DEBUG, and target_to_arc().
Referenced by arc_debug_entry(), arc_init_arch_info(), and arc_resume().
|
static |
See arc_save_context() for reason why we want to dump all regs at once.
This however means that if there are dependencies between registers they will not be observable until target will be resumed.
Definition at line 1170 of file arc.c.
References arc_jtag_write_aux_reg(), arc_jtag_write_core_reg(), reg::arch_info, arc_reg_desc::arch_num, arc_common::core_and_aux_cache, reg::dirty, ERROR_FAIL, ERROR_OK, reg::exist, arc_common::jtag_info, LOG_DEBUG, LOG_ERROR, arc_common::num_aux_regs, arc_common::num_core_regs, reg_cache::reg_list, target_buffer_get_u32(), target_to_arc(), reg::valid, and reg::value.
Referenced by arc_resume(), and arc_step().
|
static |
Definition at line 1274 of file arc.c.
References breakpoint::address, arc_enable_breakpoints(), arc_enable_interrupts(), arc_enable_watchpoints(), arc_jtag_read_aux_reg_one(), arc_jtag_write_aux_reg_one(), arc_reset_caches_states(), arc_restore_context(), arc_set_breakpoint(), arc_single_step_core(), arc_unset_breakpoint(), AUX_PC_REG, AUX_STATUS32_REG, breakpoint_find(), CHECK_RETVAL, arc_common::core_and_aux_cache, DBG_REASON_NOTHALTED, target::debug_reason, reg::dirty, ERROR_OK, ERROR_TARGET_NOT_HALTED, arc_common::irq_state, arc_common::jtag_info, LOG_DEBUG, LOG_TARGET_ERROR, arc_common::pc_index_in_cache, reg_cache::reg_list, register_cache_invalidate(), SET_CORE_HALT_BIT, target::state, target_buffer_get_u32(), target_buffer_set_u32(), target_call_event_callbacks(), TARGET_DEBUG_RUNNING, TARGET_EVENT_DEBUG_RESUMED, TARGET_EVENT_RESUMED, target_free_all_working_areas(), TARGET_HALTED, TARGET_PRIxADDR, TARGET_RUNNING, target_to_arc(), reg::valid, and reg::value.
|
static |
Read registers that are used in GDB g-packet.
We don't read them one-by-one, but do that in one batch operation to improve speed. Calls to JTAG layer are expensive so it is better to make one big call that reads all necessary registers, instead of many calls, one for one register.
Definition at line 842 of file arc.c.
References arc_jtag_read_aux_reg(), arc_jtag_read_core_reg(), reg::arch_info, arc_reg_desc::arch_num, arc_common::core_and_aux_cache, reg::dirty, ERROR_FAIL, ERROR_OK, reg::exist, arc_common::jtag_info, arc_common::last_general_reg, LOG_DEBUG, LOG_ERROR, MIN, arc_reg_desc::name, arc_common::num_aux_regs, arc_common::num_core_regs, arc_common::num_regs, reg_cache::reg_list, target_buffer_set_u32(), target_to_arc(), reg::valid, and reg::value.
Referenced by arc_debug_entry().
int arc_set_actionpoints_num | ( | struct target * | target, |
uint32_t | ap_num | ||
) |
Definition at line 1776 of file arc.c.
References arc_common::actionpoints_list, arc_common::actionpoints_num, arc_common::actionpoints_num_avail, arc_reset_actionpoints(), ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, target_name(), and target_to_arc().
|
static |
Definition at line 1546 of file arc.c.
References arc_common::actionpoints_list, arc_common::actionpoints_num, breakpoint::address, AP_AC_AT_INST_ADDR, AP_AC_TT_READWRITE, ARC_AP_BREAKPOINT, arc_configure_actionpoint(), arc_read_instruction_u32(), ARC_SDBBP_16, ARC_SDBBP_32, arc_write_instruction_u32(), BKPT_HARD, BKPT_SOFT, arc_actionpoint::bp_value, breakpoint_hw_set(), CHECK_RETVAL, ERROR_COMMAND_ARGUMENT_INVALID, ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, breakpoint::is_set, breakpoint::length, LOG_DEBUG, LOG_ERROR, LOG_WARNING, breakpoint::orig_instr, TARGET_PRIxADDR, target_read_buffer(), target_read_u16(), target_to_arc(), target_write_u16(), arc_actionpoint::type, breakpoint::type, breakpoint::unique_id, and arc_actionpoint::used.
Referenced by arc_add_breakpoint(), arc_enable_breakpoints(), arc_resume(), and arc_step().
|
static |
|
static |
Definition at line 615 of file arc.c.
References arc_reg_get_by_name(), buf_set_u32(), CHECK_RETVAL, ERROR_ARC_REGISTER_NOT_FOUND, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, target::reg_cache, reg_arch_type::set, reg::type, and reg::value.
Referenced by arc_configure_actionpoint().
|
static |
Definition at line 1867 of file arc.c.
References arc_common::actionpoints_list, arc_common::actionpoints_num, watchpoint::address, AP_AC_AT_MEMORY_ADDR, AP_AC_TT_DISABLE, AP_AC_TT_READ, AP_AC_TT_READWRITE, AP_AC_TT_WRITE, ARC_AP_WATCHPOINT, arc_configure_actionpoint(), arc_actionpoint::bp_value, ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, ERROR_TARGET_UNALIGNED_ACCESS, watchpoint::is_set, watchpoint::length, LOG_DEBUG, LOG_ERROR, LOG_WARNING, watchpoint::rw, target_to_arc(), arc_actionpoint::type, watchpoint::unique_id, arc_actionpoint::used, watchpoint_set(), WPT_ACCESS, WPT_READ, and WPT_WRITE.
Referenced by arc_add_watchpoint(), and arc_enable_watchpoints().
|
static |
Definition at line 2071 of file arc.c.
References arc_config_step(), arc_debug_entry(), arc_enable_interrupts(), arc_exit_debug(), CHECK_RETVAL, and ERROR_OK.
Referenced by arc_resume().
|
static |
Definition at line 2087 of file arc.c.
References alive_sleep(), arc_config_step(), arc_debug_entry(), arc_enable_interrupts(), arc_restore_context(), arc_set_breakpoint(), arc_unset_breakpoint(), breakpoint_find(), buf_get_u32(), buf_set_u32(), CHECK_RETVAL, arc_common::core_and_aux_cache, DBG_REASON_SINGLESTEP, target::debug_reason, reg::dirty, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_DEBUG, LOG_TARGET_ERROR, NULL, arc_common::pc_index_in_cache, reg_cache::reg_list, register_cache_invalidate(), target::state, target_call_event_callbacks(), TARGET_EVENT_HALTED, TARGET_EVENT_RESUMED, TARGET_HALTED, target_to_arc(), reg::valid, and reg::value.
|
static |
Definition at line 1429 of file arc.c.
References arc_init_arch_info(), CHECK_RETVAL, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, and target::tap.
|
static |
Definition at line 1629 of file arc.c.
References arc_common::actionpoints_list, arc_common::actionpoints_num, breakpoint::address, AP_AC_AT_INST_ADDR, AP_AC_TT_DISABLE, arc_configure_actionpoint(), arc_read_instruction_u32(), ARC_SDBBP_16, ARC_SDBBP_32, BKPT_HARD, BKPT_SOFT, arc_actionpoint::bp_value, CHECK_RETVAL, ERROR_COMMAND_ARGUMENT_INVALID, ERROR_FAIL, ERROR_OK, breakpoint::is_set, breakpoint::length, LOG_DEBUG, LOG_ERROR, LOG_WARNING, breakpoint::number, breakpoint::orig_instr, TARGET_PRIxADDR, target_read_u16(), target_to_arc(), target_write_buffer(), breakpoint::type, breakpoint::unique_id, and arc_actionpoint::used.
Referenced by arc_remove_breakpoint(), arc_resume(), and arc_step().
|
static |
Definition at line 1927 of file arc.c.
References arc_common::actionpoints_list, arc_common::actionpoints_num, watchpoint::address, AP_AC_AT_MEMORY_ADDR, AP_AC_TT_DISABLE, arc_configure_actionpoint(), arc_actionpoint::bp_value, ERROR_OK, watchpoint::is_set, LOG_DEBUG, LOG_WARNING, watchpoint::number, target_to_arc(), watchpoint::unique_id, and arc_actionpoint::used.
Referenced by arc_remove_watchpoint().
|
static |
Write 4-byte instruction to memory.
This is like target_write_u32, however in case of little endian ARC instructions are in middle endian format, not little endian, so different type of conversion should be done. Middle endian: instruction "aabbccdd", stored as "bbaaddcc"
Definition at line 1450 of file arc.c.
References arc_h_u32_to_me(), CHECK_RETVAL, target::endianness, ERROR_FAIL, ERROR_OK, h_u32_to_be(), LOG_DEBUG, LOG_ERROR, TARGET_LITTLE_ENDIAN, target_was_examined(), and target_write_buffer().
Referenced by arc_set_breakpoint().
|
static |
Finds an actionpoint that triggered last actionpoint event, as specified by DEBUG.ASR.
target | |
actionpoint | Pointer to be set to last active actionpoint. Pointer will be set to NULL if DEBUG.AH is 0. |
Definition at line 957 of file arc.c.
References arc_common::actionpoints_list, arc_common::actionpoints_num, arc_reg_get_field(), CHECK_RETVAL, ERROR_OK, NULL, and target_to_arc().
Referenced by arc_examine_debug_reason(), and arc_hit_watchpoint().
|
static |
Definition at line 266 of file arc.c.
Referenced by arc_init_reg().
struct target_type arcv2_target |
|
static |
Definition at line 299 of file arc.c.
Referenced by arc_init_reg().
|
static |
Definition at line 300 of file arc.c.
Referenced by arc_init_reg().