OpenOCD
|
Go to the source code of this file.
Functions | |
bool | check_not_halted (const struct target *t) |
static int | disable_paging (struct target *t) |
static int | do_halt (struct target *t) |
static int | do_resume (struct target *t) |
static int | drscan (struct target *t, uint8_t *out, uint8_t *in, uint8_t len) |
static int | enable_paging (struct target *t) |
static int | enter_probemode (struct target *t) |
static int | exit_probemode (struct target *t) |
static uint8_t | get_num_user_regs (struct target *t) |
static uint32_t | get_tapstatus (struct target *t) |
static int | halt_prep (struct target *t) |
static int | irscan (struct target *t, uint8_t *out, uint8_t *in, uint8_t ir_len) |
static bool | is_paging_enabled (struct target *t) |
int | lakemont_arch_state (struct target *t) |
static struct reg_cache * | lakemont_build_reg_cache (struct target *target) |
static int | lakemont_get_core_reg (struct reg *reg) |
int | lakemont_halt (struct target *t) |
int | lakemont_init_arch_info (struct target *t, struct x86_32_common *x86_32) |
int | lakemont_init_target (struct command_context *cmd_ctx, struct target *t) |
int | lakemont_poll (struct target *t) |
int | lakemont_reset_assert (struct target *t) |
static int | lakemont_reset_break (struct target *t) |
int | lakemont_reset_deassert (struct target *t) |
int | lakemont_resume (struct target *t, int current, target_addr_t address, int handle_breakpoints, int debug_execution) |
static int | lakemont_set_core_reg (struct reg *reg, uint8_t *buf) |
int | lakemont_step (struct target *t, int current, target_addr_t address, int handle_breakpoints) |
int | lakemont_update_after_probemode_entry (struct target *t) |
static int | read_all_core_hw_regs (struct target *t) |
static int | read_hw_reg (struct target *t, int reg, uint32_t *regval, uint8_t cache) |
static int | restore_context (struct target *target) |
static int | save_context (struct target *target) |
static int | submit_instruction (struct target *t, int num) |
static int | submit_instruction_pir (struct target *t, int num) |
static int | submit_pir (struct target *t, uint64_t op) |
static int | submit_reg_pir (struct target *t, int num) |
static bool | sw_bpts_supported (struct target *t) |
static int | transaction_status (struct target *t) |
static int | write_all_core_hw_regs (struct target *t) |
static int | write_hw_reg (struct target *t, int reg, uint32_t regval, uint8_t cache) |
Variables | |
struct { | |
uint8_t id | |
const char * name | |
uint64_t op | |
} | instructions [] |
static const struct reg_arch_type | lakemont_reg_type |
struct { | |
unsigned bits | |
const char * feature | |
const char * group | |
uint8_t id | |
const char * name | |
uint64_t op | |
uint8_t pm_idx | |
enum reg_type type | |
} | regs [] |
static struct scan_blk | scan |
bool check_not_halted | ( | const struct target * | t | ) |
Definition at line 206 of file lakemont.c.
References halted(), LOG_ERROR, target::state, and TARGET_HALTED.
Referenced by lakemont_get_core_reg(), lakemont_resume(), lakemont_step(), quark_d20xx_reset_deassert(), read_hw_reg_to_cache(), read_phys_mem(), write_hw_reg_from_cache(), write_phys_mem(), x86_32_common_add_breakpoint(), x86_32_common_add_watchpoint(), x86_32_common_read_io(), x86_32_common_read_memory(), x86_32_common_remove_breakpoint(), x86_32_common_remove_watchpoint(), x86_32_common_write_io(), x86_32_common_write_memory(), and x86_32_common_write_phys_mem().
|
static |
Definition at line 722 of file lakemont.c.
References CR0, CR0_PG, ERROR_OK, I, LOG_ERROR, x86_32_common::pm_regs, target_to_x86_32(), and x86_32_common::write_hw_reg.
Referenced by lakemont_init_arch_info().
|
static |
Definition at line 558 of file lakemont.c.
References enter_probemode(), ERROR_FAIL, ERROR_OK, lakemont_update_after_probemode_entry(), target::state, and TARGET_DEBUG_RUNNING.
Referenced by lakemont_halt().
|
static |
Definition at line 580 of file lakemont.c.
References DBG_REASON_NOTHALTED, target::debug_reason, ERROR_FAIL, ERROR_OK, exit_probemode(), LOG_USER, restore_context(), target::state, target_call_event_callbacks(), TARGET_DEBUG_RUNNING, TARGET_EVENT_RESUMED, and TARGET_RUNNING.
Referenced by lakemont_resume().
|
static |
Definition at line 247 of file lakemont.c.
References x86_32_common::curr_tap, ERROR_FAIL, ERROR_OK, scan_blk::field, x86_32_common::flush, scan_field::in_value, jtag_add_dr_scan(), jtag_execute_queue(), LOG_DEBUG, LOG_ERROR, MAX_SCAN_SIZE, scan_field::num_bits, scan_field::out_value, scan, target::tap, TAP_IDLE, and target_to_x86_32().
Referenced by enter_probemode(), exit_probemode(), get_tapstatus(), read_hw_reg(), submit_pir(), and write_hw_reg().
|
static |
Definition at line 734 of file lakemont.c.
References CR0, CR0_PG, ERROR_OK, I, LOG_ERROR, x86_32_common::pm_regs, target_to_x86_32(), and x86_32_common::write_hw_reg.
Referenced by lakemont_init_arch_info().
|
static |
Definition at line 433 of file lakemont.c.
References drscan(), ERROR_FAIL, ERROR_OK, get_tapstatus(), scan_blk::in, irscan(), LMT_IRLEN, LOG_DEBUG, LOG_ERROR, NULL, scan_blk::out, PROBEMODE, scan, TS_EN_PM_BIT, and TS_PM_BIT.
Referenced by do_halt().
|
static |
Definition at line 463 of file lakemont.c.
References drscan(), ERROR_FAIL, ERROR_OK, get_tapstatus(), scan_blk::in, irscan(), LMT_IRLEN, LOG_DEBUG, LOG_USER, NULL, scan_blk::out, PROBEMODE, scan, and TS_PM_BIT.
Referenced by do_resume(), and lakemont_step().
|
static |
Definition at line 716 of file lakemont.c.
References x86_32_common::cache, reg_cache::num_regs, and target_to_x86_32().
Referenced by lakemont_init_arch_info().
|
static |
Definition at line 423 of file lakemont.c.
References buf_get_u32(), drscan(), ERROR_OK, irscan(), LMT_IRLEN, NULL, scan_blk::out, scan, TAPSTATUS, and TS_SIZE.
Referenced by enter_probemode(), exit_probemode(), lakemont_poll(), lakemont_step(), sw_bpts_supported(), and transaction_status().
|
static |
Definition at line 482 of file lakemont.c.
References buf_get_u32(), x86_32_common::cache, x86_32_common::core_type, CR0, CR0_CD, CR0_NW, CR0_PG, CSAR, CSAR_DPL, CSB, CSL, DR7, DSAR, DSB, DSL, EFLAGS, EFLAGS_IF, EFLAGS_VM86, ERROR_FAIL, ERROR_OK, I, LMT3_5, LOG_DEBUG, name, PM_DR7, PM_DSAR, PM_DSB, PM_DSL, x86_32_common::pm_regs, reg_cache::reg_list, regs, SSAR, SSAR_DPL, submit_reg_pir(), target_to_x86_32(), reg::value, WBINVD, and write_hw_reg().
Referenced by lakemont_poll(), lakemont_step(), and lakemont_update_after_probemode_entry().
|
static |
Definition at line 214 of file lakemont.c.
References x86_32_common::curr_tap, jtag_tap::enabled, ERROR_FAIL, ERROR_OK, scan_blk::field, x86_32_common::flush, scan_field::in_value, jtag_tap::ir_length, jtag_add_ir_scan(), jtag_execute_queue(), LOG_ERROR, scan_field::num_bits, scan_field::out_value, scan, target::tap, TAP_IDLE, and target_to_x86_32().
Referenced by enter_probemode(), exit_probemode(), get_tapstatus(), read_hw_reg(), submit_pir(), and write_hw_reg().
|
static |
Definition at line 707 of file lakemont.c.
References CR0, CR0_PG, I, x86_32_common::pm_regs, and target_to_x86_32().
Referenced by lakemont_init_arch_info().
int lakemont_arch_state | ( | struct target * | t | ) |
Definition at line 966 of file lakemont.c.
References buf_get_u32(), x86_32_common::cache, CR0, CR0_PE, debug_reason_name(), EIP, ERROR_OK, LOG_USER, reg_cache::reg_list, target_to_x86_32(), and reg::value.
Definition at line 362 of file lakemont.c.
References reg::arch_info, ARRAY_SIZE, x86_32_common::cache, reg::caller_save, reg::dirty, reg::exist, feature, reg::feature, reg::group, lakemont_reg_type, LOG_ERROR, reg::name, reg_cache::name, reg_cache::next, NULL, reg_cache::num_regs, reg::number, lakemont_core_reg::op, lakemont_core_reg::pm_idx, target::reg_cache, reg::reg_data_type, reg_cache::reg_list, register_get_last_cache_p(), regs, reg::size, lakemont_core_reg::target, target_to_x86_32(), reg_data_type::type, reg::type, reg::valid, reg::value, and lakemont_core_reg::x86_32_common.
Referenced by lakemont_init_target().
|
static |
Definition at line 328 of file lakemont.c.
References reg::arch_info, buf_get_u32(), check_not_halted(), ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_DEBUG, reg::name, lakemont_core_reg::target, and reg::value.
int lakemont_halt | ( | struct target * | t | ) |
Definition at line 978 of file lakemont.c.
References DBG_REASON_DBGRQ, target::debug_reason, do_halt(), ERROR_FAIL, ERROR_OK, LOG_ERROR, target::state, and TARGET_RUNNING.
Referenced by lakemont_reset_assert().
int lakemont_init_arch_info | ( | struct target * | t, |
struct x86_32_common * | x86_32 | ||
) |
Definition at line 833 of file lakemont.c.
References disable_paging(), x86_32_common::disable_paging, enable_paging(), x86_32_common::enable_paging, ERROR_OK, get_num_user_regs(), x86_32_common::get_num_user_regs, is_paging_enabled(), x86_32_common::is_paging_enabled, read_hw_reg(), x86_32_common::read_hw_reg, submit_instruction(), x86_32_common::submit_instruction, sw_bpts_supported(), x86_32_common::sw_bpts_supported, transaction_status(), x86_32_common::transaction_status, write_hw_reg(), and x86_32_common::write_hw_reg.
Referenced by quark_d20xx_target_create().
int lakemont_init_target | ( | struct command_context * | cmd_ctx, |
struct target * | t | ||
) |
Definition at line 825 of file lakemont.c.
References DBG_REASON_NOTHALTED, target::debug_reason, ERROR_OK, lakemont_build_reg_cache(), target::state, and TARGET_RUNNING.
Referenced by quark_d20xx_init_target().
int lakemont_poll | ( | struct target * | t | ) |
Definition at line 847 of file lakemont.c.
References BKPT_SOFT, breakpoint_find(), buf_get_u32(), buf_set_u32(), x86_32_common::cache, DBG_REASON_BREAKPOINT, DBG_REASON_UNDEFINED, target::debug_reason, reg::dirty, DR0, DR1, DR2, DR3, DR6, DR6_BRKDETECT_0, DR6_BRKDETECT_1, DR6_BRKDETECT_2, DR6_BRKDETECT_3, DR7, DR7_BP_EXECUTE, DR7_BP_WRITE, DR7_RW_LEN_SIZE, DR7_RW_SHIFT, EIP, ERROR_FAIL, ERROR_OK, get_tapstatus(), halt_prep(), LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_USER, NULL, reg_cache::reg_list, save_context(), target::state, target_call_event_callbacks(), TARGET_DEBUG_RUNNING, TARGET_EVENT_HALTED, TARGET_HALTED, TARGET_RUNNING, target_to_x86_32(), TS_PM_BIT, TS_PMCR_BIT, breakpoint::type, type, reg::valid, and reg::value.
Referenced by lakemont_reset_deassert().
int lakemont_reset_assert | ( | struct target * | t | ) |
Definition at line 1164 of file lakemont.c.
References BYTE, ERROR_OK, x86_32_common::forced_halt_for_reset, lakemont_halt(), lakemont_reset_break(), lakemont_resume(), LOG_DEBUG, LOG_ERROR, target::reset_halt, target::state, TARGET_HALTED, target_to_x86_32(), x86_32_common_reset_breakpoints_watchpoints(), and x86_32_common_write_io().
|
static |
Definition at line 1109 of file lakemont.c.
References x86_32_common::curr_tap, ERROR_FAIL, ERROR_OK, scan_blk::field, scan_field::in_value, jtag_add_dr_scan(), jtag_add_ir_scan(), jtag_execute_queue(), jtag_tap_by_position(), LOG_DEBUG, LOG_ERROR, NULL, scan_field::num_bits, scan_blk::out, scan_field::out_value, scan, TAP_IDLE, and target_to_x86_32().
Referenced by lakemont_reset_assert().
int lakemont_reset_deassert | ( | struct target * | t | ) |
Definition at line 1208 of file lakemont.c.
References ERROR_OK, lakemont_poll(), lakemont_update_after_probemode_entry(), LOG_DEBUG, LOG_ERROR, LOG_WARNING, target::reset_halt, target::state, target_halt(), TARGET_HALTED, target_name(), TARGET_UNKNOWN, and target_was_examined().
int lakemont_resume | ( | struct target * | t, |
int | current, | ||
target_addr_t | address, | ||
int | handle_breakpoints, | ||
int | debug_execution | ||
) |
Definition at line 991 of file lakemont.c.
References breakpoint_find(), target::breakpoints, buf_get_u32(), buf_set_u32(), x86_32_common::cache, check_not_halted(), do_resume(), EIP, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, breakpoint::is_set, watchpoint::is_set, lakemont_step(), LOG_ERROR, LOG_USER, breakpoint::next, watchpoint::next, NULL, PMCR, reg_cache::reg_list, target::state, TARGET_HALTED, target_to_x86_32(), reg::value, and target::watchpoints.
Referenced by lakemont_reset_assert(), and quark_d20xx_reset_deassert().
|
static |
Definition at line 340 of file lakemont.c.
int lakemont_step | ( | struct target * | t, |
int | current, | ||
target_addr_t | address, | ||
int | handle_breakpoints | ||
) |
Definition at line 1032 of file lakemont.c.
References breakpoint_find(), buf_get_u32(), buf_set_u32(), x86_32_common::cache, check_not_halted(), DBG_REASON_SINGLESTEP, target::debug_reason, EFLAGS, EFLAGS_RF, EFLAGS_TF, EIP, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, exit_probemode(), get_tapstatus(), halt_prep(), LOG_DEBUG, LOG_ERROR, LOG_USER, NULL, PMCR, reg_cache::reg_list, restore_context(), save_context(), target::state, target_call_event_callbacks(), TARGET_DEBUG_RUNNING, TARGET_EVENT_HALTED, TARGET_EVENT_RESUMED, TARGET_HALTED, TARGET_RUNNING, target_to_x86_32(), TS_EN_PM_BIT, TS_PM_BIT, TS_PMCR_BIT, TS_PRDY_BIT, reg::value, x86_32_common_add_breakpoint(), and x86_32_common_remove_breakpoint().
Referenced by lakemont_resume().
int lakemont_update_after_probemode_entry | ( | struct target * | t | ) |
Definition at line 569 of file lakemont.c.
References ERROR_FAIL, ERROR_OK, halt_prep(), save_context(), target::state, target_call_event_callbacks(), TARGET_EVENT_HALTED, and TARGET_HALTED.
Referenced by do_halt(), lakemont_reset_deassert(), and quark_d20xx_reset_deassert().
|
static |
Definition at line 596 of file lakemont.c.
References x86_32_common::cache, ERROR_OK, LOG_DEBUG, LOG_ERROR, reg::name, NOT_AVAIL_REG, reg_cache::num_regs, pm_idx, read_hw_reg(), reg_cache::reg_list, regs, and target_to_x86_32().
Referenced by save_context().
|
static |
Definition at line 636 of file lakemont.c.
References reg::arch_info, buf_get_u32(), buf_set_u32(), x86_32_common::cache, DELAY_SUBMITPIR, reg::dirty, drscan(), ERROR_FAIL, ERROR_OK, x86_32_common::flush, irscan(), jtag_add_sleep(), LMT_IRLEN, LOG_DEBUG, reg::name, NULL, lakemont_core_reg::op, scan_blk::out, PDR_SIZE, RDWRPDR, reg_cache::reg_list, scan, SRAM2PDR, SRAMACCESS, submit_instruction_pir(), submit_reg_pir(), target_to_x86_32(), reg::valid, and reg::value.
Referenced by lakemont_init_arch_info(), and read_all_core_hw_regs().
|
static |
Definition at line 300 of file lakemont.c.
References x86_32_common::cache, reg::dirty, ERROR_OK, LOG_ERROR, reg_cache::num_regs, reg_cache::reg_list, target_to_x86_32(), reg::valid, and write_all_core_hw_regs().
Referenced by do_resume(), and lakemont_step().
|
static |
Definition at line 288 of file lakemont.c.
References ERROR_OK, LOG_ERROR, and read_all_core_hw_regs().
Referenced by lakemont_poll(), lakemont_step(), and lakemont_update_after_probemode_entry().
|
static |
Definition at line 767 of file lakemont.c.
References ERROR_OK, LOG_ERROR, and submit_instruction_pir().
Referenced by lakemont_init_arch_info().
|
static |
Definition at line 788 of file lakemont.c.
References ERROR_OK, instructions, LOG_DEBUG, LOG_ERROR, name, op, and submit_pir().
Referenced by read_hw_reg(), submit_instruction(), and write_hw_reg().
|
static |
Definition at line 804 of file lakemont.c.
References buf_set_u64(), DELAY_SUBMITPIR, drscan(), ERROR_FAIL, ERROR_OK, x86_32_common::flush, irscan(), jtag_add_sleep(), LMT_IRLEN, NULL, op, scan_blk::out, PIR_SIZE, scan, SUBMITPIR, target_to_x86_32(), and WRPIR.
Referenced by submit_instruction_pir(), and submit_reg_pir().
|
static |
Definition at line 777 of file lakemont.c.
References ERROR_OK, LOG_DEBUG, LOG_ERROR, name, op, regs, and submit_pir().
Referenced by halt_prep(), read_hw_reg(), and write_hw_reg().
|
static |
Definition at line 746 of file lakemont.c.
References get_tapstatus(), and TS_SBP_BIT.
Referenced by lakemont_init_arch_info().
|
static |
Definition at line 755 of file lakemont.c.
References ERROR_FAIL, ERROR_OK, get_tapstatus(), LOG_ERROR, TS_EN_PM_BIT, and TS_PRDY_BIT.
Referenced by lakemont_init_arch_info().
|
static |
Definition at line 616 of file lakemont.c.
References x86_32_common::cache, ERROR_OK, LOG_DEBUG, LOG_ERROR, reg::name, NOT_AVAIL_REG, reg_cache::num_regs, pm_idx, reg_cache::reg_list, regs, target_to_x86_32(), and write_hw_reg().
Referenced by restore_context().
|
static |
Definition at line 670 of file lakemont.c.
References reg::arch_info, buf_get_u32(), buf_set_u32(), x86_32_common::cache, reg::dirty, drscan(), ERROR_FAIL, ERROR_OK, x86_32_common::flush, irscan(), LMT_IRLEN, LOG_DEBUG, reg::name, NULL, lakemont_core_reg::op, scan_blk::out, PDR2SRAM, PDR_SIZE, RDWRPDR, reg_cache::reg_list, scan, SRAMACCESS, submit_instruction_pir(), submit_reg_pir(), target_to_x86_32(), reg::valid, and reg::value.
Referenced by halt_prep(), lakemont_init_arch_info(), and write_all_core_hw_regs().
unsigned bits |
Definition at line 70 of file lakemont.c.
const char* feature |
Definition at line 73 of file lakemont.c.
Referenced by lakemont_build_reg_cache().
const char* group |
Definition at line 72 of file lakemont.c.
uint8_t id |
Definition at line 66 of file lakemont.c.
const { ... } instructions[] |
Referenced by aice_backup_tmp_registers(), aice_execute(), aice_read_reg(), aice_restore_tmp_registers(), aice_usb_dcache_inval_all(), aice_usb_dcache_va_inval(), aice_usb_dcache_va_wb(), aice_usb_dcache_wb_all(), aice_usb_execute(), aice_usb_icache_inval_all(), aice_usb_icache_va_inval(), aice_usb_read_mem_b_dim(), aice_usb_read_mem_h_dim(), aice_usb_read_mem_w_dim(), aice_usb_read_tlb(), aice_usb_run(), aice_usb_set_address_dim(), aice_usb_write_mem_b_dim(), aice_usb_write_mem_h_dim(), aice_usb_write_mem_w_dim(), aice_write_reg(), and submit_instruction_pir().
|
static |
Definition at line 340 of file lakemont.c.
Referenced by lakemont_build_reg_cache().
const char* name |
Definition at line 67 of file lakemont.c.
Referenced by halt_prep(), submit_instruction_pir(), and submit_reg_pir().
uint64_t op |
Definition at line 68 of file lakemont.c.
Referenced by add_dbus_scan(), dbus_scan(), dmi_scan(), evaluate_data_proc(), evaluate_data_proc_thumb(), evaluate_p_add_sub(), pic32mx_nvm_exec(), submit_instruction_pir(), submit_pir(), and submit_reg_pir().
uint8_t pm_idx |
Definition at line 69 of file lakemont.c.
Referenced by read_all_core_hw_regs(), and write_all_core_hw_regs().
const { ... } regs[] |
Referenced by arm7_9_restore_context(), arm920t_read_cp15_interpreted(), arm920t_write_cp15_interpreted(), avr32_jtag_read_regs(), avr32_jtag_write_regs(), COMMAND_HANDLER(), dsp563xx_once_read_register(), halt_prep(), lakemont_build_reg_cache(), mem_ap_get_gdb_reg_list(), mips32_pracc_read_regs(), mips32_pracc_write_regs(), mips64_pracc_read_regs(), mips64_pracc_write_regs(), or1k_jtag_read_regs(), or1k_jtag_write_regs(), read_all_core_hw_regs(), stm8_read_regs(), stm8_write_regs(), submit_reg_pir(), and write_all_core_hw_regs().
|
static |
Definition at line 58 of file lakemont.c.
Referenced by cmsis_dap_add_jtag_sequence(), cmsis_dap_flush(), drscan(), enter_probemode(), exit_probemode(), fpga_configure(), get_tapstatus(), interface_jtag_add_dr_scan(), interface_jtag_add_ir_scan(), irscan(), isc_data_read_out(), isc_enter(), isc_leave(), isc_program_register(), isc_read_register(), isc_set_register(), jtag_add_plain_scan(), lakemont_reset_break(), read_hw_reg(), submit_pir(), ublast_queue_tdi(), write_hw_reg(), and xcf_erase_check().
enum reg_type type |
Definition at line 70 of file lakemont.c.
Referenced by lakemont_poll().