OpenOCD
|
Go to the source code of this file.
Functions | |
static int | calcaddr_physfromlin (struct target *t, target_addr_t addr, target_addr_t *physaddr) |
COMMAND_HANDLER (handle_iod_command) | |
COMMAND_HANDLER (handle_iow_command) | |
static void | handle_iod_output (struct command_invocation *cmd, struct target *target, uint32_t address, unsigned size, unsigned count, const uint8_t *buffer) |
static int | read_hw_reg_to_cache (struct target *t, int num) |
static int | read_mem (struct target *t, uint32_t size, uint32_t addr, uint8_t *buf) |
static int | read_phys_mem (struct target *t, uint32_t phys_address, uint32_t size, uint32_t count, uint8_t *buffer) |
static int | set_breakpoint (struct target *target, struct breakpoint *breakpoint) |
static int | set_debug_regs (struct target *t, uint32_t address, uint8_t bp_num, uint8_t bp_type, uint8_t bp_length) |
static int | set_hwbp (struct target *t, struct breakpoint *bp) |
static int | set_swbp (struct target *t, struct breakpoint *bp) |
static int | set_watchpoint (struct target *target, struct watchpoint *watchpoint) |
static int | target_fill_io (struct target *target, uint32_t address, unsigned data_size, uint32_t b) |
static int | unset_breakpoint (struct target *target, struct breakpoint *breakpoint) |
static int | unset_debug_regs (struct target *t, uint8_t bp_num) |
static int | unset_hwbp (struct target *t, struct breakpoint *bp) |
static int | unset_swbp (struct target *t, struct breakpoint *bp) |
static int | unset_watchpoint (struct target *target, struct watchpoint *watchpoint) |
static int | write_hw_reg_from_cache (struct target *t, int num) |
static int | write_mem (struct target *t, uint32_t size, uint32_t addr, const uint8_t *buf) |
static int | write_phys_mem (struct target *t, uint32_t phys_address, uint32_t size, uint32_t count, const uint8_t *buffer) |
int | x86_32_common_add_breakpoint (struct target *t, struct breakpoint *bp) |
int | x86_32_common_add_watchpoint (struct target *t, struct watchpoint *wp) |
int | x86_32_common_init_arch_info (struct target *t, struct x86_32_common *x86_32) |
int | x86_32_common_mmu (struct target *t, int *enabled) |
int | x86_32_common_read_io (struct target *t, uint32_t addr, uint32_t size, uint8_t *buf) |
int | x86_32_common_read_memory (struct target *t, target_addr_t addr, uint32_t size, uint32_t count, uint8_t *buf) |
int | x86_32_common_read_phys_mem (struct target *t, target_addr_t phys_address, uint32_t size, uint32_t count, uint8_t *buffer) |
int | x86_32_common_remove_breakpoint (struct target *t, struct breakpoint *bp) |
int | x86_32_common_remove_watchpoint (struct target *t, struct watchpoint *wp) |
void | x86_32_common_reset_breakpoints_watchpoints (struct target *t) |
int | x86_32_common_virt2phys (struct target *t, target_addr_t address, target_addr_t *physical) |
int | x86_32_common_write_io (struct target *t, uint32_t addr, uint32_t size, const uint8_t *buf) |
int | x86_32_common_write_memory (struct target *t, target_addr_t addr, uint32_t size, uint32_t count, const uint8_t *buf) |
int | x86_32_common_write_phys_mem (struct target *t, target_addr_t phys_address, uint32_t size, uint32_t count, const uint8_t *buffer) |
int | x86_32_get_gdb_reg_list (struct target *t, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class) |
Variables | |
const struct command_registration | x86_32_command_handlers [] |
static const struct command_registration | x86_32_exec_command_handlers [] |
|
static |
Definition at line 444 of file x86_32_common.c.
References addr, buf_get_u32(), x86_32_common::cache, CR0, CR0_PG, CR3, CR4, ERROR_FAIL, ERROR_OK, LOG_ERROR, offset, reg_cache::reg_list, target_buffer_get_u32(), target_buffer_get_u64(), target_to_x86_32(), reg::value, and x86_32_common_read_phys_mem().
Referenced by set_swbp(), unset_swbp(), x86_32_common_read_memory(), x86_32_common_virt2phys(), and x86_32_common_write_memory().
COMMAND_HANDLER | ( | handle_iod_command | ) |
Definition at line 1390 of file x86_32_common.c.
References buffer, CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, CMD_NAME, COMMAND_PARSE_NUMBER, count, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, get_current_target(), handle_iod_output(), LOG_ERROR, size, and x86_32_common_read_io().
COMMAND_HANDLER | ( | handle_iow_command | ) |
Definition at line 1451 of file x86_32_common.c.
References CMD_ARGC, CMD_ARGV, CMD_CTX, CMD_NAME, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, get_current_target(), and target_fill_io().
|
static |
Definition at line 1332 of file x86_32_common.c.
References buffer, cmd, command_print(), count, LOG_ERROR, output, size, target_buffer_get_u16(), and target_buffer_get_u32().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 1297 of file x86_32_common.c.
References x86_32_common::cache, check_not_halted(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, x86_32_common::get_num_user_regs, LOG_DEBUG, LOG_ERROR, reg::name, x86_32_common::read_hw_reg, reg_cache::reg_list, and target_to_x86_32().
Referenced by x86_32_common_init_arch_info().
|
static |
Definition at line 320 of file x86_32_common.c.
References addr, buf_get_u32(), BYTE, x86_32_common::cache, CSAR, CSAR_D, DWORD, EAX, EDX, ERROR_OK, LOG_ERROR, MEMRDB16, MEMRDB32, MEMRDH16, MEMRDH32, MEMRDW16, MEMRDW32, x86_32_common::read_hw_reg, reg_cache::reg_list, size, x86_32_common::submit_instruction, target_to_x86_32(), x86_32_common::transaction_status, reg::value, WORD, and x86_32_common::write_hw_reg.
Referenced by COMMAND_HANDLER(), and read_phys_mem().
|
static |
Definition at line 159 of file x86_32_common.c.
References buffer, BYTE, check_not_halted(), count, x86_32_common::disable_paging, DWORD, x86_32_common::enable_paging, ERROR_COMMAND_ARGUMENT_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, x86_32_common::is_paging_enabled, LOG_DEBUG, LOG_ERROR, read_mem(), size, target_to_x86_32(), and WORD.
Referenced by set_swbp(), unset_swbp(), and x86_32_common_read_phys_mem().
|
static |
Definition at line 1121 of file x86_32_common.c.
References breakpoint::address, BKPT_HARD, ERROR_FAIL, ERROR_OK, breakpoint::is_set, LOG_DEBUG, LOG_ERROR, set_hwbp(), set_swbp(), x86_32_common::sw_bpts_supported, TARGET_ADDR_FMT, target_to_x86_32(), and breakpoint::type.
Referenced by x86_32_common_add_breakpoint().
|
static |
Definition at line 881 of file x86_32_common.c.
References buf_get_u32(), buf_set_u32(), x86_32_common::cache, reg::dirty, DR0, DR6, DR7, DR7_BP_FREE, DR7_GLOBAL_ENABLE, DR7_SET_ACCESS, DR7_SET_EXE, DR7_SET_LENGTH, DR7_SET_WRITE, ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_DEBUG, LOG_ERROR, PM_DR6, reg_cache::reg_list, target_to_x86_32(), reg::valid, and reg::value.
Referenced by set_hwbp(), and set_watchpoint().
|
static |
Definition at line 973 of file x86_32_common.c.
References breakpoint::address, x86_32_dbg_reg::bp_value, breakpoint_hw_set(), DR7_BP_EXECUTE, ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, x86_32_common::hw_break_list, LOG_ERROR, LOG_USER, x86_32_common::num_hw_bpoints, set_debug_regs(), target_to_x86_32(), breakpoint::unique_id, and x86_32_dbg_reg::used.
Referenced by set_breakpoint().
|
static |
Definition at line 1017 of file x86_32_common.c.
References breakpoint::address, calcaddr_physfromlin(), ERROR_FAIL, ERROR_OK, breakpoint::is_set, LOG_DEBUG, LOG_ERROR, LOG_USER, swbp_mem_patch::next, NULL, swbp_mem_patch::orig_byte, breakpoint::orig_instr, swbp_mem_patch::physaddr, read_phys_mem(), SW_BP_OPCODE, x86_32_common::swbbp_mem_patch_list, swbp_mem_patch::swbp_unique_id, TARGET_ADDR_FMT, target_to_x86_32(), breakpoint::unique_id, and write_phys_mem().
Referenced by set_breakpoint().
|
static |
Definition at line 1178 of file x86_32_common.c.
References watchpoint::address, x86_32_dbg_reg::bp_value, DR7_BP_READWRITE, DR7_BP_WRITE, ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, x86_32_common::hw_break_list, watchpoint::is_set, watchpoint::length, LOG_DEBUG, LOG_ERROR, LOG_USER, x86_32_common::num_hw_bpoints, watchpoint::rw, set_debug_regs(), TARGET_ADDR_FMT, target_to_x86_32(), watchpoint::unique_id, x86_32_dbg_reg::used, watchpoint_set(), WPT_ACCESS, WPT_READ, and WPT_WRITE.
Referenced by x86_32_common_add_watchpoint().
|
static |
Definition at line 1426 of file x86_32_common.c.
References LOG_DEBUG, target_buffer_set_u16(), target_buffer_set_u32(), and x86_32_common_write_io().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 1153 of file x86_32_common.c.
References breakpoint::address, BKPT_HARD, ERROR_FAIL, ERROR_OK, breakpoint::is_set, LOG_DEBUG, LOG_ERROR, LOG_WARNING, TARGET_ADDR_FMT, breakpoint::type, unset_hwbp(), and unset_swbp().
Referenced by x86_32_common_remove_breakpoint().
|
static |
Definition at line 942 of file x86_32_common.c.
References buf_get_u32(), buf_set_u32(), x86_32_common::cache, reg::dirty, DR0, DR6, DR7, DR7_BP_FREE, DR7_GLOBAL_DISABLE, DR7_RESET_RWLEN_BITS, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_DEBUG, LOG_ERROR, PM_DR6, reg_cache::reg_list, target_to_x86_32(), reg::valid, and reg::value.
Referenced by unset_hwbp(), and unset_watchpoint().
|
static |
Definition at line 995 of file x86_32_common.c.
References breakpoint::address, x86_32_dbg_reg::bp_value, ERROR_FAIL, ERROR_OK, x86_32_common::hw_break_list, LOG_ERROR, LOG_USER, x86_32_common::num_hw_bpoints, breakpoint::number, TARGET_ADDR_FMT, target_to_x86_32(), breakpoint::unique_id, unset_debug_regs(), and x86_32_dbg_reg::used.
Referenced by unset_breakpoint().
|
static |
Definition at line 1073 of file x86_32_common.c.
References breakpoint::address, calcaddr_physfromlin(), ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, LOG_USER, swbp_mem_patch::next, breakpoint::orig_instr, read_phys_mem(), SW_BP_OPCODE, x86_32_common::swbbp_mem_patch_list, swbp_mem_patch::swbp_unique_id, TARGET_ADDR_FMT, target_to_x86_32(), breakpoint::unique_id, and write_phys_mem().
Referenced by unset_breakpoint().
|
static |
Definition at line 1235 of file x86_32_common.c.
References watchpoint::address, x86_32_dbg_reg::bp_value, ERROR_FAIL, ERROR_OK, x86_32_common::hw_break_list, watchpoint::is_set, watchpoint::length, LOG_DEBUG, LOG_USER, LOG_WARNING, x86_32_common::num_hw_bpoints, watchpoint::number, watchpoint::rw, TARGET_ADDR_FMT, target_to_x86_32(), watchpoint::unique_id, unset_debug_regs(), x86_32_dbg_reg::used, WPT_ACCESS, WPT_READ, and WPT_WRITE.
Referenced by x86_32_common_remove_watchpoint().
|
static |
Definition at line 1315 of file x86_32_common.c.
References buf_get_u32(), x86_32_common::cache, check_not_halted(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, x86_32_common::get_num_user_regs, LOG_DEBUG, LOG_ERROR, reg::name, reg_cache::reg_list, target_to_x86_32(), reg::value, and x86_32_common::write_hw_reg.
Referenced by x86_32_common_init_arch_info().
|
static |
Definition at line 381 of file x86_32_common.c.
References addr, buf_get_u32(), BYTE, x86_32_common::cache, CSAR, CSAR_D, DWORD, EAX, EDX, ERROR_FAIL, ERROR_OK, LOG_ERROR, MEMWRB16, MEMWRB32, MEMWRH16, MEMWRH32, MEMWRW16, MEMWRW32, reg_cache::reg_list, size, x86_32_common::submit_instruction, target_to_x86_32(), x86_32_common::transaction_status, reg::value, WORD, and x86_32_common::write_hw_reg.
Referenced by write_phys_mem().
|
static |
Definition at line 263 of file x86_32_common.c.
References buffer, BYTE, check_not_halted(), count, x86_32_common::disable_paging, DWORD, x86_32_common::enable_paging, ERROR_COMMAND_ARGUMENT_INVALID, ERROR_OK, x86_32_common::is_paging_enabled, LOG_DEBUG, LOG_ERROR, size, target_to_x86_32(), WORD, and write_mem().
Referenced by set_swbp(), unset_swbp(), and x86_32_common_write_phys_mem().
int x86_32_common_add_breakpoint | ( | struct target * | t, |
struct breakpoint * | bp | ||
) |
Definition at line 859 of file x86_32_common.c.
References breakpoint::address, check_not_halted(), ERROR_TARGET_NOT_HALTED, LOG_DEBUG, set_breakpoint(), TARGET_ADDR_FMT, and breakpoint::type.
Referenced by lakemont_step().
int x86_32_common_add_watchpoint | ( | struct target * | t, |
struct watchpoint * | wp | ||
) |
Definition at line 841 of file x86_32_common.c.
References check_not_halted(), and set_watchpoint().
int x86_32_common_init_arch_info | ( | struct target * | t, |
struct x86_32_common * | x86_32 | ||
) |
Definition at line 80 of file x86_32_common.c.
References target::arch_info, x86_32_common::common_magic, x86_32_common::curr_tap, ERROR_FAIL, ERROR_OK, x86_32_common::fast_data_area, x86_32_common::flush, x86_32_common::hw_break_list, LOG_ERROR, MAX_DEBUG_REGS, NULL, x86_32_common::num_hw_bpoints, read_hw_reg_to_cache(), x86_32_common::read_hw_reg_to_cache, target::tap, write_hw_reg_from_cache(), x86_32_common::write_hw_reg_from_cache, and X86_32_COMMON_MAGIC.
Referenced by quark_d20xx_target_create().
int x86_32_common_mmu | ( | struct target * | t, |
int * | enabled | ||
) |
Definition at line 99 of file x86_32_common.c.
References ERROR_OK.
int x86_32_common_read_io | ( | struct target * | t, |
uint32_t | addr, | ||
uint32_t | size, | ||
uint8_t * | buf | ||
) |
Definition at line 680 of file x86_32_common.c.
References addr, buf_get_u32(), BYTE, x86_32_common::cache, check_not_halted(), CSAR, CSAR_D, x86_32_common::disable_paging, DWORD, EAX, EDX, x86_32_common::enable_paging, ERROR_FAIL, ERROR_OK, IORDB16, IORDB32, IORDH16, IORDH32, IORDW16, IORDW32, x86_32_common::is_paging_enabled, LOG_DEBUG, LOG_ERROR, x86_32_common::read_hw_reg, reg_cache::reg_list, size, x86_32_common::submit_instruction, target_to_x86_32(), x86_32_common::transaction_status, reg::value, WORD, and x86_32_common::write_hw_reg.
Referenced by COMMAND_HANDLER().
int x86_32_common_read_memory | ( | struct target * | t, |
target_addr_t | addr, | ||
uint32_t | size, | ||
uint32_t | count, | ||
uint8_t * | buf | ||
) |
Definition at line 568 of file x86_32_common.c.
References addr, calcaddr_physfromlin(), check_not_halted(), count, x86_32_common::disable_paging, x86_32_common::enable_paging, ERROR_COMMAND_ARGUMENT_INVALID, ERROR_FAIL, ERROR_OK, x86_32_common::is_paging_enabled, LOG_DEBUG, LOG_ERROR, size, TARGET_ADDR_FMT, target_to_x86_32(), and x86_32_common_read_phys_mem().
int x86_32_common_read_phys_mem | ( | struct target * | t, |
target_addr_t | phys_address, | ||
uint32_t | size, | ||
uint32_t | count, | ||
uint8_t * | buffer | ||
) |
Definition at line 135 of file x86_32_common.c.
References buffer, count, ERROR_OK, swbp_mem_patch::next, offset, swbp_mem_patch::orig_byte, swbp_mem_patch::physaddr, read_phys_mem(), size, x86_32_common::swbbp_mem_patch_list, and target_to_x86_32().
Referenced by calcaddr_physfromlin(), and x86_32_common_read_memory().
int x86_32_common_remove_breakpoint | ( | struct target * | t, |
struct breakpoint * | bp | ||
) |
Definition at line 870 of file x86_32_common.c.
References breakpoint::address, check_not_halted(), ERROR_OK, ERROR_TARGET_NOT_HALTED, breakpoint::is_set, LOG_DEBUG, TARGET_ADDR_FMT, breakpoint::type, and unset_breakpoint().
Referenced by lakemont_step().
int x86_32_common_remove_watchpoint | ( | struct target * | t, |
struct watchpoint * | wp | ||
) |
Definition at line 850 of file x86_32_common.c.
References check_not_halted(), ERROR_OK, ERROR_TARGET_NOT_HALTED, watchpoint::is_set, and unset_watchpoint().
void x86_32_common_reset_breakpoints_watchpoints | ( | struct target * | t | ) |
Definition at line 1271 of file x86_32_common.c.
References x86_32_dbg_reg::bp_value, target::breakpoints, x86_32_common::hw_break_list, breakpoint::next, watchpoint::next, x86_32_common::num_hw_bpoints, breakpoint::orig_instr, target_to_x86_32(), x86_32_dbg_reg::used, and target::watchpoints.
Referenced by lakemont_reset_assert().
int x86_32_common_virt2phys | ( | struct target * | t, |
target_addr_t | address, | ||
target_addr_t * | physical | ||
) |
Definition at line 105 of file x86_32_common.c.
References buf_get_u32(), x86_32_common::cache, calcaddr_physfromlin(), CR0, CR0_PG, DSB, ERROR_FAIL, ERROR_OK, LOG_ERROR, reg_cache::reg_list, TARGET_ADDR_FMT, target_to_x86_32(), and reg::value.
int x86_32_common_write_io | ( | struct target * | t, |
uint32_t | addr, | ||
uint32_t | size, | ||
const uint8_t * | buf | ||
) |
Definition at line 760 of file x86_32_common.c.
References addr, buf_get_u32(), BYTE, x86_32_common::cache, check_not_halted(), CSAR, CSAR_D, x86_32_common::disable_paging, DWORD, EAX, EDX, x86_32_common::enable_paging, ERROR_FAIL, ERROR_OK, IOWRB16, IOWRB32, IOWRH16, IOWRH32, IOWRW16, IOWRW32, x86_32_common::is_paging_enabled, LOG_DEBUG, LOG_ERROR, reg_cache::reg_list, size, x86_32_common::submit_instruction, target_to_x86_32(), x86_32_common::transaction_status, reg::value, WORD, and x86_32_common::write_hw_reg.
Referenced by lakemont_reset_assert(), and target_fill_io().
int x86_32_common_write_memory | ( | struct target * | t, |
target_addr_t | addr, | ||
uint32_t | size, | ||
uint32_t | count, | ||
const uint8_t * | buf | ||
) |
Definition at line 625 of file x86_32_common.c.
References addr, calcaddr_physfromlin(), check_not_halted(), count, x86_32_common::disable_paging, x86_32_common::enable_paging, ERROR_COMMAND_ARGUMENT_INVALID, ERROR_FAIL, ERROR_OK, x86_32_common::is_paging_enabled, LOG_DEBUG, LOG_ERROR, size, TARGET_ADDR_FMT, target_to_x86_32(), and x86_32_common_write_phys_mem().
int x86_32_common_write_phys_mem | ( | struct target * | t, |
target_addr_t | phys_address, | ||
uint32_t | size, | ||
uint32_t | count, | ||
const uint8_t * | buffer | ||
) |
Definition at line 219 of file x86_32_common.c.
References target::breakpoints, buffer, check_not_halted(), count, ERROR_COMMAND_ARGUMENT_INVALID, ERROR_FAIL, ERROR_OK, LOG_ERROR, breakpoint::next, swbp_mem_patch::next, NULL, offset, breakpoint::orig_instr, swbp_mem_patch::physaddr, size, SW_BP_OPCODE, x86_32_common::swbbp_mem_patch_list, swbp_mem_patch::swbp_unique_id, TARGET_ADDR_FMT, target_to_x86_32(), breakpoint::unique_id, and write_phys_mem().
Referenced by x86_32_common_write_memory().
int x86_32_get_gdb_reg_list | ( | struct target * | t, |
struct reg ** | reg_list[], | ||
int * | reg_list_size, | ||
enum target_register_class | reg_class | ||
) |
Definition at line 57 of file x86_32_common.c.
References buf_get_u32(), x86_32_common::cache, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, reg::name, reg_cache::num_regs, reg_cache::reg_list, target_to_x86_32(), and reg::value.
const struct command_registration x86_32_command_handlers[] |
Definition at line 1451 of file x86_32_common.c.
|
static |
Definition at line 1451 of file x86_32_common.c.