OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | backoff_timer |
struct | gdb_fileio_info |
struct | gdb_service |
struct | target |
struct | target_event_action |
struct | target_event_callback |
struct | target_list |
struct | target_memory_check_block |
struct | target_reset_callback |
struct | target_timer_callback |
struct | target_trace_callback |
struct | working_area |
Macros | |
#define | ERROR_TARGET_ALGO_EXIT (-313) |
#define | ERROR_TARGET_DATA_ABORT (-307) |
#define | ERROR_TARGET_DUPLICATE_BREAKPOINT (-312) |
#define | ERROR_TARGET_FAILURE (-305) |
#define | ERROR_TARGET_HALTED_DO_RESUME (-316) /* used to workaround incorrect debug halt */ |
#define | ERROR_TARGET_INIT_FAILED (-301) |
#define | ERROR_TARGET_INVALID (-300) |
#define | ERROR_TARGET_NOT_EXAMINED (-311) |
#define | ERROR_TARGET_NOT_HALTED (-304) |
#define | ERROR_TARGET_NOT_RUNNING (-310) |
#define | ERROR_TARGET_PACKING_NOT_SUPPORTED (-315) |
#define | ERROR_TARGET_RESOURCE_NOT_AVAILABLE (-308) |
#define | ERROR_TARGET_SIZE_NOT_SUPPORTED (-314) |
#define | ERROR_TARGET_TIMEOUT (-302) |
#define | ERROR_TARGET_TRANSLATION_FAULT (-309) |
#define | ERROR_TARGET_UNALIGNED_ACCESS (-306) |
#define | TARGET_DEFAULT_POLLING_INTERVAL 100 |
Functions | |
const char * | debug_reason_name (const struct target *t) |
struct target * | get_current_target (struct command_context *cmd_ctx) |
struct target * | get_current_target_or_null (struct command_context *cmd_ctx) |
struct target * | get_target (const char *id) |
bool | get_target_reset_nag (void) |
int | target_add_breakpoint (struct target *target, struct breakpoint *breakpoint) |
Add the breakpoint for target. More... | |
int | target_add_context_breakpoint (struct target *target, struct breakpoint *breakpoint) |
Add the ContextID breakpoint for target. More... | |
int | target_add_hybrid_breakpoint (struct target *target, struct breakpoint *breakpoint) |
Add the ContextID & IVA breakpoint for target. More... | |
int | target_add_watchpoint (struct target *target, struct watchpoint *watchpoint) |
Add the watchpoint for target. More... | |
unsigned int | target_address_bits (struct target *target) |
Return the number of address bits this target supports. More... | |
target_addr_t | target_address_max (struct target *target) |
Return the highest accessible address for this target. More... | |
int | target_alloc_working_area (struct target *target, uint32_t size, struct working_area **area) |
int | target_alloc_working_area_try (struct target *target, uint32_t size, struct working_area **area) |
int | target_arch_state (struct target *target) |
int | target_blank_check_memory (struct target *target, struct target_memory_check_block *blocks, int num_blocks, uint8_t erased_value) |
uint16_t | target_buffer_get_u16 (struct target *target, const uint8_t *buffer) |
void | target_buffer_get_u16_array (struct target *target, const uint8_t *buffer, uint32_t count, uint16_t *dstbuf) |
uint32_t | target_buffer_get_u24 (struct target *target, const uint8_t *buffer) |
uint32_t | target_buffer_get_u32 (struct target *target, const uint8_t *buffer) |
void | target_buffer_get_u32_array (struct target *target, const uint8_t *buffer, uint32_t count, uint32_t *dstbuf) |
uint64_t | target_buffer_get_u64 (struct target *target, const uint8_t *buffer) |
void | target_buffer_get_u64_array (struct target *target, const uint8_t *buffer, uint32_t count, uint64_t *dstbuf) |
void | target_buffer_set_u16 (struct target *target, uint8_t *buffer, uint16_t value) |
void | target_buffer_set_u16_array (struct target *target, uint8_t *buffer, uint32_t count, const uint16_t *srcbuf) |
void | target_buffer_set_u24 (struct target *target, uint8_t *buffer, uint32_t value) |
void | target_buffer_set_u32 (struct target *target, uint8_t *buffer, uint32_t value) |
void | target_buffer_set_u32_array (struct target *target, uint8_t *buffer, uint32_t count, const uint32_t *srcbuf) |
void | target_buffer_set_u64 (struct target *target, uint8_t *buffer, uint64_t value) |
void | target_buffer_set_u64_array (struct target *target, uint8_t *buffer, uint32_t count, const uint64_t *srcbuf) |
int | target_call_event_callbacks (struct target *target, enum target_event event) |
int | target_call_reset_callbacks (struct target *target, enum target_reset_mode reset_mode) |
int | target_call_timer_callbacks (void) |
int | target_call_timer_callbacks_now (void) |
Invoke this to ensure that e.g. More... | |
int | target_call_trace_callbacks (struct target *target, size_t len, uint8_t *data) |
int | target_checksum_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t *crc) |
unsigned int | target_data_bits (struct target *target) |
Return the number of data bits this target supports. More... | |
const char * | target_debug_reason_str (enum target_debug_reason reason) |
static const char * | target_endianness (const struct target *target) |
Returns a description of the endianness for the specified target. More... | |
const char * | target_event_name (enum target_event event) |
Return the name of a target event enumeration value. More... | |
int | target_examine (void) |
int | target_examine_one (struct target *target) |
Examine the specified target, letting it perform any Initialisation that requires JTAG access. More... | |
void | target_free_all_working_areas (struct target *target) |
int | target_free_working_area (struct target *target, struct working_area *area) |
Free a working area. More... | |
int | target_gdb_fileio_end (struct target *target, int retcode, int fileio_errno, bool ctrl_c) |
Pass GDB file-I/O response to target after finishing host syscall. More... | |
const char * | target_get_gdb_arch (const struct target *target) |
Obtain the architecture for GDB. More... | |
int | target_get_gdb_fileio_info (struct target *target, struct gdb_fileio_info *fileio_info) |
Obtain file-I/O information from target for GDB to do syscall. More... | |
int | target_get_gdb_reg_list (struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class) |
Obtain the registers for GDB. More... | |
int | target_get_gdb_reg_list_noread (struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class) |
Obtain the registers for GDB, but don't read register values from the target. More... | |
uint32_t | target_get_working_area_avail (struct target *target) |
int | target_halt (struct target *target) |
void | target_handle_event (struct target *t, enum target_event e) |
void | target_handle_md_output (struct command_invocation *cmd, struct target *target, target_addr_t address, unsigned int size, unsigned int count, const uint8_t *buffer) |
bool | target_has_event_action (const struct target *target, enum target_event event) |
Returns true only if the target has a handler for the specified event. More... | |
int | target_hit_watchpoint (struct target *target, struct watchpoint **watchpoint) |
Find out the just hit watchpoint for target. More... | |
static const char * | target_name (const struct target *target) |
Returns the instance-specific name of the specified target. More... | |
int | target_poll (struct target *target) |
int | target_profiling_default (struct target *target, uint32_t *samples, uint32_t max_num_samples, uint32_t *num_samples, uint32_t seconds) |
void | target_quit (void) |
Free all the resources allocated by targets and the target layer. More... | |
int | target_read_buffer (struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer) |
int | target_read_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer) |
Read count items of size bytes from the memory of target at the address given. More... | |
int | target_read_phys_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer) |
int | target_read_u16 (struct target *target, target_addr_t address, uint16_t *value) |
int | target_read_u32 (struct target *target, target_addr_t address, uint32_t *value) |
int | target_read_u64 (struct target *target, target_addr_t address, uint64_t *value) |
int | target_read_u8 (struct target *target, target_addr_t address, uint8_t *value) |
int | target_register_commands (struct command_context *cmd_ctx) |
int | target_register_event_callback (int(*callback)(struct target *target, enum target_event event, void *priv), void *priv) |
int | target_register_reset_callback (int(*callback)(struct target *target, enum target_reset_mode reset_mode, void *priv), void *priv) |
int | target_register_timer_callback (int(*callback)(void *priv), unsigned int time_ms, enum target_timer_type type, void *priv) |
The period is very approximate, the callback can happen much more often or much more rarely than specified. More... | |
int | target_register_trace_callback (int(*callback)(struct target *target, size_t len, uint8_t *data, void *priv), void *priv) |
int | target_remove_breakpoint (struct target *target, struct breakpoint *breakpoint) |
Remove the breakpoint for target. More... | |
int | target_remove_watchpoint (struct target *target, struct watchpoint *watchpoint) |
Remove the watchpoint for target. More... | |
const char * | target_reset_mode_name (enum target_reset_mode reset_mode) |
Return the name of a target reset reason enumeration value. More... | |
int | target_resume (struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution) |
Make the target (re)start executing using its saved execution context (possibly with some modifications). More... | |
int | target_run_algorithm (struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_param, target_addr_t entry_point, target_addr_t exit_point, unsigned int timeout_ms, void *arch_info) |
Run an algorithm on the target given. More... | |
int | target_run_flash_async_algorithm (struct target *target, const uint8_t *buffer, uint32_t count, int block_size, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, uint32_t buffer_start, uint32_t buffer_size, uint32_t entry_point, uint32_t exit_point, void *arch_info) |
This routine is a wrapper for asynchronous algorithms. More... | |
int | target_run_read_async_algorithm (struct target *target, uint8_t *buffer, uint32_t count, int block_size, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, uint32_t buffer_start, uint32_t buffer_size, uint32_t entry_point, uint32_t exit_point, void *arch_info) |
This routine is a wrapper for asynchronous algorithms. More... | |
static void | target_set_examined (struct target *target) |
Sets the examined flag for the given target. More... | |
int | target_start_algorithm (struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t entry_point, target_addr_t exit_point, void *arch_info) |
Starts an algorithm in the background on the target given. More... | |
const char * | target_state_name (const struct target *target) |
Return the name of this targets current state. More... | |
int | target_step (struct target *target, int current, target_addr_t address, int handle_breakpoints) |
Step the target. More... | |
bool | target_supports_gdb_connection (const struct target *target) |
Check if target allows GDB connections. More... | |
int64_t | target_timer_next_event (void) |
Returns when the next registered event will take place. More... | |
const char * | target_type_name (const struct target *target) |
Get the target type name. More... | |
int | target_unregister_event_callback (int(*callback)(struct target *target, enum target_event event, void *priv), void *priv) |
int | target_unregister_reset_callback (int(*callback)(struct target *target, enum target_reset_mode reset_mode, void *priv), void *priv) |
int | target_unregister_timer_callback (int(*callback)(void *priv), void *priv) |
int | target_unregister_trace_callback (int(*callback)(struct target *target, size_t len, uint8_t *data, void *priv), void *priv) |
int | target_wait_algorithm (struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t exit_point, unsigned int timeout_ms, void *arch_info) |
Wait for an algorithm on the target given. More... | |
int | target_wait_state (struct target *target, enum target_state state, unsigned int ms) |
static bool | target_was_examined (const struct target *target) |
int | target_write_buffer (struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer) |
int | target_write_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer) |
Write count items of size bytes to the memory of target at the address given. More... | |
int | target_write_phys_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer) |
int | target_write_phys_u16 (struct target *target, target_addr_t address, uint16_t value) |
int | target_write_phys_u32 (struct target *target, target_addr_t address, uint32_t value) |
int | target_write_phys_u64 (struct target *target, target_addr_t address, uint64_t value) |
int | target_write_phys_u8 (struct target *target, target_addr_t address, uint8_t value) |
int | target_write_u16 (struct target *target, target_addr_t address, uint16_t value) |
int | target_write_u32 (struct target *target, target_addr_t address, uint32_t value) |
int | target_write_u64 (struct target *target, target_addr_t address, uint64_t value) |
int | target_write_u8 (struct target *target, target_addr_t address, uint8_t value) |
Variables | |
struct target * | all_targets |
#define ERROR_TARGET_HALTED_DO_RESUME (-316) /* used to workaround incorrect debug halt */ |
enum target_debug_reason |
enum target_endianness |
enum target_event |
enum target_reset_mode |
enum target_state |
enum target_timer_type |
const char* debug_reason_name | ( | const struct target * | t | ) |
Definition at line 247 of file target.c.
References target::debug_reason, LOG_ERROR, nvp::name, nvp_target_debug_reason, and nvp_value2name().
Referenced by arm_arch_state(), armv7m_arch_state(), armv8_aarch64_state(), avr32_ap7k_arch_state(), esirisc_arch_state(), hwthread_fill_thread(), lakemont_arch_state(), mips32_arch_state(), mips64_arch_state(), and stm8_arch_state().
struct target* get_current_target | ( | struct command_context * | cmd_ctx | ) |
Definition at line 458 of file target.c.
References get_current_target_or_null(), LOG_ERROR, and target.
Referenced by COMMAND_HANDLER(), COMMAND_HELPER(), esirisc_trace_analyze(), esirisc_trace_analyze_buffer(), esirisc_trace_analyze_full(), esirisc_trace_analyze_memory(), esirisc_trace_analyze_simple(), esirisc_trace_dump_buffer(), esirisc_trace_dump_memory(), esp32_apptrace_cmd_ctx_init(), esp32_cmd_apptrace_generic(), esp_semihosting_basedir_command(), handle_bp_command_list(), handle_bp_command_set(), hl_transport_init(), jim_target_configure(), jim_target_invoke_event(), target_jim_get_reg(), and target_jim_write_memory().
struct target* get_current_target_or_null | ( | struct command_context * | cmd_ctx | ) |
Definition at line 470 of file target.c.
References command_context::current_target, and command_context::current_target_override.
Referenced by COMMAND_HANDLER(), get_current_target(), and tcl_new_connection().
struct target* get_target | ( | const char * | id | ) |
Definition at line 433 of file target.c.
References all_targets, ERROR_OK, target::next, NULL, target, and target_name().
Referenced by __attribute__(), COMMAND_HANDLER(), COMMAND_HELPER(), find_target(), FLASH_BANK_COMMAND_HANDLER(), and image_open().
bool get_target_reset_nag | ( | void | ) |
Definition at line 6288 of file target.c.
References target_reset_nag.
Referenced by arm7_9_check_reset().
int target_add_breakpoint | ( | struct target * | target, |
struct breakpoint * | breakpoint | ||
) |
Add the breakpoint for target.
This routine is a wrapper for target->type->add_breakpoint.
Definition at line 1293 of file target.c.
References target_type::add_breakpoint, BKPT_HARD, ERROR_TARGET_NOT_HALTED, LOG_TARGET_ERROR, target::state, TARGET_HALTED, breakpoint::type, and target::type.
Referenced by breakpoint_add_internal().
int target_add_context_breakpoint | ( | struct target * | target, |
struct breakpoint * | breakpoint | ||
) |
Add the ContextID breakpoint for target.
This routine is a wrapper for target->type->add_context_breakpoint.
Definition at line 1303 of file target.c.
References target_type::add_context_breakpoint, ERROR_TARGET_NOT_HALTED, LOG_TARGET_ERROR, target::state, TARGET_HALTED, and target::type.
Referenced by context_breakpoint_add_internal().
int target_add_hybrid_breakpoint | ( | struct target * | target, |
struct breakpoint * | breakpoint | ||
) |
Add the ContextID & IVA breakpoint for target.
This routine is a wrapper for target->type->add_hybrid_breakpoint.
Definition at line 1313 of file target.c.
References target_type::add_hybrid_breakpoint, ERROR_TARGET_NOT_HALTED, LOG_TARGET_ERROR, target::state, TARGET_HALTED, and target::type.
Referenced by hybrid_breakpoint_add_internal().
int target_add_watchpoint | ( | struct target * | target, |
struct watchpoint * | watchpoint | ||
) |
Add the watchpoint for target.
This routine is a wrapper for target->type->add_watchpoint.
Definition at line 1329 of file target.c.
References target_type::add_watchpoint, ERROR_TARGET_NOT_HALTED, LOG_TARGET_ERROR, target::state, TARGET_HALTED, and target::type.
Referenced by watchpoint_add_internal().
unsigned int target_address_bits | ( | struct target * | target | ) |
Return the number of address bits this target supports.
This routine is a wrapper for target->type->address_bits.
Definition at line 1453 of file target.c.
References target_type::address_bits, and target::type.
Referenced by stm32x_get_property_addr(), and target_address_max().
target_addr_t target_address_max | ( | struct target * | target | ) |
Return the highest accessible address for this target.
Definition at line 1444 of file target.c.
References bits, and target_address_bits().
Referenced by gdb_memory_map().
int target_alloc_working_area | ( | struct target * | target, |
uint32_t | size, | ||
struct working_area ** | area | ||
) |
Definition at line 2060 of file target.c.
References ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_WARNING, size, and target_alloc_working_area_try().
Referenced by aduc702x_write_block(), aducm360_write_block_async(), aducm360_write_block_sync(), arm7_9_bulk_write_memory(), arm_blank_check_memory(), arm_checksum_memory(), arm_code_to_working_area(), armv7m_blank_check_memory(), armv7m_checksum_memory(), bluenrgx_write(), cc26xx_init(), cc3220sf_write(), cfi_intel_write_block(), cfi_spansion_write_block(), cfi_spansion_write_block_mips(), COMMAND_HANDLER(), efm32x_write_block(), em357_write_block(), esp_algorithm_load_func_image(), esp_algorithm_run_image(), feroceon_bulk_write_memory(), fespi_write(), fm3_chip_erase(), fm3_erase(), fm3_write_block(), fm4_flash_erase(), fm4_flash_write(), kinetis_disable_wdog_algo(), kinetis_ke_stop_watchdog(), kinetis_ke_write_words(), kinetis_write_block(), lpc2000_iap_working_area_init(), lpc2000_write(), lpc3180_read_page(), lpc3180_write_page(), lpc32xx_read_page(), lpc32xx_write_page(), lpcspifi_erase(), lpcspifi_set_hw_mode(), lpcspifi_write(), max32xxx_write_block(), mdr_write_block(), mips32_blank_check_memory(), mips32_checksum_memory(), mips_m4k_bulk_read_memory(), mips_m4k_bulk_write_memory(), mips_mips64_bulk_write_memory(), mrvlqspi_flash_write(), msp432_init(), niietcm4_write_block(), npcx_init(), nrf5_ll_flash_write(), numicro_writeblock(), pic32mx_write_block(), psoc4_sysreq(), psoc5lp_write(), psoc6_erase(), psoc6_program_row(), riscv_checksum_memory(), rp2040_flash_write(), rp2040_stack_grab_and_prep(), rsl10_ll_flash_erase(), rsl10_ll_flash_write(), rsl10_mass_erase(), scratch_reserve(), sh_qspi_upload_helper(), sim3x_write_block(), sromalgo_prepare(), stellaris_write_block(), stm32l4_write_block(), stm32lx_write_half_pages(), stm32x_write_block(), stm32x_write_block_async(), stm32x_write_block_riscv(), stm8_blank_check_memory(), str9x_write_block(), xmc1xxx_erase(), xmc1xxx_erase_check(), and xmc1xxx_write().
int target_alloc_working_area_try | ( | struct target * | target, |
uint32_t | size, | ||
struct working_area ** | area | ||
) |
Definition at line 1966 of file target.c.
References working_area::address, ALIGN_DOWN, ALIGN_UP, working_area::backup, target::backup_working_area, ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, working_area::free, LOG_DEBUG, LOG_ERROR, target_type::mmu, working_area::next, NULL, print_wa_layout(), size, working_area::size, TARGET_ADDR_FMT, target_read_memory(), target_split_working_area(), target::type, working_area::user, target::working_area, target::working_area_phys, target::working_area_phys_spec, target::working_area_size, target::working_area_virt, target::working_area_virt_spec, and target::working_areas.
Referenced by aduc702x_write_block(), aducm360_write_block_async(), aducm360_write_block_sync(), cfi_intel_write_block(), cfi_spansion_write_block(), cfi_spansion_write_block_mips(), efm32x_write_block(), em357_write_block(), lpc2900_write(), max32xxx_write_block(), mdr_write_block(), niietcm4_write_block(), pic32mx_write_block(), qspi_read_write_block(), qspi_verify(), sh_qspi_upload_helper(), sim3x_write_block(), stellaris_write_block(), stm32l4_write_block(), stm32lx_write_half_pages(), stm32x_write_block(), stmqspi_blank_check(), str7x_write_block(), str9x_write_block(), and target_alloc_working_area().
int target_arch_state | ( | struct target * | target | ) |
Definition at line 2259 of file target.c.
References target_type::arch_state, ERROR_OK, LOG_WARNING, target::state, TARGET_HALTED, and target::type.
Referenced by COMMAND_HANDLER(), and log_target_callback_event_handler().
int target_blank_check_memory | ( | struct target * | target, |
struct target_memory_check_block * | blocks, | ||
int | num_blocks, | ||
uint8_t | erased_value | ||
) |
Definition at line 2511 of file target.c.
References target_type::blank_check_memory, ERROR_FAIL, ERROR_NOT_IMPLEMENTED, LOG_ERROR, target_was_examined(), and target::type.
Referenced by default_flash_blank_check().
uint16_t target_buffer_get_u16 | ( | struct target * | target, |
const uint8_t * | buffer | ||
) |
Definition at line 334 of file target.c.
References be_to_h_u16(), buffer, target::endianness, le_to_h_u16(), and TARGET_LITTLE_ENDIAN.
Referenced by aarch64_write_cpu_memory_slow(), arm7_9_unset_breakpoint(), arm7_9_write_memory(), arm_semihosting(), cfi_command_val(), cfi_probe(), chibios_update_memory_signature(), COMMAND_HANDLER(), cortex_a_write_cpu_memory_slow(), cortex_m_dcc_read(), esp32_apptrace_core_id_get(), esp32_apptrace_usr_block_len_get(), etm_read_instruction(), etmv1_data(), handle_iod_output(), mips_m4k_unset_breakpoint(), mips_mips16_unset_sdbbp(), nuttx_update_threads(), target_buffer_get_u16_array(), target_handle_md_output(), target_read_u16(), xscale_read_instruction(), and xscale_write_memory().
void target_buffer_get_u16_array | ( | struct target * | target, |
const uint8_t * | buffer, | ||
uint32_t | count, | ||
uint16_t * | dstbuf | ||
) |
Definition at line 401 of file target.c.
References buffer, count, and target_buffer_get_u16().
Referenced by arc_mem_write(), mips_m4k_write_memory(), and mips_mips64_write_memory().
uint32_t target_buffer_get_u24 | ( | struct target * | target, |
const uint8_t * | buffer | ||
) |
Definition at line 325 of file target.c.
References be_to_h_u24(), buffer, target::endianness, le_to_h_u24(), and TARGET_LITTLE_ENDIAN.
uint32_t target_buffer_get_u32 | ( | struct target * | target, |
const uint8_t * | buffer | ||
) |
Definition at line 316 of file target.c.
References be_to_h_u32(), buffer, target::endianness, le_to_h_u32(), and TARGET_LITTLE_ENDIAN.
Referenced by aarch64_write_cpu_memory_slow(), arc_get_register(), arc_get_register_value(), arc_mem_write_block16(), arc_mem_write_block8(), arc_restore_context(), arc_resume(), arm7_9_unset_breakpoint(), arm7_9_write_memory(), arm_semihosting(), armv4_5_mmu_translate_va(), armv7m_blank_check_memory(), calcaddr_physfromlin(), cfi_command_val(), cfi_probe(), COMMAND_HANDLER(), cortex_a_write_cpu_memory_slow(), cpu_context_read(), dsp563xx_write_memory_core(), esp_dbgstubs_table_read(), esp_xtensa_apptrace_ctrl_reg_read(), esp_xtensa_apptrace_queue_normal_write(), esp_xtensa_apptrace_queue_reverse_write(), etm_read_instruction(), etmv1_data(), feroceon_bulk_write_memory(), get_buffer(), get_name(), handle_iod_output(), lpc2000_iap_call(), mips_m4k_set_breakpoint(), mips_m4k_unset_breakpoint(), mips_mips64_unset_sdbbp(), nuttx_cortex_m_tcbinfo_stack_read(), nuttx_update_threads(), psoc4_get_family(), qn908x_probe(), rtos_cortex_m_stack_align(), semihosting_get_field(), target_buffer_get_addr(), target_buffer_get_u32_array(), target_checksum_memory(), target_handle_md_output(), target_read_u32(), xmc4xxx_write_page(), xscale_read_instruction(), xscale_write_memory(), xtensa_queue_exec_ins_wide(), and zephyr_get_arm_state().
void target_buffer_get_u32_array | ( | struct target * | target, |
const uint8_t * | buffer, | ||
uint32_t | count, | ||
uint32_t * | dstbuf | ||
) |
Definition at line 393 of file target.c.
References buffer, count, and target_buffer_get_u32().
Referenced by arc_mem_write(), lpc2900_run_bist128(), mips_m4k_bulk_write_memory(), mips_m4k_write_memory(), and mips_mips64_write_memory().
uint64_t target_buffer_get_u64 | ( | struct target * | target, |
const uint8_t * | buffer | ||
) |
Definition at line 307 of file target.c.
References be_to_h_u64(), buffer, target::endianness, le_to_h_u64(), and TARGET_LITTLE_ENDIAN.
Referenced by aarch64_write_cpu_memory_slow(), calcaddr_physfromlin(), chromium_ec_update_threads(), COMMAND_HANDLER(), read_userrow(), semihosting_get_field(), target_buffer_get_addr(), target_buffer_get_u64_array(), target_handle_md_output(), and target_read_u64().
void target_buffer_get_u64_array | ( | struct target * | target, |
const uint8_t * | buffer, | ||
uint32_t | count, | ||
uint64_t * | dstbuf | ||
) |
Definition at line 385 of file target.c.
References buffer, count, and target_buffer_get_u64().
Referenced by mips_mips64_bulk_write_memory(), and mips_mips64_write_memory().
void target_buffer_set_u16 | ( | struct target * | target, |
uint8_t * | buffer, | ||
uint16_t | value | ||
) |
Definition at line 370 of file target.c.
References buffer, target::endianness, h_u16_to_be(), h_u16_to_le(), and TARGET_LITTLE_ENDIAN.
Referenced by aarch64_read_cpu_memory_slow(), arc_mem_write_block16(), COMMAND_HANDLER(), cortex_a_read_cpu_memory_slow(), cortex_m_dcc_read(), stm32x_write_options(), target_buffer_set_u16_array(), target_fill_io(), target_fill_mem(), target_jim_write_memory(), target_write_phys_u16(), target_write_u16(), and xscale_read_memory().
void target_buffer_set_u16_array | ( | struct target * | target, |
uint8_t * | buffer, | ||
uint32_t | count, | ||
const uint16_t * | srcbuf | ||
) |
Definition at line 425 of file target.c.
References buffer, count, and target_buffer_set_u16().
Referenced by mips_m4k_read_memory(), and mips_mips64_read_memory().
void target_buffer_set_u24 | ( | struct target * | target, |
uint8_t * | buffer, | ||
uint32_t | value | ||
) |
Definition at line 361 of file target.c.
References buffer, target::endianness, h_u24_to_be(), h_u24_to_le(), and TARGET_LITTLE_ENDIAN.
void target_buffer_set_u32 | ( | struct target * | target, |
uint8_t * | buffer, | ||
uint32_t | value | ||
) |
Definition at line 352 of file target.c.
References buffer, target::endianness, h_u32_to_be(), h_u32_to_le(), and TARGET_LITTLE_ENDIAN.
Referenced by aarch64_read_cpu_memory_fast(), aarch64_read_cpu_memory_slow(), arc_get_register(), arc_mem_write_block16(), arc_mem_write_block8(), arc_resume(), arc_save_context(), armv7m_blank_check_memory(), COMMAND_HANDLER(), cortex_a_read_cpu_memory_fast(), cortex_a_read_cpu_memory_slow(), dsp563xx_read_memory_core(), kinetis_fill_fcf(), lpc2000_iap_call(), lpc2000_iap_working_area_init(), mips_m4k_set_breakpoint(), npcx_chip_erase(), npcx_erase(), npcx_write(), nuttx_cortex_m_tcbinfo_stack_read(), or1k_add_breakpoint(), psoc4_protect(), psoc4_sysreq(), psoc4_write(), semihosting_set_field(), sim3x_flash_protect(), stm32l4_write_block(), target_buffer_set_u32_array(), target_checksum_memory(), target_fill_io(), target_fill_mem(), target_jim_write_memory(), target_write_phys_u32(), target_write_u32(), write_long(), xmc4xxx_flash_protect(), and xscale_read_memory().
void target_buffer_set_u32_array | ( | struct target * | target, |
uint8_t * | buffer, | ||
uint32_t | count, | ||
const uint32_t * | srcbuf | ||
) |
Definition at line 417 of file target.c.
References buffer, count, and target_buffer_set_u32().
Referenced by aduc702x_write_block(), aducm360_write_block_async(), aducm360_write_block_sync(), arc_mem_read(), arm7_9_bulk_write_memory(), arm_code_to_working_area(), ath79_spi_bitbang_chunk(), cfi_intel_write_block(), cfi_spansion_write_block(), cfi_spansion_write_block_mips(), COMMAND_HANDLER(), feroceon_bulk_write_memory(), lpc2900_write(), mips32_blank_check_memory(), mips32_checksum_memory(), mips_m4k_bulk_read_memory(), mips_m4k_read_memory(), mips_mips64_read_memory(), pic32mx_write_block(), str7x_write_block(), and str9x_write_block().
void target_buffer_set_u64 | ( | struct target * | target, |
uint8_t * | buffer, | ||
uint64_t | value | ||
) |
Definition at line 343 of file target.c.
References buffer, target::endianness, h_u64_to_be(), h_u64_to_le(), and TARGET_LITTLE_ENDIAN.
Referenced by aarch64_read_cpu_memory_slow(), COMMAND_HANDLER(), samd_modify_user_row_masked(), semihosting_set_field(), target_buffer_set_u64_array(), target_fill_mem(), target_jim_write_memory(), target_write_phys_u64(), and target_write_u64().
void target_buffer_set_u64_array | ( | struct target * | target, |
uint8_t * | buffer, | ||
uint32_t | count, | ||
const uint64_t * | srcbuf | ||
) |
Definition at line 409 of file target.c.
References buffer, count, and target_buffer_set_u64().
Referenced by mips_mips64_read_memory().
int target_call_event_callbacks | ( | struct target * | target, |
enum target_event | event | ||
) |
Definition at line 1764 of file target.c.
References target_event_callback::callback, ERROR_OK, LOG_DEBUG, target_event_callbacks, TARGET_EVENT_GDB_HALT, TARGET_EVENT_HALTED, target_event_name(), target_handle_event(), and target_name().
Referenced by aarch64_poll(), aarch64_resume(), aarch64_step(), aarch64_step_restart_smp(), adapter_poll(), adapter_resume(), adapter_step(), arc_exit_debug(), arc_halt(), arc_poll(), arc_resume(), arc_step(), arm11_halt(), arm11_poll(), arm11_resume(), arm11_step(), arm720t_soft_reset_halt(), arm7_9_poll(), arm7_9_resume(), arm7_9_soft_reset_halt(), arm7_9_step(), arm920t_soft_reset_halt(), arm926ejs_soft_reset_halt(), avr32_ap7k_poll(), avr32_ap7k_resume(), COMMAND_HANDLER(), cortex_a_poll(), cortex_a_resume(), cortex_m_poll_one(), cortex_m_poll_smp(), cortex_m_restart_one(), cortex_m_step(), do_resume(), dsp563xx_poll(), dsp563xx_resume(), dsp563xx_step(), esirisc_poll(), esirisc_resume_or_step(), esp32s2_poll(), esp32s2_step(), esp_xtensa_smp_poll(), esp_xtensa_smp_resume(), esp_xtensa_smp_step(), gdb_connection_closed(), gdb_handle_vcont_packet(), gdb_input_inner(), gdb_new_connection(), gdb_target_callback_event_handler(), gdb_v_packet(), halt_finish(), handle_halt(), handle_target(), lakemont_poll(), lakemont_step(), lakemont_update_after_probemode_entry(), mem_ap_deassert_reset(), mem_ap_halt(), mem_ap_step(), mips_m4k_internal_restore(), mips_m4k_poll(), mips_m4k_resume(), mips_m4k_step(), mips_mips64_poll(), mips_mips64_resume(), mips_mips64_step(), or1k_poll(), or1k_resume_or_step(), resume_finish(), riscv_openocd_poll(), riscv_openocd_step(), semihosting_common(), stm8_poll(), stm8_resume(), stm8_step(), target_examine_one(), target_poll(), target_resume(), target_step(), xscale_poll(), xscale_resume(), xscale_step(), xscale_step_inner(), xtensa_chip_poll(), xtensa_resume(), and xtensa_step().
int target_call_reset_callbacks | ( | struct target * | target, |
enum target_reset_mode | reset_mode | ||
) |
Definition at line 1789 of file target.c.
References target_reset_callback::callback, ERROR_OK, target_reset_callback::list, list_for_each_entry, LOG_DEBUG, name, nvp_reset_modes, and nvp_value2name().
Referenced by psoc5lp_nvl_write(), and target_process_reset().
int target_call_timer_callbacks | ( | void | ) |
Definition at line 1878 of file target.c.
References target_call_timer_callbacks_check_time().
Referenced by esp32_cmd_apptrace_generic(), jim_command_dispatch(), and server_loop().
int target_call_timer_callbacks_now | ( | void | ) |
Invoke this to ensure that e.g.
polling timer callbacks happen before a synchronous command completes.
Definition at line 1884 of file target.c.
References target_call_timer_callbacks_check_time().
Referenced by gdb_query_packet(), and target_process_reset().
int target_call_trace_callbacks | ( | struct target * | target, |
size_t | len, | ||
uint8_t * | data | ||
) |
Definition at line 1802 of file target.c.
References target_trace_callback::callback, ERROR_OK, target_trace_callback::list, and list_for_each_entry.
Referenced by arm_tpiu_swo_poll_trace().
int target_checksum_memory | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | size, | ||
uint32_t * | crc | ||
) |
Definition at line 2467 of file target.c.
References buffer, target_type::checksum_memory, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, image_calculate_checksum(), LOG_ERROR, size, target_buffer_get_u32(), target_buffer_set_u32(), target_name(), target_read_buffer(), target_was_examined(), and target::type.
Referenced by COMMAND_HELPER(), default_flash_verify(), gdb_query_packet(), and mdr_write().
unsigned int target_data_bits | ( | struct target * | target | ) |
Return the number of data bits this target supports.
This routine is a wrapper for target->type->data_bits.
Definition at line 1460 of file target.c.
References target_type::data_bits, and target::type.
Referenced by target_read_buffer_default(), and target_write_buffer_default().
const char* target_debug_reason_str | ( | enum target_debug_reason | reason | ) |
Definition at line 6794 of file target.c.
References DBG_REASON_BREAKPOINT, DBG_REASON_DBGRQ, DBG_REASON_EXC_CATCH, DBG_REASON_EXIT, DBG_REASON_NOTHALTED, DBG_REASON_SINGLESTEP, DBG_REASON_UNDEFINED, DBG_REASON_WATCHPOINT, and DBG_REASON_WPTANDBKPT.
Referenced by gdb_last_signal().
|
inlinestatic |
Returns a description of the endianness for the specified target.
Definition at line 226 of file target.h.
References target::endianness, TARGET_BIG_ENDIAN, and TARGET_ENDIAN_UNKNOWN.
const char* target_event_name | ( | enum target_event | event | ) |
Return the name of a target event enumeration value.
Definition at line 275 of file target.c.
References jim_nvp_value2name_simple(), LOG_ERROR, jim_nvp::name, and nvp_target_event.
Referenced by COMMAND_HANDLER(), target_call_event_callbacks(), target_handle_event(), and tcl_target_callback_event_handler().
int target_examine | ( | void | ) |
Definition at line 711 of file target.c.
References all_targets, target::defer_examine, jtag_tap::enabled, ERROR_OK, jtag_enable_callback(), jtag_register_event_callback(), LOG_WARNING, target::next, target::tap, target, target_examine_one(), and target_name().
Referenced by COMMAND_HANDLER().
int target_examine_one | ( | struct target * | target | ) |
Examine the specified target, letting it perform any Initialisation that requires JTAG access.
This routine is a wrapper for target->type->examine.
Definition at line 672 of file target.c.
References ERROR_OK, target_type::examine, LOG_TARGET_DEBUG, LOG_TARGET_ERROR, LOG_TARGET_INFO, target_call_event_callbacks(), TARGET_EVENT_EXAMINE_END, TARGET_EVENT_EXAMINE_FAIL, TARGET_EVENT_EXAMINE_START, target_reset_examined(), target_set_examined(), and target::type.
Referenced by arm7_9_deassert_reset(), cortex_m_assert_reset(), esp_xtensa_smp_poll(), handle_target(), hl_assert_reset(), jtag_enable_callback(), and target_examine().
void target_free_all_working_areas | ( | struct target * | target | ) |
Definition at line 2150 of file target.c.
References working_area::backup, working_area::free, NULL, target_free_all_working_areas_restore(), and target::working_areas.
Referenced by aarch64_restore_one(), adapter_resume(), arc_resume(), arm11_resume(), arm7_9_resume(), avr32_ap7k_resume(), cfi_spansion_write_block(), cfi_spansion_write_block_mips(), cortex_a_internal_restore(), cortex_m_restore_one(), esirisc_resume_or_step(), esp_algorithm_unload_func_image(), lpc2900_write(), mips_m4k_internal_restore(), mips_mips64_resume(), or1k_resume_or_step(), stm8_resume(), target_configure(), target_destroy(), and xscale_resume().
int target_free_working_area | ( | struct target * | target, |
struct working_area * | area | ||
) |
Free a working area.
Restore target data if area backup is configured.
target | |
area | Pointer to the area to be freed or NULL |
Definition at line 2118 of file target.c.
References target_free_working_area_restore().
Referenced by aduc702x_write_block(), aducm360_write_block_async(), aducm360_write_block_sync(), arm_blank_check_memory(), arm_checksum_memory(), armv7m_blank_check_memory(), armv7m_checksum_memory(), bluenrgx_write(), cc26xx_init(), cc26xx_quit(), cc3220sf_write(), cfi_intel_write_block(), cfi_spansion_write_block(), cfi_spansion_write_block_mips(), COMMAND_HANDLER(), efm32x_write_block(), em357_write_block(), esp_algorithm_run_image(), fespi_write(), fm3_chip_erase(), fm3_erase(), fm3_write_block(), fm4_flash_erase(), fm4_flash_write(), get_lpc2000_part_id(), kinetis_disable_wdog_algo(), kinetis_ke_stop_watchdog(), kinetis_ke_write_words(), kinetis_write_block(), lpc2000_erase(), lpc2000_iap_blank_check(), lpc2000_iap_working_area_init(), lpc2000_write(), lpc3180_read_page(), lpc3180_write_page(), lpc32xx_read_page(), lpc32xx_write_page(), lpcspifi_erase(), lpcspifi_set_hw_mode(), lpcspifi_write(), max32xxx_write_block(), mdr_write_block(), mips32_blank_check_memory(), mips32_checksum_memory(), mrvlqspi_flash_write(), msp432_init(), msp432_quit(), niietcm4_write_block(), npcx_init(), npcx_quit(), nrf5_ll_flash_write(), numicro_writeblock(), pic32mx_write_block(), psoc4_sysreq(), psoc5lp_write(), psoc6_erase(), psoc6_program_row(), qspi_read_write_block(), qspi_verify(), riscv_checksum_memory(), rp2040_finalize_stack_free(), rp2040_flash_write(), rsl10_ll_flash_erase(), rsl10_ll_flash_write(), rsl10_mass_erase(), scratch_release(), sh_qspi_upload_helper(), sim3x_write_block(), sromalgo_prepare(), sromalgo_release(), stellaris_write_block(), stm32l4_write_block(), stm32lx_write_half_pages(), stm32x_write_block(), stm32x_write_block_async(), stm32x_write_block_riscv(), stm8_blank_check_memory(), stmqspi_blank_check(), str7x_write_block(), str9x_write_block(), xmc1xxx_erase(), xmc1xxx_erase_check(), and xmc1xxx_write().
int target_gdb_fileio_end | ( | struct target * | target, |
int | retcode, | ||
int | fileio_errno, | ||
bool | ctrl_c | ||
) |
Pass GDB file-I/O response to target after finishing host syscall.
This routine is a wrapper for target->type->gdb_fileio_end.
Definition at line 1435 of file target.c.
References ERROR_TARGET_NOT_HALTED, target_type::gdb_fileio_end, LOG_TARGET_ERROR, target::state, TARGET_HALTED, and target::type.
Referenced by gdb_fileio_response_packet().
const char* target_get_gdb_arch | ( | const struct target * | target | ) |
Obtain the architecture for GDB.
This routine is a wrapper for target->type->get_gdb_arch.
Definition at line 1361 of file target.c.
References target_type::get_gdb_arch, NULL, and target::type.
Referenced by gdb_generate_target_description(), and gdb_target_description_supported().
int target_get_gdb_fileio_info | ( | struct target * | target, |
struct gdb_fileio_info * | fileio_info | ||
) |
Obtain file-I/O information from target for GDB to do syscall.
This routine is a wrapper for target->type->get_gdb_fileio_info.
Definition at line 1426 of file target.c.
References ERROR_TARGET_NOT_HALTED, target::fileio_info, target_type::get_gdb_fileio_info, LOG_TARGET_ERROR, target::state, TARGET_HALTED, and target::type.
Referenced by gdb_frontend_halted().
int target_get_gdb_reg_list | ( | struct target * | target, |
struct reg ** | reg_list[], | ||
int * | reg_list_size, | ||
enum target_register_class | reg_class | ||
) |
Obtain the registers for GDB.
This routine is a wrapper for target->type->get_gdb_reg_list.
Definition at line 1368 of file target.c.
References ERROR_FAIL, ERROR_OK, target_type::get_gdb_reg_list, LOG_ERROR, NULL, target_was_examined(), and target::type.
Referenced by gdb_get_registers_packet(), gdb_set_registers_packet(), get_current(), hwthread_get_thread_reg_list(), nuttx_getreg_current_thread(), and target_get_gdb_reg_list_noread().
int target_get_gdb_reg_list_noread | ( | struct target * | target, |
struct reg ** | reg_list[], | ||
int * | reg_list_size, | ||
enum target_register_class | reg_class | ||
) |
Obtain the registers for GDB, but don't read register values from the target.
This routine is a wrapper for target->type->get_gdb_reg_list_noread.
Definition at line 1390 of file target.c.
References ERROR_OK, target_type::get_gdb_reg_list_noread, target_get_gdb_reg_list(), and target::type.
Referenced by gdb_get_register_packet(), gdb_set_register_packet(), gdb_target_description_supported(), and smp_reg_list_noread().
uint32_t target_get_working_area_avail | ( | struct target * | target | ) |
Definition at line 2164 of file target.c.
References ALIGN_DOWN, working_area::free, working_area::next, size, working_area::size, target::working_area_size, and target::working_areas.
Referenced by armv7m_blank_check_memory(), cc3220sf_write(), fespi_write(), fm4_flash_write(), kinetis_write_block(), lpcspifi_write(), mrvlqspi_flash_write(), psoc5lp_write(), qspi_read_write_block(), rp2040_flash_write(), rsl10_ll_flash_write(), stm32l4_write_block(), stm32x_write_block_async(), stm32x_write_block_riscv(), stmqspi_blank_check(), and xmc1xxx_write().
int target_halt | ( | struct target * | target | ) |
Definition at line 507 of file target.c.
References ERROR_FAIL, ERROR_OK, target_type::halt, target::halt_issued, target::halt_issued_time, LOG_ERROR, target_was_examined(), timeval_ms(), and target::type.
Referenced by arc_assert_reset(), arm11_deassert_reset(), arm720t_soft_reset_halt(), arm7_9_dcc_completion(), arm7_9_deassert_reset(), arm7_9_soft_reset_halt(), arm920t_soft_reset_halt(), arm926ejs_soft_reset_halt(), armv4_5_run_algorithm_completion(), armv7m_wait_algorithm(), cc26xx_quit(), COMMAND_HANDLER(), dsp563xx_assert_reset(), esp32_apptrace_safe_halt_targets(), feroceon_bulk_write_memory(), gdb_input_inner(), handle_reset_halt(), lakemont_reset_deassert(), mips32_run_and_wait(), mips_m4k_assert_reset(), mips_mips64_assert_reset(), msp432_quit(), npcx_quit(), sromalgo_release(), stm32lx_obl_launch(), stm8_reset_assert(), stm8_run_and_wait(), target_profiling_default(), xscale_assert_reset(), and xtensa_wait_algorithm().
void target_handle_event | ( | struct target * | t, |
enum target_event | e | ||
) |
Definition at line 4667 of file target.c.
References target_event_action::body, current_command_context(), command_context::current_target_override, ERROR_COMMAND_CLOSE_CONNECTION, target_event_action::event, target::event_action, target_event_action::interp, LOG_DEBUG, LOG_TARGET_ERROR, target_event_action::next, NULL, target, target_event_name(), target_name(), and target_type_name().
Referenced by aarch64_assert_reset(), arc_assert_reset(), arm11_assert_reset(), arm7_9_assert_reset(), assert_reset(), COMMAND_HANDLER(), cortex_a_assert_reset(), cortex_m_assert_reset(), jim_target_invoke_event(), mips_m4k_assert_reset(), semihosting_common(), and target_call_event_callbacks().
void target_handle_md_output | ( | struct command_invocation * | cmd, |
struct target * | target, | ||
target_addr_t | address, | ||
unsigned int | size, | ||
unsigned int | count, | ||
const uint8_t * | buffer | ||
) |
Definition at line 3346 of file target.c.
References buffer, cmd, command_print(), count, LOG_ERROR, output, size, TARGET_ADDR_FMT, target_buffer_get_u16(), target_buffer_get_u32(), and target_buffer_get_u64().
Referenced by COMMAND_HANDLER().
bool target_has_event_action | ( | const struct target * | target, |
enum target_event | event | ||
) |
Returns true only if the target has a handler for the specified event.
Definition at line 4860 of file target.c.
Referenced by aarch64_assert_reset(), arc_assert_reset(), arm11_assert_reset(), arm7_9_assert_reset(), assert_reset(), cortex_a_assert_reset(), cortex_m_assert_reset(), and mips_m4k_assert_reset().
int target_hit_watchpoint | ( | struct target * | target, |
struct watchpoint ** | watchpoint | ||
) |
Find out the just hit watchpoint for target.
This routine is a wrapper for target->type->hit_watchpoint.
Definition at line 1343 of file target.c.
References ERROR_FAIL, ERROR_TARGET_NOT_HALTED, target_type::hit_watchpoint, LOG_TARGET_ERROR, target::state, TARGET_HALTED, and target::type.
Referenced by watchpoint_hit().
|
inlinestatic |
Returns the instance-specific name of the specified target.
Definition at line 233 of file target.h.
References target::cmd_name.
Referenced by aarch64_assert_reset(), aarch64_deassert_reset(), aarch64_debug_entry(), aarch64_do_restart_one(), aarch64_examine_first(), aarch64_halt_one(), aarch64_init_debug_access(), aarch64_poll(), aarch64_prep_restart_smp(), aarch64_prepare_halt_smp(), aarch64_prepare_restart_one(), aarch64_restart_one(), aarch64_restore_context(), aarch64_restore_one(), aarch64_resume(), aarch64_step(), aarch64_step_restart_smp(), aarch64_wait_halt_one(), arc_set_actionpoints_num(), arm11_assert_reset(), arm11_deassert_reset(), arm7_9_assert_reset(), arm_dpm_initialize(), arm_dpm_setup(), armv7a_read_mpidr(), armv7m_arch_state(), armv8_aarch64_state(), armv8_dpm_initialize(), armv8_dpm_setup(), armv8_get_gdb_reg_list(), armv8_read_mpidr(), chibios_create(), chromium_ec_create(), COMMAND_HANDLER(), COMMAND_HELPER(), cortex_a_assert_reset(), cortex_a_deassert_reset(), cortex_a_examine_first(), discover_vlenb(), dpm_maybe_update_bpwp(), dpmv8_maybe_update_bpwp(), embeddedice_build_reg_cache(), embkernel_create(), esirisc_add_breakpoint(), esirisc_add_watchpoint(), esirisc_assert_reset(), esirisc_deassert_reset(), esirisc_debug_enable(), esirisc_debug_reset(), esirisc_debug_step(), esirisc_disable_interrupts(), esirisc_disable_step(), esirisc_enable_step(), esirisc_examine(), esirisc_flush_caches(), esirisc_halt(), esirisc_identify(), esirisc_poll(), esirisc_read_csr(), esirisc_read_memory(), esirisc_read_reg(), esirisc_remove_breakpoint(), esirisc_remove_breakpoints(), esirisc_remove_watchpoint(), esirisc_remove_watchpoints(), esirisc_reset_entry(), esirisc_restore_hwdc(), esirisc_restore_interrupts(), esirisc_resume_or_step(), esirisc_save_interrupts(), esirisc_target_create(), esirisc_trace_clear_status(), esirisc_trace_get_status(), esirisc_trace_init(), esirisc_trace_read_buffer(), esirisc_trace_read_memory(), esirisc_trace_start(), esirisc_trace_stop(), esirisc_write_csr(), esirisc_write_memory(), esirisc_write_reg(), esp32_apptrace_get_data_info(), esp32_apptrace_safe_halt_targets(), esp32_cmd_apptrace_generic(), esp32_sysview_stop(), esp_dbgstubs_table_read(), esp_xtensa_apptrace_buffs_write(), esp_xtensa_apptrace_data_read(), esp_xtensa_smp_poll(), esp_xtensa_smp_update_halt_gdb(), freertos_create(), gdb_breakpoint_watchpoint_packet(), gdb_new_connection(), gdb_restart_inferior(), get_target(), halt_prep(), hwthread_fill_thread(), kinetis_create_missing_banks(), lakemont_reset_deassert(), max32xxx_write_block(), mqx_create(), read_memory(), register_get(), register_set(), riot_create(), riscv013_get_register(), riscv_enumerate_triggers(), riscv_get_gdb_reg_list_internal(), riscv_get_register(), riscv_halt_go_all_harts(), riscv_resume_go_all_harts(), riscv_resume_prep_all_harts(), riscv_semihosting_setup(), riscv_set_register(), riscv_step_rtos_hart(), rtkernel_create(), set_debug_reason(), stellaris_write_block(), stm32x_probe(), target_call_event_callbacks(), target_checksum_memory(), target_examine(), target_handle_event(), target_init_one(), target_read_memory(), target_read_phys_memory(), target_soft_reset_halt(), target_write_memory(), target_write_phys_memory(), threadx_create(), ucos_iii_create(), write_memory(), xscale_init_arch_info(), xscale_read_phys_memory(), xscale_write_phys_memory(), and xtensa_core_status_check().
int target_poll | ( | struct target * | target | ) |
Definition at line 477 of file target.c.
References DEFAULT_HALT_TIMEOUT, ERROR_FAIL, ERROR_OK, target::halt_issued, target::halt_issued_time, LOG_INFO, target_type::poll, target::state, target_call_event_callbacks(), TARGET_EVENT_GDB_HALT, TARGET_HALTED, target_was_examined(), timeval_ms(), and target::type.
Referenced by ambiqmicro_exec_command(), arm7_9_deassert_reset(), COMMAND_HANDLER(), cortex_m_profiling(), esp32_apptrace_wait4halt(), esp_xtensa_profiling(), gdb_handle_vcont_packet(), gdb_input_inner(), handle_target(), or1k_profiling(), stm32lx_obl_launch(), target_profiling_default(), and target_wait_state().
int target_profiling_default | ( | struct target * | target, |
uint32_t * | samples, | ||
uint32_t | max_num_samples, | ||
uint32_t * | num_samples, | ||
uint32_t | seconds | ||
) |
Definition at line 2290 of file target.c.
References alive_sleep(), buf_get_u32(), ERROR_OK, gettimeofday(), LOG_INFO, NULL, target::reg_cache, register_get_by_name(), target::state, target_halt(), TARGET_HALTED, target_poll(), target_resume(), TARGET_RUNNING, timeval_add_time(), timeval_compare(), and reg::value.
Referenced by cortex_m_profiling(), esp_xtensa_profiling(), and target_init_one().
void target_quit | ( | void | ) |
Free all the resources allocated by targets and the target layer.
Definition at line 2230 of file target.c.
References all_targets, target::next, target_event_callback::next, target_timer_callback::next, NULL, target, target_destroy(), target_event_callbacks, and target_timer_callbacks.
Referenced by server_quit().
int target_read_buffer | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | size, | ||
uint8_t * | buffer | ||
) |
Definition at line 2407 of file target.c.
References buffer, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, target_type::read_buffer, size, TARGET_ADDR_FMT, target_was_examined(), and target::type.
Referenced by arc_read_instruction_u32(), arc_set_breakpoint(), arm_nandread(), armv4_5_run_algorithm_inner(), armv7m_blank_check_memory(), armv7m_wait_algorithm(), cc3220sf_write(), chibios_update_memory_signature(), chibios_update_threads(), chromium_ec_detect_rtos(), chromium_ec_update_threads(), COMMAND_HANDLER(), COMMAND_HELPER(), default_flash_read(), dsp563xx_run_algorithm(), ecos_get_thread_reg_list(), ecos_update_threads(), efm32x_write_lock_data(), embkernel_get_tasks_details(), embkernel_get_thread_reg_list(), embkernel_update_threads(), eneispif_read_flash_id(), esp32_soc_reset(), esp32s3_soc_reset(), esp_dbgstubs_table_read(), esp_xtensa_dbgstubs_info_update(), freertos_update_threads(), gdb_read_memory_packet(), get_stacking_info_arm926ejs(), hwthread_read_buffer(), image_read_section(), imx31_read_page(), mips32_run_algorithm(), mqx_target_read_buffer(), mxc_read_page(), nuttx_cortex_m_tcbinfo_stack_read(), nuttx_update_threads(), read_channel_name(), read_from_channel(), read_rtt_channel(), riot_update_threads(), riscv_hit_watchpoint(), rtkernel_add_task(), rtos_generic_stack_read(), semihosting_common(), sh_qspi_read(), stm8_run_algorithm(), stmqspi_blank_check(), target_checksum_memory(), target_rtt_find_control_block(), target_rtt_read_control_block(), target_run_read_async_algorithm(), threadx_get_thread_reg_list(), threadx_update_threads(), tms470_erase_check(), ucos_iii_update_threads(), xtensa_sw_breakpoint_add(), xtensa_wait_algorithm(), and zephyr_fetch_thread().
int target_read_memory | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | size, | ||
uint32_t | count, | ||
uint8_t * | buffer | ||
) |
Read count items of size bytes from the memory of target at the address given.
This routine is a wrapper for target->type->read_memory.
Definition at line 1237 of file target.c.
References buffer, count, ERROR_FAIL, LOG_ERROR, target_type::read_memory, size, target_name(), target_was_examined(), and target::type.
Referenced by aarch64_set_breakpoint(), arm7_9_set_breakpoint(), arm7_9_unset_breakpoint(), arm920t_write_memory(), arm_semihosting(), cfi_target_read_memory(), COMMAND_HANDLER(), cortex_a_read_buffer(), cortex_a_set_breakpoint(), cortex_m_set_breakpoint(), default_flash_mem_blank_check(), esirisc_trace_read_memory(), esp_algorithm_read_stub_logs(), esp_xtensa_semihosting(), kinetis_write(), linux_read_memory(), lpc2900_read_security_status(), lpc2900_run_bist128(), lpc3180_read_page(), lpc32xx_read_page_mlc(), lpc32xx_read_page_slc(), lpc32xx_write_page_slc(), mips_m4k_set_breakpoint(), mips_m4k_unset_breakpoint(), mips_mips16_set_sdbbp(), mips_mips16_unset_sdbbp(), mips_mips64_set_sdbbp(), mips_mips64_unset_sdbbp(), psoc4_get_family(), psoc4_protect_check(), qn908x_get_info(), qn908x_probe(), qn908x_read_page_lock(), read_by_given_size(), read_userrow(), sam3_page_read(), sam4_page_read(), sam4l_write_page_partial(), samd_modify_user_row_masked(), same5_modify_user_row_masked(), samv_page_read(), semihosting_common(), semihosting_read_fields(), stm8_unset_breakpoint(), target_alloc_working_area_try(), target_read_buffer_default(), target_read_u16(), target_read_u32(), target_read_u64(), target_read_u8(), ucos_iii_find_last_thread_address(), ucos_iii_get_thread_reg_list(), ucos_iii_update_thread_offsets(), ucos_iii_update_threads(), write_by_given_size(), xscale_set_breakpoint(), and xtensa_fileio_detect_proc().
int target_read_phys_memory | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | size, | ||
uint32_t | count, | ||
uint8_t * | buffer | ||
) |
Definition at line 1251 of file target.c.
References buffer, count, ERROR_FAIL, LOG_ERROR, target_type::read_phys_memory, size, target_name(), target_was_examined(), and target::type.
Referenced by COMMAND_HANDLER(), and linux_read_memory().
int target_read_u16 | ( | struct target * | target, |
target_addr_t | address, | ||
uint16_t * | value | ||
) |
Definition at line 2574 of file target.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_buffer_get_u16(), target_read_memory(), target_was_examined(), and reg::value.
Referenced by arc_set_breakpoint(), arc_unset_breakpoint(), arm7_9_set_breakpoint(), arm_semihosting(), arm_simulate_step_core(), COMMAND_HANDLER(), cortex_m_erratum_check_breakpoint(), do_data_output(), ecc_status_v1(), ecc_status_v2(), efm32x_get_flash_size(), efm32x_get_part_num(), efm32x_get_ram_size(), get_next_byte_from_sram_buffer(), get_next_halfword_from_sram_buffer(), imx31_init(), imx31_nand_ready(), imx31_write_page(), initialize_nf_controller(), kinetis_disable_wdog_kx(), lpc3180_read_data(), mips_m4k_set_breakpoint(), mips_mips16_set_sdbbp(), mxc_init(), mxc_nand_ready(), mxc_read_page(), mxc_write_page(), nuttx_cortex_m_tcbinfo_stack_read(), nuttx_getregs_fromstack(), nuttx_update_threads(), poll_for_complete_op(), riot_update_threads(), rp2040_lookup_symbol(), rtkernel_add_task(), samd_check_error(), samd_protect_check(), same5_wait_and_check_error(), stm32l4_probe(), stm32lx_probe(), stm32x_get_flash_size(), stm32x_probe(), str9x_protect_check(), ucos_iii_update_threads(), xmc1xxx_erase_check(), and xmc1xxx_nvm_check_idle().
int target_read_u32 | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t * | value | ||
) |
Definition at line 2550 of file target.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_buffer_get_u32(), target_read_memory(), target_was_examined(), and reg::value.
Referenced by adapter_debug_entry(), aducm360_check_flash_completion(), aducm360_mass_erase(), aducm360_page_erase(), aducm360_set_write_enable(), aducm360_write_modified(), ambiqmicro_read_part_info(), arm7_9_resume(), arm7_9_set_breakpoint(), arm7_9_step(), arm_semihosting(), arm_simulate_step_core(), armv7m_trace_itm_config(), at91sam7_get_flash_status(), at91sam7_read_clock_info(), at91sam7_read_part_info(), at91sam9_nand_ready(), at91sam9_read_page(), at91sam9_write_page(), bluenrgx_probe(), bluenrgx_read_flash_reg(), bluenrgx_write(), call_sromapi(), cc26xx_probe(), cc26xx_wait_algo_done(), cc3220sf_erase(), cc3220sf_mass_erase(), check_flash_status(), chibios_get_thread_reg_list(), chibios_update_stacking(), chibios_update_threads(), chromium_ec_get_current_task_ptr(), chromium_ec_get_num_tasks(), chromium_ec_get_thread_reg_list(), chromium_ec_update_threads(), clrsetbits_u32(), COMMAND_HANDLER(), cortex_m_dwt_get_reg(), cortex_m_dwt_setup(), cortex_m_enable_fpb(), cortex_m_examine(), cortex_m_has_tz(), cortex_m_hit_watchpoint(), cortex_m_profiling(), davinci_init(), davinci_nand_ready(), davinci_read_block_data(), davinci_write_page_ecc1(), davinci_write_page_ecc4(), davinci_write_page_ecc4infix(), efc_get_result(), efc_get_status(), efm32x_read_lock_data(), efm32x_read_reg_u32(), em357_get_flash_status(), em357_protect(), em357_protect_check(), em357_read_options(), eneispif_read_reg(), esirisc_flash_check_status(), esirisc_flash_disable_protect(), esirisc_flash_enable_protect(), esirisc_flash_wait(), esp32s2_disable_wdts(), esp32s2_set_peri_reg_mask(), esp32s3_disable_wdts(), esp_algorithm_read_stub_logs(), fespi_read_reg(), flashd_read_uid(), fm3_chip_erase(), fm3_erase(), fm4_enter_flash_cpu_programming_mode(), fm4_enter_flash_cpu_rom_mode(), freertos_get_thread_reg_list(), freertos_update_threads(), handle_reset_halt(), imx31_init(), ipc_acquire(), ipc_poll_lock_stat(), is_flash_protected(), kinetis_disable_wdog32(), kinetis_ke_probe(), kinetis_probe_chip(), kinetis_probe_chip_s32k(), kinetis_protect_check(), kinetis_read_pmstat(), lpc2000_iap_call(), lpc2900_probe(), lpc2900_wait_status(), lpc3180_controller_ready(), lpc3180_cycle_time(), lpc3180_nand_ready(), lpc3180_read_data(), lpc3180_read_page(), lpc3180_tc_ready(), lpc32xx_controller_ready(), lpc32xx_cycle_time(), lpc32xx_dma_ready(), lpc32xx_nand_ready(), lpc32xx_read_data(), lpc32xx_read_page_mlc(), lpc32xx_tc_ready(), max32xxx_erase(), max32xxx_flash_op_post(), max32xxx_flash_op_pre(), max32xxx_mass_erase(), max32xxx_probe(), max32xxx_protect(), max32xxx_protect_check(), max32xxx_write(), mdr_erase(), mdr_mass_erase(), mdr_read(), mdr_write(), mips32_configure_break_unit(), mips32_configure_dbs(), mips32_configure_ibs(), mips32_enable_interrupts(), mips32_read_config_regs(), mips_m4k_examine_debug_reason(), mips_m4k_set_breakpoint(), mips_mips64_set_sdbbp(), mrvlqspi_fifo_flush(), mrvlqspi_read_byte(), mrvlqspi_set_conf(), mrvlqspi_set_ss_state(), mrvlqspi_start_transfer(), mrvlqspi_stop_transfer(), msp432_probe(), msp432_wait_inactive(), msp432_wait_return_code(), mxc_init(), niietcm4_dump_uflash_page(), niietcm4_opstatus_check(), niietcm4_probe(), niietcm4_probe_k1921vk01t(), niietcm4_protect_check(), niietcm4_uopstatus_check(), npcx_get_flash_id(), nrf51_get_ram_size(), nrf51_protect_check_clenr0(), nrf51_protect_clenr0(), nrf52_protect_check_bprot(), nrf5_erase_page(), nrf5_nvmc_read_u32(), nrf5_probe_chip(), nrf5_read_ficr_info_part(), nrf5_read_ficr_more_info(), nuc910_nand_ready(), numicro_erase(), numicro_fmc_cmd(), numicro_get_cpu_type(), numicro_init_isp(), numicro_reg_unlock(), numicro_write(), nuttx_getregs_fromstack(), nuttx_update_threads(), pic32mx_get_flash_status(), pic32mx_probe(), pic32mx_protect_check(), poll_busy(), psoc4_get_silicon_id(), psoc4_probe(), psoc4_sysreq(), psoc4_test_flash_wounding(), psoc5lp_eeprom_probe(), psoc5lp_get_device_id(), psoc6_probe(), qn908x_busy_check(), qn908x_get_info(), qn908x_init_flash(), qn908x_load_lock_stat(), qn908x_probe(), qn908x_status_check(), qn908x_update_reg(), read_flash_id(), read_sfdp_block(), read_status_reg(), riot_get_thread_reg_list(), riot_update_threads(), rp2040_lookup_symbol(), rp2040_spi_read_flash_id(), rp2040_ssel_active(), rpc_hf_mode(), rpc_hf_wait_tend(), rpc_hf_xfer(), rsl10_check_device(), rsl10_ll_flash_erase(), rsl10_ll_flash_write(), rsl10_mass_erase(), rsl10_protect(), rsl10_protect_check(), rtkernel_add_task(), rtkernel_get_thread_reg_list(), rtkernel_update_threads(), rtkernel_verify_task(), s3c2440_read_block_data(), s6e2cc_probe(), sam3_page_write(), sam3_read_this_reg(), sam4_read_this_reg(), sam4_set_wait(), sam4l_check_page_erased(), sam4l_flash_check_error(), sam4l_flash_command(), sam4l_flash_wait_until_ready(), sam4l_probe(), sam4l_protect_check(), samd_get_flash_page_info(), samd_get_reservedmask(), samd_modify_user_row_masked(), samd_probe(), samd_write(), same5_pre_write_check(), same5_probe(), same5_protect_check(), samv_efc_get_result(), samv_efc_get_status(), samv_get_device_id(), sim3x_erase_page(), sim3x_flash_erase(), sim3x_flash_lock_check(), sim3x_read_deviceid(), sim3x_read_info(), ssp_read_reg(), stellaris_erase(), stellaris_mass_erase(), stellaris_protect(), stellaris_protect_check(), stellaris_read_clock_info(), stellaris_read_part_info(), stellaris_write(), stm32l4_read_flash_reg(), stm32l4_read_idcode(), stm32lx_enable_write_half_page(), stm32lx_get_flash_status(), stm32lx_lock_program_memory(), stm32lx_mass_erase(), stm32lx_protect_check(), stm32lx_read_id_code(), stm32lx_unlock_options_bytes(), stm32lx_unlock_program_memory(), stm32x_get_device_id(), stm32x_get_flash_status(), stm32x_probe(), stm32x_protect_check(), stm32x_read_flash_reg(), stm32x_read_id_code(), stm32x_read_options(), stm32x_unlock_option_reg(), stm32x_unlock_reg(), stmqspi_abort(), stmqspi_probe(), str7x_protect_check(), str7x_result(), str7x_waitbusy(), str9x_protect_check(), target_run_flash_async_algorithm(), target_run_read_async_algorithm(), test_iomux_settings(), tms470_check_flash_unlocked(), tms470_erase_check(), tms470_flash_initialize_internal_state_machine(), tms470_flash_status(), tms470_protect(), tms470_protect_check(), tms470_read_part_info(), tms470_try_flash_keys(), tms470_write(), w600_get_flash_id(), w600_start_do(), xmc1xxx_get_info_command(), xmc1xxx_probe(), xmc1xxx_protect_check(), xmc4xxx_erase_sector(), xmc4xxx_get_flash_status(), xmc4xxx_get_info_command(), xmc4xxx_probe(), xmc4xxx_protect_check(), xscale_resume(), xscale_step_inner(), xscale_update_vectors(), zephyr_fetch_thread(), zephyr_fetch_thread_list(), zephyr_get_arc_state(), and zephyr_update_threads().
int target_read_u64 | ( | struct target * | target, |
target_addr_t | address, | ||
uint64_t * | value | ||
) |
Definition at line 2526 of file target.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_buffer_get_u64(), target_read_memory(), target_was_examined(), and reg::value.
Referenced by mips64_configure_break_unit(), mips64_configure_d_break_unit(), mips64_configure_i_break_unit(), and mips64_enable_interrupts().
int target_read_u8 | ( | struct target * | target, |
target_addr_t | address, | ||
uint8_t * | value | ||
) |
Definition at line 2598 of file target.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_read_memory(), target_was_examined(), and reg::value.
Referenced by aduc702x_check_flash_completion(), aduc702x_write_single(), at91sam9_read_data(), chibios_update_threads(), COMMAND_HANDLER(), davinci_read_block_data(), davinci_read_data(), efm32x_get_part_family(), efm32x_get_prod_rev(), efm32x_read_info(), find_sfdp_dummy(), fm3_busy_wait(), kinetis_disable_wdog(), kinetis_ftfx_command(), kinetis_ftfx_prepare(), kinetis_ke_ftmrx_command(), kinetis_ke_prepare_flash(), kinetis_ke_protect_check(), kinetis_ke_stop_watchdog(), kinetis_make_ram_ready(), kinetis_protect_check(), kinetis_read_pmstat(), kinetis_write_block(), lpc3180_controller_ready(), lpc3180_nand_ready(), lpc3180_read_data(), lpc32xx_controller_ready(), lpc32xx_nand_ready(), lpc32xx_read_data(), nuc910_nand_read(), nuttx_update_threads(), orion_nand_read(), psoc5lp_nvl_write(), psoc5lp_spc_busy_wait_data(), psoc5lp_spc_busy_wait_idle(), psoc5lp_spc_enable_clock(), psoc5lp_spc_get_temp(), psoc5lp_spc_read_byte(), psoc5lp_spc_read_hidden_row(), psoc5lp_spc_read_volatile_byte(), read_flash_id(), read_sfdp_block(), read_status_reg(), riot_update_threads(), s3c2410_read_data(), s3c2440_nand_ready(), s3c2440_read_block_data(), s3c24xx_read_data(), samd_check_error(), sh_qspi_cs_activate(), sh_qspi_cs_deactivate(), sh_qspi_init(), sh_qspi_wait_for_bit(), sh_qspi_xfer_common(), stm32x_otp_protect(), stm32x_otp_read_protect(), stm8_set_breakpoint(), str9x_erase(), str9x_protect(), str9x_write(), ucos_iii_update_threads(), zephyr_fetch_thread(), and zephyr_update_threads().
int target_register_commands | ( | struct command_context * | cmd_ctx | ) |
Definition at line 6281 of file target.c.
References NULL, register_commands(), and target_command_handlers.
Referenced by setup_command_handler().
int target_register_event_callback | ( | int(*)(struct target *target, enum target_event event, void *priv) | callback, |
void * | priv | ||
) |
Definition at line 1592 of file target.c.
References target_event_callback::callback, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, NULL, priv, and target_event_callbacks.
Referenced by COMMAND_HANDLER(), gdb_new_connection(), and tcl_new_connection().
int target_register_reset_callback | ( | int(*)(struct target *target, enum target_reset_mode reset_mode, void *priv) | callback, |
void * | priv | ||
) |
Definition at line 1614 of file target.c.
References target_reset_callback::callback, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, target_reset_callback::list, list_add(), LOG_ERROR, priv, and target_reset_callback::priv.
Referenced by tcl_new_connection(), and ucos_iii_create().
int target_register_timer_callback | ( | int(*)(void *priv) | callback, |
unsigned int | time_ms, | ||
enum target_timer_type | type, | ||
void * | priv | ||
) |
The period is very approximate, the callback can happen much more often or much more rarely than specified.
Definition at line 1658 of file target.c.
References target_timer_callback::callback, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, MIN, NULL, priv, target_timer_callbacks, target_timer_next_event_value, target_timer_callback::time_ms, timeval_ms(), and type.
Referenced by aarch64_init_arch_info(), adapter_init_arch_info(), COMMAND_HANDLER(), cortex_a_init_arch_info(), cortex_m_init_arch_info(), esp32_apptrace_cmd_ctx_init(), esp32_cmd_apptrace_generic(), ipdbg_start_polling(), jsp_new_connection(), rtt_set_polling_interval(), rtt_start(), and target_init().
int target_register_trace_callback | ( | int(*)(struct target *target, size_t len, uint8_t *data, void *priv) | callback, |
void * | priv | ||
) |
Definition at line 1636 of file target.c.
References target_trace_callback::callback, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, target_trace_callback::list, list_add(), LOG_ERROR, priv, and target_trace_callback::priv.
Referenced by tcl_new_connection().
int target_remove_breakpoint | ( | struct target * | target, |
struct breakpoint * | breakpoint | ||
) |
Remove the breakpoint for target.
This routine is a wrapper for target->type->remove_breakpoint.
Definition at line 1323 of file target.c.
References target_type::remove_breakpoint, and target::type.
Referenced by breakpoint_free().
int target_remove_watchpoint | ( | struct target * | target, |
struct watchpoint * | watchpoint | ||
) |
Remove the watchpoint for target.
This routine is a wrapper for target->type->remove_watchpoint.
Definition at line 1338 of file target.c.
References target_type::remove_watchpoint, and target::type.
Referenced by watchpoint_free().
const char* target_reset_mode_name | ( | enum target_reset_mode | reset_mode | ) |
Return the name of a target reset reason enumeration value.
Definition at line 286 of file target.c.
References LOG_ERROR, nvp::name, nvp_reset_modes, and nvp_value2name().
Referenced by tcl_target_callback_reset_handler().
int target_resume | ( | struct target * | target, |
int | current, | ||
target_addr_t | address, | ||
int | handle_breakpoints, | ||
int | debug_execution | ||
) |
Make the target (re)start executing using its saved execution context (possibly with some modifications).
target | Which target should start executing. |
current | True to use the target's saved program counter instead of the address parameter |
address | Optionally used as the program counter. |
handle_breakpoints | True iff breakpoints at the resumption PC should be skipped. (For example, maybe execution was stopped by such a breakpoint, in which case it would be counterproductive to let it re-trigger. |
debug_execution | False if all working areas allocated by OpenOCD should be released and/or restored to their original contents. (This would for example be true to run some downloaded "helper" algorithm code, which resides in one such working buffer and uses another for data storage.) |
Definition at line 556 of file target.c.
References ERROR_FAIL, ERROR_OK, jtag_poll_mask(), jtag_poll_unmask(), LOG_ERROR, target_type::resume, target_call_event_callbacks(), TARGET_EVENT_RESUME_END, TARGET_EVENT_RESUME_START, target_was_examined(), and target::type.
Referenced by ambiqmicro_exec_command(), arc_assert_reset(), arm_semihosting_resume(), armv4_5_run_algorithm_inner(), armv7m_start_algorithm(), COMMAND_HANDLER(), cortex_m_profiling(), dsp563xx_run_algorithm(), esp32_apptrace_connect_targets(), esp32_apptrace_safe_halt_targets(), esp32_sysview_stop(), esp32s2_poll(), esp_xtensa_profiling(), esp_xtensa_smp_poll(), gdb_fileio_reply(), gdb_fileio_response_packet(), gdb_handle_vcont_packet(), gdb_step_continue_packet(), hl_deassert_reset(), mips32_run_and_wait(), or1k_profiling(), stm8_run_and_wait(), and target_profiling_default().
int target_run_algorithm | ( | struct target * | target, |
int | num_mem_params, | ||
struct mem_param * | mem_params, | ||
int | num_reg_params, | ||
struct reg_param * | reg_param, | ||
target_addr_t | entry_point, | ||
target_addr_t | exit_point, | ||
unsigned int | timeout_ms, | ||
void * | arch_info | ||
) |
Run an algorithm on the target given.
This routine is a wrapper for target->type->run_algorithm.
Run an algorithm on the target given.
target | used to run the algorithm |
num_mem_params | |
mem_params | |
num_reg_params | |
reg_param | |
entry_point | |
exit_point | |
timeout_ms | |
arch_info | target-specific description of the algorithm. |
Definition at line 773 of file target.c.
References target::arch_info, ERROR_FAIL, LOG_ERROR, target_type::run_algorithm, target::running_alg, target_type_name(), target_was_examined(), and target::type.
Referenced by aduc702x_write_block(), aducm360_write_block_sync(), arm_blank_check_memory(), arm_checksum_memory(), arm_nandread(), arm_nandwrite(), armv7m_blank_check_memory(), armv7m_checksum_memory(), cc3220sf_write(), cfi_intel_write_block(), cfi_spansion_write_block(), cfi_spansion_write_block_mips(), em357_write_block(), fespi_write(), fm3_chip_erase(), fm3_erase(), fm3_write_block(), fm4_flash_erase(), fm4_flash_write(), kinetis_disable_wdog_algo(), kinetis_ke_stop_watchdog(), lpc2000_iap_call(), lpc2900_write(), lpcspifi_erase(), lpcspifi_set_hw_mode(), mips32_blank_check_memory(), mips32_checksum_memory(), numicro_writeblock(), pic32mx_write_block(), psoc4_sysreq(), qspi_verify(), riscv_checksum_memory(), rp2040_call_rom_func(), rsl10_ll_flash_erase(), rsl10_ll_flash_write(), rsl10_mass_erase(), sh_qspi_read(), sh_qspi_write(), stm32lx_write_half_pages(), stm32x_write_block_riscv(), stm8_blank_check_memory(), stmqspi_blank_check(), str7x_write_block(), str9x_write_block(), xmc1xxx_erase(), xmc1xxx_erase_check(), and xmc1xxx_write().
int target_run_flash_async_algorithm | ( | struct target * | target, |
const uint8_t * | buffer, | ||
uint32_t | count, | ||
int | block_size, | ||
int | num_mem_params, | ||
struct mem_param * | mem_params, | ||
int | num_reg_params, | ||
struct reg_param * | reg_params, | ||
uint32_t | buffer_start, | ||
uint32_t | buffer_size, | ||
uint32_t | entry_point, | ||
uint32_t | exit_point, | ||
void * | arch_info | ||
) |
This routine is a wrapper for asynchronous algorithms.
This routine is a wrapper for asynchronous algorithms.
This is intended for applications where target-specific native code runs on the target, receives data from the circular buffer, does something with it (most likely writing it to a flash memory), and advances the circular buffer pointer.
This assumes that the helper algorithm has already been loaded to the target, but has not been started yet. Given memory and register parameters are passed to the algorithm.
The buffer is defined by (buffer_start, buffer_size) arguments and has the following format:
[buffer_start + 0, buffer_start + 4): Write Pointer address (aka head). Written and updated by this routine when new data is written to the circular buffer. [buffer_start + 4, buffer_start + 8): Read Pointer address (aka tail). Updated by code running on the target after it consumes data. [buffer_start + 8, buffer_start + buffer_size): Circular buffer contents.
See contrib/loaders/flash/stm32f1x.S for an example.
target | used to run the algorithm |
buffer | address on the host where data to be sent is located |
count | number of blocks to send |
block_size | size in bytes of each block |
num_mem_params | count of memory-based params to pass to algorithm |
mem_params | memory-based params to pass to algorithm |
num_reg_params | count of register-based params to pass to algorithm |
reg_params | memory-based params to pass to algorithm |
buffer_start | address on the target of the circular buffer structure |
buffer_size | size of the circular buffer structure |
entry_point | address on the target to execute to start the algorithm |
exit_point | address at which to set a breakpoint to catch the end of the algorithm; can be 0 if target triggers a breakpoint itself |
arch_info |
Definition at line 930 of file target.c.
References alive_sleep(), target::arch_info, buffer, count, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, IS_ALIGNED, IS_PWR_OF_2, keep_alive(), LOG_DEBUG, LOG_ERROR, target_read_u32(), target_start_algorithm(), target_wait_algorithm(), target_write_buffer(), and target_write_u32().
Referenced by aducm360_write_block_async(), bluenrgx_write(), efm32x_write_block(), kinetis_ke_write_words(), kinetis_write_block(), lpcspifi_write(), max32xxx_write_block(), mdr_write_block(), mrvlqspi_flash_write(), niietcm4_write_block(), nrf5_ll_flash_write(), qspi_read_write_block(), sim3x_write_block(), stellaris_write_block(), stm32l4_write_block(), stm32x_write_block(), and stm32x_write_block_async().
int target_run_read_async_algorithm | ( | struct target * | target, |
uint8_t * | buffer, | ||
uint32_t | count, | ||
int | block_size, | ||
int | num_mem_params, | ||
struct mem_param * | mem_params, | ||
int | num_reg_params, | ||
struct reg_param * | reg_params, | ||
uint32_t | buffer_start, | ||
uint32_t | buffer_size, | ||
uint32_t | entry_point, | ||
uint32_t | exit_point, | ||
void * | arch_info | ||
) |
This routine is a wrapper for asynchronous algorithms.
Definition at line 1083 of file target.c.
References alive_sleep(), target::arch_info, buffer, count, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_SERVER_INTERRUPTED, IS_ALIGNED, IS_PWR_OF_2, keep_alive(), LOG_DEBUG, LOG_ERROR, openocd_is_shutdown_pending(), target_read_buffer(), target_read_u32(), target_start_algorithm(), target_wait_algorithm(), and target_write_u32().
Referenced by qspi_read_write_block().
|
inlinestatic |
Sets the examined
flag for the given target.
Use in target->type->examine() after one-time setup is done.
Definition at line 443 of file target.h.
References target::examined.
Referenced by aarch64_examine_first(), arc_examine(), arm11_examine(), arm7_9_examine(), avr32_ap7k_examine(), COMMAND_HANDLER(), cortex_a_examine_first(), cortex_m_examine(), default_examine(), dsp563xx_examine(), esirisc_examine(), examine(), handle_target(), mem_ap_examine(), mips32_examine(), mips64_examine(), or1k_examine(), stm8_examine(), target_examine_one(), and xtensa_examine().
int target_start_algorithm | ( | struct target * | target, |
int | num_mem_params, | ||
struct mem_param * | mem_params, | ||
int | num_reg_params, | ||
struct reg_param * | reg_params, | ||
target_addr_t | entry_point, | ||
target_addr_t | exit_point, | ||
void * | arch_info | ||
) |
Starts an algorithm in the background on the target given.
This routine is a wrapper for target->type->start_algorithm.
Starts an algorithm in the background on the target given.
target | used to run the algorithm |
num_mem_params | |
mem_params | |
num_reg_params | |
reg_params | |
entry_point | |
exit_point | |
arch_info | target-specific description of the algorithm. |
Definition at line 814 of file target.c.
References target::arch_info, ERROR_FAIL, LOG_ERROR, target::running_alg, target_type::start_algorithm, target_type_name(), target_was_examined(), and target::type.
Referenced by cc26xx_init(), esp_algorithm_run_debug_stub(), esp_algorithm_run_image(), msp432_init(), npcx_init(), sromalgo_prepare(), target_run_flash_async_algorithm(), and target_run_read_async_algorithm().
const char* target_state_name | ( | const struct target * | target | ) |
Return the name of this targets current state.
Definition at line 260 of file target.c.
References target::defer_examine, LOG_ERROR, nvp::name, nvp_target_state, nvp_value2name(), target::state, and target_was_examined().
Referenced by adapter_debug_entry(), arc_arch_state(), arc_assert_reset(), arc_deassert_reset(), arc_halt(), arm11_halt(), arm11_resume(), arm11_step(), arm7_9_assert_reset(), arm7_9_deassert_reset(), arm7_9_halt(), avr32_ap7k_halt(), COMMAND_HANDLER(), cortex_m_assert_reset(), cortex_m_deassert_reset(), cortex_m_debug_entry(), cortex_m_halt_one(), dsp563xx_poll(), gdb_connection_closed(), gdb_new_connection(), mips_m4k_assert_reset(), mips_m4k_deassert_reset(), mips_m4k_debug_entry(), mips_m4k_halt(), mips_mips64_assert_reset(), mips_mips64_deassert_reset(), mips_mips64_debug_entry(), mips_mips64_halt(), or1k_halt(), stm8_debug_entry(), stm8_halt(), tcl_target_callback_event_handler(), xscale_assert_reset(), and xscale_halt().
int target_step | ( | struct target * | target, |
int | current, | ||
target_addr_t | address, | ||
int | handle_breakpoints | ||
) |
Step the target.
This routine is a wrapper for target->type->step.
Definition at line 1410 of file target.c.
References ERROR_OK, target_type::step, target_call_event_callbacks(), TARGET_EVENT_STEP_END, TARGET_EVENT_STEP_START, and target::type.
Referenced by COMMAND_HANDLER(), gdb_fileio_response_packet(), gdb_handle_vcont_packet(), and gdb_step_continue_packet().
bool target_supports_gdb_connection | ( | const struct target * | target | ) |
Check if target allows GDB connections.
Some target do not implement the necessary code required by GDB.
Definition at line 1401 of file target.c.
References target::gdb_max_connections, target_type::get_gdb_reg_list, and target::type.
Referenced by gdb_target_add_one().
int64_t target_timer_next_event | ( | void | ) |
Returns when the next registered event will take place.
Callers can use this to go to sleep until that time occurs.
Definition at line 1889 of file target.c.
References target_timer_next_event_value.
Referenced by server_loop().
const char* target_type_name | ( | const struct target * | target | ) |
Get the target type name.
This routine is a wrapper for the target->type->name field. Note that this is not an instance-specific name for his target.
Definition at line 736 of file target.c.
References target_type::name, and target::type.
Referenced by arm_default_mcr(), arm_default_mcrr(), arm_default_mrc(), arm_default_mrrc(), cfi_spansion_write_block(), chibios_create(), chibios_get_thread_reg_list(), chromium_ec_create(), COMMAND_HANDLER(), ecos_create(), embeddedice_build_reg_cache(), embkernel_create(), freertos_create(), mqx_create(), nuttx_create(), riot_create(), rtkernel_create(), stm32x_get_property_addr(), target_configure(), target_handle_event(), target_run_algorithm(), target_start_algorithm(), target_wait_algorithm(), threadx_create(), ucos_iii_create(), and zephyr_create().
int target_unregister_event_callback | ( | int(*)(struct target *target, enum target_event event, void *priv) | callback, |
void * | priv | ||
) |
Definition at line 1687 of file target.c.
References target_event_callback::callback, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, target_event_callback::next, priv, target_event_callback::priv, and target_event_callbacks.
Referenced by gdb_connection_closed(), and tcl_closed().
int target_unregister_reset_callback | ( | int(*)(struct target *target, enum target_reset_mode reset_mode, void *priv) | callback, |
void * | priv | ||
) |
Definition at line 1710 of file target.c.
References target_reset_callback::callback, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, target_reset_callback::list, list_del(), list_for_each_entry, priv, and target_reset_callback::priv.
Referenced by tcl_closed().
int target_unregister_timer_callback | ( | int(*)(void *priv) | callback, |
void * | priv | ||
) |
Definition at line 1748 of file target.c.
References target_trace_callback::callback, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, target_timer_callback::next, priv, and target_timer_callbacks.
Referenced by arm_tpiu_swo_cleanup_all(), COMMAND_HANDLER(), esp32_apptrace_cmd_stop(), esp32_apptrace_wait_tracing_finished(), ipdbg_stop_polling(), jsp_connection_closed(), read_channel_callback(), rtt_set_polling_interval(), rtt_stop(), and target_call_timer_callback().
int target_unregister_trace_callback | ( | int(*)(struct target *target, size_t len, uint8_t *data, void *priv) | callback, |
void * | priv | ||
) |
Definition at line 1729 of file target.c.
References target_trace_callback::callback, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, target_trace_callback::list, list_del(), list_for_each_entry, priv, and target_trace_callback::priv.
Referenced by tcl_closed().
int target_wait_algorithm | ( | struct target * | target, |
int | num_mem_params, | ||
struct mem_param * | mem_params, | ||
int | num_reg_params, | ||
struct reg_param * | reg_params, | ||
target_addr_t | exit_point, | ||
unsigned int | timeout_ms, | ||
void * | arch_info | ||
) |
Wait for an algorithm on the target given.
This routine is a wrapper for target->type->wait_algorithm.
Wait for an algorithm on the target given.
target | used to run the algorithm |
num_mem_params | |
mem_params | |
num_reg_params | |
reg_params | |
exit_point | |
timeout_ms | |
arch_info | target-specific description of the algorithm. |
Definition at line 858 of file target.c.
References target::arch_info, ERROR_FAIL, ERROR_TARGET_TIMEOUT, LOG_ERROR, target::running_alg, target_type_name(), target::type, and target_type::wait_algorithm.
Referenced by cc26xx_quit(), esp_algorithm_run_debug_stub(), esp_algorithm_run_image(), msp432_quit(), npcx_quit(), sromalgo_release(), target_run_flash_async_algorithm(), and target_run_read_async_algorithm().
int target_wait_state | ( | struct target * | target, |
enum target_state | state, | ||
unsigned int | ms | ||
) |
Definition at line 3214 of file target.c.
References ERROR_FAIL, ERROR_OK, ERROR_SERVER_INTERRUPTED, keep_alive(), LOG_DEBUG, LOG_ERROR, name, nvp_target_state, nvp_value2name(), openocd_is_shutdown_pending(), state, target::state, target_poll(), and timeval_ms().
Referenced by arm7_9_dcc_completion(), armv4_5_run_algorithm_completion(), armv7m_wait_algorithm(), COMMAND_HANDLER(), dsp563xx_run_algorithm(), esp32_apptrace_safe_halt_targets(), esp32_soc_reset(), esp32s2_soc_reset(), esp32s3_soc_reset(), feroceon_bulk_write_memory(), handle_reset_halt(), mips32_run_and_wait(), stm8_run_and_wait(), and xtensa_wait_algorithm().
|
inlinestatic |
true
if target_set_examined() has been called. Definition at line 436 of file target.h.
References target::examined.
Referenced by aarch64_assert_reset(), aarch64_deassert_reset(), aarch64_examine(), aarch64_halt_smp(), aarch64_handle_target_request(), aarch64_prep_restart_smp(), aarch64_prepare_halt_smp(), aarch64_resume(), aarch64_step_restart_smp(), arc_examine(), arc_read_instruction_u32(), arc_write_instruction_u32(), arm11_assert_reset(), arm11_examine(), arm7_9_assert_reset(), arm7_9_deinit(), arm7_9_examine(), arm7_9_handle_target_request(), avr32_ap7k_examine(), COMMAND_HANDLER(), cortex_a_deassert_reset(), cortex_a_deinit_target(), cortex_a_examine_first(), cortex_a_halt_smp(), cortex_a_handle_target_request(), cortex_a_restore_smp(), cortex_m_assert_reset(), cortex_m_deassert_reset(), cortex_m_examine(), cortex_m_halt_one(), cortex_m_handle_target_request(), cortex_m_restore_smp(), cortex_m_smp_halt_all(), cortex_m_smp_post_halt_poll(), dsp563xx_examine(), esirisc_deinit_target(), esirisc_examine(), esirisc_get_gdb_arch(), esp32_apptrace_cmd_ctx_init(), esp32_apptrace_safe_halt_targets(), esp32_cmd_apptrace_generic(), esp_xtensa_smp_deassert_reset(), esp_xtensa_smp_poll(), esp_xtensa_smp_resume_cores(), esp_xtensa_smp_run_func_image(), esp_xtensa_smp_run_onboard_func(), esp_xtensa_smp_update_halt_gdb(), esp_xtensa_smp_watchpoint_add(), esp_xtensa_target_deinit(), feroceon_assert_reset(), gdb_new_connection(), handle_target(), hl_assert_reset(), hl_handle_target_request(), hwthread_get_thread_reg(), hwthread_get_thread_reg_list(), hwthread_update_threads(), lakemont_reset_deassert(), mem_ap_examine(), mips32_examine(), mips64_examine(), mips_m4k_assert_reset(), mips_m4k_examine(), or1k_examine(), riscv_examine(), smp_reg_list_noread(), stm32l4_probe(), stm32x_get_property_addr(), stm32x_probe(), stm8_examine(), target_blank_check_memory(), target_checksum_memory(), target_get_gdb_reg_list(), target_halt(), target_poll(), target_read_buffer(), target_read_memory(), target_read_phys_memory(), target_read_u16(), target_read_u32(), target_read_u64(), target_read_u8(), target_resume(), target_run_algorithm(), target_soft_reset_halt(), target_start_algorithm(), target_state_name(), target_write_buffer(), target_write_memory(), target_write_phys_memory(), target_write_phys_u16(), target_write_phys_u32(), target_write_phys_u64(), target_write_phys_u8(), target_write_u16(), target_write_u32(), target_write_u64(), target_write_u8(), update_halt_gdb(), xscale_assert_reset(), xtensa_smpbreak_set(), and xtensa_target_deinit().
int target_write_buffer | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | size, | ||
const uint8_t * | buffer | ||
) |
Definition at line 2342 of file target.c.
References buffer, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, size, TARGET_ADDR_FMT, target_was_examined(), target::type, and target_type::write_buffer.
Referenced by aduc702x_write_block(), aducm360_write_block_async(), aducm360_write_block_sync(), ambiqmicro_write_block(), arc_unset_breakpoint(), arc_write_instruction_u32(), arm_nandwrite(), armv4_5_run_algorithm_inner(), armv7m_blank_check_memory(), armv7m_checksum_memory(), armv7m_start_algorithm(), bluenrgx_write(), cc26xx_erase(), cc26xx_init(), cc26xx_mass_erase(), cc26xx_write(), cc3220sf_write(), cfi_intel_write_block(), cfi_spansion_write_block(), cfi_spansion_write_block_mips(), COMMAND_HANDLER(), dsp563xx_run_algorithm(), efm32x_write_block(), em357_write_block(), eneispif_write(), esirisc_flash_fill_pb(), esp32_soc_reset(), esp32s3_soc_reset(), esp_algorithm_load_func_image(), esp_algorithm_load_onboard_func(), fespi_write(), fm3_chip_erase(), fm3_erase(), fm3_write_block(), fm4_flash_erase(), fm4_flash_write(), gdb_write_memory_binary_packet(), gdb_write_memory_packet(), hwthread_write_buffer(), imx31_write_page(), kinetis_disable_wdog_algo(), kinetis_ke_stop_watchdog(), kinetis_ke_write_words(), kinetis_write_block(), load_section_from_image(), lpc2000_write(), lpc2900_write(), lpcspifi_erase(), lpcspifi_set_hw_mode(), lpcspifi_write(), max32xxx_write(), max32xxx_write_block(), mdr_write_block(), mips32_blank_check_memory(), mips32_checksum_memory(), mips32_run_algorithm(), mrvlqspi_flash_write(), msp432_exec_cmd(), msp432_init(), msp432_write(), mxc_write_page(), niietcm4_write_block(), npcx_chip_erase(), npcx_erase(), npcx_init(), npcx_write(), nrf5_ll_flash_write(), numicro_writeblock(), pic32mx_write_block(), psoc4_sysreq(), psoc5lp_write(), psoc6_program_row(), qn908x_write(), qspi_read_write_block(), qspi_verify(), riscv_checksum_memory(), rp2040_flash_write(), rsl10_ll_flash_erase(), rsl10_ll_flash_write(), rsl10_mass_erase(), semihosting_common(), sh_qspi_upload_helper(), sh_qspi_write(), sim3x_write_block(), smi_write_buffer(), stellaris_write(), stellaris_write_block(), stm32l4_write_block(), stm32lx_write(), stm32lx_write_half_pages(), stm32x_write(), stm32x_write_block(), stm32x_write_block_async(), stm32x_write_block_riscv(), stm8_blank_check_memory(), stm8_run_algorithm(), stmqspi_blank_check(), str7x_write_block(), str9x_write_block(), target_run_flash_async_algorithm(), w600_write(), write_to_channel(), xmc1xxx_erase(), xmc1xxx_erase_check(), xmc1xxx_write(), xtensa_start_algorithm(), and xtensa_update_instruction().
int target_write_memory | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | size, | ||
uint32_t | count, | ||
const uint8_t * | buffer | ||
) |
Write count items of size bytes to the memory of target at the address given.
address must be aligned to size in target memory.
The endianness is the same in the host and target memory for this function.
This is not enforced via e.g. assert's today and e.g. the target_write_buffer fn breaks this assumption.
This routine is wrapper for target->type->write_memory.
Definition at line 1265 of file target.c.
References buffer, count, ERROR_FAIL, LOG_ERROR, size, target_name(), target_was_examined(), target::type, and target_type::write_memory.
Referenced by aarch64_set_breakpoint(), aarch64_unset_breakpoint(), arm7_9_unset_breakpoint(), arm_code_to_working_area(), at91sam7_write(), cfi_target_write_memory(), COMMAND_HANDLER(), cortex_a_set_breakpoint(), cortex_a_unset_breakpoint(), cortex_a_write_buffer(), cortex_m_set_breakpoint(), cortex_m_unset_breakpoint(), kinetis_ftfx_command(), kinetis_write_sections(), lpc2000_iap_working_area_init(), lpc2900_write(), lpc2900_write_index_page(), lpc3180_write_page(), lpc32xx_read_page_slc(), lpc32xx_write_page_mlc(), lpc32xx_write_page_slc(), mips_m4k_set_breakpoint(), mips_m4k_unset_breakpoint(), mips_mips16_unset_sdbbp(), mips_mips64_unset_sdbbp(), nrf5_ll_flash_write(), numicro_write(), rpc_hf_xfer(), sam3_page_write(), sam4_page_write(), sam4l_write_page(), samd_modify_user_row_masked(), samd_write(), same5_modify_user_row_masked(), same5_write(), samv_page_write(), semihosting_common(), semihosting_write_fields(), stm32l4_write_block_without_loader(), stm32x_write(), stm32x_write_block(), stm8_unset_breakpoint(), str7x_write(), str9x_write(), swm050_write(), target_jim_write_memory(), target_restore_working_area(), target_write_buffer_default(), target_write_u16(), target_write_u32(), target_write_u64(), target_write_u8(), write_by_given_size(), xmc1xxx_write(), and xscale_unset_breakpoint().
int target_write_phys_memory | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | size, | ||
uint32_t | count, | ||
const uint8_t * | buffer | ||
) |
Definition at line 1279 of file target.c.
References buffer, count, ERROR_FAIL, LOG_ERROR, size, target_name(), target_was_examined(), target::type, and target_type::write_phys_memory.
Referenced by COMMAND_HANDLER(), target_jim_write_memory(), target_write_phys_u16(), target_write_phys_u32(), target_write_phys_u64(), and target_write_phys_u8().
int target_write_phys_u16 | ( | struct target * | target, |
target_addr_t | address, | ||
uint16_t | value | ||
) |
Definition at line 2743 of file target.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_buffer_set_u16(), target_was_examined(), target_write_phys_memory(), and reg::value.
int target_write_phys_u32 | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | value | ||
) |
Definition at line 2722 of file target.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_buffer_set_u32(), target_was_examined(), target_write_phys_memory(), and reg::value.
Referenced by arm7a_l2x_flush_all_data(), armv7a_l2x_cache_clean_virt(), armv7a_l2x_cache_flush_virt(), and armv7a_l2x_cache_inval_virt().
int target_write_phys_u64 | ( | struct target * | target, |
target_addr_t | address, | ||
uint64_t | value | ||
) |
Definition at line 2701 of file target.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_buffer_set_u64(), target_was_examined(), target_write_phys_memory(), and reg::value.
int target_write_phys_u8 | ( | struct target * | target, |
target_addr_t | address, | ||
uint8_t | value | ||
) |
Definition at line 2764 of file target.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_was_examined(), target_write_phys_memory(), and reg::value.
int target_write_u16 | ( | struct target * | target, |
target_addr_t | address, | ||
uint16_t | value | ||
) |
Definition at line 2662 of file target.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_buffer_set_u16(), target_was_examined(), target_write_memory(), and reg::value.
Referenced by aduc702x_erase(), aduc702x_set_write_enable(), aduc702x_write_single(), arc_set_breakpoint(), arm7_9_set_breakpoint(), do_data_output(), em357_write(), em357_write_options(), imx31_address(), imx31_command(), imx31_write_page(), initialize_nf_controller(), mips_m4k_set_breakpoint(), mips_mips16_set_sdbbp(), mxc_address(), mxc_command(), mxc_read_page(), mxc_write_page(), s3c24xx_address(), s3c24xx_command(), samd_check_error(), same5_wait_and_check_error(), sh_qspi_cs_activate(), sh_qspi_init(), str9x_erase(), str9x_protect(), str9x_protect_check(), str9x_write(), tms470_write(), xmc1xxx_nvm_set_idle(), and xscale_set_breakpoint().
int target_write_u32 | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | value | ||
) |
Definition at line 2641 of file target.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_buffer_set_u32(), target_was_examined(), target_write_memory(), and reg::value.
Referenced by adapter_resume(), adapter_step(), aducm360_mass_erase(), aducm360_page_erase(), aducm360_set_write_enable(), aducm360_write_modified(), ambiqmicro_erase(), ambiqmicro_mass_erase(), ambiqmicro_otp_program(), ambiqmicro_write_block(), arm7_9_set_breakpoint(), arm_blank_check_memory(), arm_checksum_memory(), arm_simulate_step_core(), armv7m_trace_itm_config(), at91sam7_flash_command(), at91sam7_set_flash_mode(), at91sam9_disable(), at91sam9_ecc_init(), at91sam9_enable(), bluenrgx_erase(), bluenrgx_write_flash_reg(), call_sromapi(), cc3220sf_erase(), cc3220sf_mass_erase(), clrsetbits_u32(), COMMAND_HANDLER(), cortex_m_dwt_set_reg(), cortex_m_dwt_setup(), cortex_m_enable_fpb(), cortex_m_endreset_event(), cortex_m_examine(), cortex_m_set_breakpoint(), cortex_m_set_watchpoint(), cortex_m_unset_breakpoint(), cortex_m_unset_watchpoint(), davinci_write_block_data(), davinci_write_page_ecc1(), davinci_write_page_ecc4(), davinci_write_page_ecc4infix(), efc_start_command(), efm32x_write_reg_u32(), em357_erase(), em357_erase_options(), em357_mass_erase(), em357_probe(), em357_wait_status_busy(), em357_write(), em357_write_block(), em357_write_options(), eneispif_write_reg(), esirisc_flash_clear_status(), esirisc_flash_control(), esirisc_flash_disable_protect(), esirisc_flash_enable_protect(), esirisc_flash_erase(), esirisc_flash_fill_pb(), esirisc_flash_init(), esirisc_flash_mass_erase(), esirisc_flash_unlock(), esirisc_flash_write(), esp32_disable_wdts(), esp32_soc_reset(), esp32s2_disable_wdts(), esp32s2_set_peri_reg_mask(), esp32s2_soc_reset(), esp32s3_disable_wdts(), esp32s3_soc_reset(), fespi_write_reg(), find_sfdp_dummy(), fm3_chip_erase(), fm3_erase(), fm3_write_block(), fm4_disable_hw_watchdog(), fm4_enter_flash_cpu_programming_mode(), fm4_enter_flash_cpu_rom_mode(), imx31_init(), io_write_reg(), ioconfig_write_reg(), ipc_acquire(), kinetis_check_run_mode(), kinetis_invalidate_flash_cache(), kinetis_ke_prepare_flash(), lpc288x_load_timer(), lpc288x_set_flash_clk(), lpc2900_erase(), lpc2900_read_security_status(), lpc2900_run_bist128(), lpc2900_setup(), lpc2900_write(), lpc2900_write_index_page(), lpc3180_address(), lpc3180_command(), lpc3180_init(), lpc3180_read_page(), lpc3180_reset(), lpc3180_write_data(), lpc3180_write_page(), lpc32xx_address(), lpc32xx_command(), lpc32xx_init(), lpc32xx_read_page_mlc(), lpc32xx_read_page_slc(), lpc32xx_reset(), lpc32xx_start_slc_dma(), lpc32xx_write_data(), lpc32xx_write_page_mlc(), lpc32xx_write_page_slc(), max32xxx_erase(), max32xxx_flash_op_post(), max32xxx_flash_op_pre(), max32xxx_mass_erase(), max32xxx_protect(), max32xxx_write(), mdr_erase(), mdr_mass_erase(), mdr_read(), mdr_write(), mips32_configure_dbs(), mips32_configure_ibs(), mips32_enable_interrupts(), mips_m4k_examine_debug_reason(), mips_m4k_set_breakpoint(), mips_m4k_set_watchpoint(), mips_m4k_unset_breakpoint(), mips_m4k_unset_watchpoint(), mips_mips64_set_sdbbp(), mrvlqspi_fifo_flush(), mrvlqspi_set_addr(), mrvlqspi_set_conf(), mrvlqspi_set_din_cnt(), mrvlqspi_set_hdr_cnt(), mrvlqspi_set_instr(), mrvlqspi_set_ss_state(), mrvlqspi_start_transfer(), mrvlqspi_stop_transfer(), msp432_exec_cmd(), msp432_write(), mxc_init(), niietcm4_dump_uflash_page(), niietcm4_erase(), niietcm4_load_uflash_page(), niietcm4_mass_erase(), niietcm4_opstatus_check(), niietcm4_probe_k1921vk01t(), niietcm4_protect_check(), niietcm4_uflash_page_erase(), niietcm4_uopstatus_check(), niietcm4_write(), nrf51_protect_clenr0(), nrf5_erase_page(), nrf5_nvmc_write_u32(), nuc910_nand_address(), numicro_erase(), numicro_fmc_cmd(), numicro_init_isp(), numicro_reg_unlock(), numicro_write(), octospi_cmd(), pic32mx_erase(), pic32mx_nvm_exec(), pic32mx_write_word(), poll_busy(), psoc4_sysreq(), psoc5lp_eeprom_probe(), psoc5lp_write(), psoc6_erase_row(), psoc6_erase_sector(), psoc6_program_row(), qn908x_erase(), qn908x_init_flash(), qn908x_load_lock_stat(), qn908x_setup_erase(), qn908x_update_reg(), qn908x_write(), qspi_erase_sector(), qspi_write_enable(), read_flash_id(), read_from_channel(), read_sfdp_block(), read_status_reg(), rp2040_spi_read_flash_id(), rp2040_ssel_active(), rpc_hf_mode(), rpc_hf_xfer(), rsl10_protect(), s3c2410_init(), s3c2410_write_data(), s3c2412_init(), s3c2440_init(), s3c2443_init(), s3c24xx_reset(), s3c6400_init(), sam3_page_write(), sam4_set_wait(), sam4l_flash_command(), samd_erase_row(), samd_issue_nvmctrl_command(), samd_protect(), same5_erase_block(), same5_issue_nvmctrl_command(), same5_protect(), samv_efc_start_command(), set_mm_mode(), sh_qspi_xfer_common(), sim3x_erase_page(), sim3x_flash_erase(), sim3x_init(), sromalgo_prepare(), ssp_write_reg(), stellaris_erase(), stellaris_mass_erase(), stellaris_protect(), stellaris_set_flash_timing(), stellaris_write(), stm32l4_write_flash_reg(), stm32lx_enable_write_half_page(), stm32lx_erase_sector(), stm32lx_lock(), stm32lx_lock_program_memory(), stm32lx_mass_erase(), stm32lx_obl_launch(), stm32lx_unlock(), stm32lx_unlock_options_bytes(), stm32lx_unlock_program_memory(), stm32lx_wait_until_bsy_clear_timeout(), stm32x_erase(), stm32x_erase_options(), stm32x_mass_erase(), stm32x_unlock_option_reg(), stm32x_unlock_reg(), stm32x_wait_status_busy(), stm32x_write(), stm32x_write_block(), stm32x_write_flash_reg(), stm32x_write_options(), stmqspi_abort(), stmqspi_probe(), str7x_erase(), str7x_protect(), str7x_write(), swm050_erase(), swm050_mass_erase(), swm050_write(), target_run_flash_async_algorithm(), target_run_read_async_algorithm(), tms470_erase_check(), tms470_flash_initialize_internal_state_machine(), tms470_protect(), tms470_protect_check(), tms470_read_part_info(), tms470_try_flash_keys(), tms470_write(), w600_start_do(), wrap_write_u32(), write_to_channel(), xmc4xxx_clear_flash_status(), xmc4xxx_enter_page_mode(), xmc4xxx_write_command_sequence(), xmc4xxx_write_page(), and xscale_set_breakpoint().
int target_write_u64 | ( | struct target * | target, |
target_addr_t | address, | ||
uint64_t | value | ||
) |
Definition at line 2620 of file target.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_buffer_set_u64(), target_was_examined(), target_write_memory(), and reg::value.
Referenced by mips64_configure_d_break_unit(), mips64_configure_i_break_unit(), mips64_enable_interrupts(), mips_mips64_set_hwbp(), mips_mips64_set_watchpoint(), mips_mips64_unset_hwbp(), and mips_mips64_unset_watchpoint().
int target_write_u8 | ( | struct target * | target, |
target_addr_t | address, | ||
uint8_t | value | ||
) |
Definition at line 2683 of file target.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_was_examined(), target_write_memory(), and reg::value.
Referenced by aduc702x_erase(), aduc702x_write_single(), at91sam9_address(), at91sam9_command(), at91sam9_write_data(), COMMAND_HANDLER(), davinci_address(), davinci_command(), davinci_seek_column(), davinci_write_block_data(), davinci_write_data(), davinci_write_pagecmd(), davinci_writepage_tail(), kinetis_check_run_mode(), kinetis_disable_wdog(), kinetis_ftfx_clear_error(), kinetis_ftfx_command(), kinetis_invalidate_flash_cache(), kinetis_ke_ftmrx_command(), kinetis_ke_prepare_flash(), kinetis_write_block(), nuc910_nand_command(), nuc910_nand_write(), orion_nand_address(), orion_nand_command(), orion_nand_write(), psoc5lp_nvl_write(), psoc5lp_spc_enable_clock(), psoc5lp_spc_erase_sector(), psoc5lp_spc_get_temp(), psoc5lp_spc_load_byte(), psoc5lp_spc_load_row(), psoc5lp_spc_read_byte(), psoc5lp_spc_read_hidden_row(), psoc5lp_spc_read_volatile_byte(), psoc5lp_spc_write_opcode(), psoc5lp_spc_write_row(), psoc5lp_spc_write_user_nvl(), s3c24xx_write_data(), sh_qspi_cs_activate(), sh_qspi_cs_deactivate(), sh_qspi_init(), sh_qspi_xfer_common(), stm32x_otp_protect(), stm32x_write(), and stm8_set_breakpoint().
|
extern |
Definition at line 107 of file target.c.
Referenced by append_to_list_all_targets(), COMMAND_HANDLER(), delete_debug_msg_receiver(), find_debug_msg_receiver(), gdb_new_connection(), get_target(), handle_target(), target_examine(), target_init(), target_process_reset(), and target_quit().