OpenOCD
target/target.c File Reference
Include dependency graph for target/target.c:

Go to the source code of this file.

Data Structures

struct  FastLoad
 

Macros

#define DEFAULT_HALT_TIMEOUT   5000
 

Typedefs

typedef int(* target_write_fn) (struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
 
typedef unsigned char UNIT[2]
 

Enumerations

enum  target_cfg_param {
  TCFG_TYPE, TCFG_EVENT, TCFG_WORK_AREA_VIRT, TCFG_WORK_AREA_PHYS,
  TCFG_WORK_AREA_SIZE, TCFG_WORK_AREA_BACKUP, TCFG_ENDIAN, TCFG_COREID,
  TCFG_CHAIN_POSITION, TCFG_DBGBASE, TCFG_RTOS, TCFG_DEFER_EXAMINE,
  TCFG_GDB_PORT, TCFG_GDB_MAX_CONNECTIONS
}
 
enum  verify_mode { IMAGE_TEST = 0, IMAGE_VERIFY = 1, IMAGE_CHECKSUM_ONLY = 2 }
 

Functions

static void append_to_list_all_targets (struct target *target)
 
static void binprint (struct command_invocation *cmd, const char *text, const uint8_t *buf, int size)
 
 COMMAND_HANDLER (handle_target_init_command)
 
 COMMAND_HANDLER (handle_targets_command)
 
 COMMAND_HANDLER (handle_reg_command)
 
 COMMAND_HANDLER (handle_poll_command)
 
 COMMAND_HANDLER (handle_wait_halt_command)
 
 COMMAND_HANDLER (handle_halt_command)
 
 COMMAND_HANDLER (handle_soft_reset_halt_command)
 
 COMMAND_HANDLER (handle_reset_command)
 
 COMMAND_HANDLER (handle_resume_command)
 
 COMMAND_HANDLER (handle_step_command)
 
 COMMAND_HANDLER (handle_md_command)
 
 COMMAND_HANDLER (handle_mw_command)
 
 COMMAND_HANDLER (handle_load_image_command)
 
 COMMAND_HANDLER (handle_dump_image_command)
 
 COMMAND_HANDLER (handle_verify_image_checksum_command)
 
 COMMAND_HANDLER (handle_verify_image_command)
 
 COMMAND_HANDLER (handle_test_image_command)
 
 COMMAND_HANDLER (handle_bp_command)
 
 COMMAND_HANDLER (handle_rbp_command)
 
 COMMAND_HANDLER (handle_wp_command)
 
 COMMAND_HANDLER (handle_rwp_command)
 
 COMMAND_HANDLER (handle_virt2phys_command)
 Translate a virtual address to a physical address. More...
 
 COMMAND_HANDLER (handle_profile_command)
 
 COMMAND_HANDLER (handle_target_event_list)
 
 COMMAND_HANDLER (handle_fast_load_image_command)
 
 COMMAND_HANDLER (handle_fast_load_command)
 
 COMMAND_HANDLER (handle_target_reset_nag)
 
 COMMAND_HANDLER (handle_ps_command)
 
 COMMAND_HANDLER (handle_test_mem_access_command)
 
static COMMAND_HELPER (parse_load_image_command_CMD_ARGV, struct image *image, target_addr_t *min_address, target_addr_t *max_address)
 
static COMMAND_HELPER (handle_verify_image_command_internal, enum verify_mode verify)
 
const char * debug_reason_name (struct target *t)
 
static int default_check_reset (struct target *target)
 
static int default_examine (struct target *target)
 
static int find_target (struct command_invocation *cmd, const char *name)
 
static void free_fastload (void)
 
struct targetget_current_target (struct command_context *cmd_ctx)
 
struct targetget_current_target_or_null (struct command_context *cmd_ctx)
 
static int get_int_array_element (Jim_Interp *interp, const char *varname, int idx, uint32_t *val)
 
struct targetget_target (const char *id)
 
struct targetget_target_by_num (int num)
 
bool get_target_reset_nag (void)
 
static int handle_bp_command_list (struct command_invocation *cmd)
 
static int handle_bp_command_set (struct command_invocation *cmd, target_addr_t addr, uint32_t asid, uint32_t length, int hw)
 
static int handle_target (void *priv)
 
static int identity_virt2phys (struct target *target, target_addr_t virtual, target_addr_t *physical)
 
static int jim_array2mem (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_mem2array (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_array2mem (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_configure (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_create (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_current (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_current_state (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_examine (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_examine_deferred (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_halt (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_halt_gdb (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_invoke_event (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_mem2array (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_names (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_poll (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_reset (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_smp (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_tap_disabled (Jim_Interp *interp)
 
static int jim_target_types (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_wait_state (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jim_target_was_examined (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static int jtag_enable_callback (enum jtag_event event, void *priv)
 
static LIST_HEAD (target_reset_callback_list)
 
static LIST_HEAD (target_trace_callback_list)
 
static int new_int_array_element (Jim_Interp *interp, const char *varname, int idx, uint32_t val)
 
static int new_target_number (void)
 
static int no_mmu (struct target *target, int *enabled)
 
static void print_wa_layout (struct target *target)
 
static int sense_handler (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 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)
 
static int target_array2mem (Jim_Interp *interp, struct target *target, int argc, Jim_Obj *const *argv)
 
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)
 
static void target_buffer_set_u8 (struct target *target, uint8_t *buffer, uint8_t value)
 
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)
 
static int target_call_timer_callback (struct target_timer_callback *cb, struct timeval *now)
 
int target_call_timer_callbacks (void)
 
static int target_call_timer_callbacks_check_time (int checktime)
 
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)
 
static int target_configure (Jim_GetOptInfo *goi, struct target *target)
 
static int target_create (Jim_GetOptInfo *goi)
 
static void target_destroy (struct target *target)
 
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...
 
static int target_fill_mem (struct target *target, target_addr_t address, target_write_fn fn, unsigned data_size, uint64_t b, unsigned c)
 
void target_free_all_working_areas (struct target *target)
 
static void target_free_all_working_areas_restore (struct target *target, int restore)
 
int target_free_working_area (struct target *target, struct working_area *area)
 
static int target_free_working_area_restore (struct target *target, struct working_area *area, int restore)
 
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...
 
static int target_gdb_fileio_end_default (struct target *target, int retcode, int fileio_errno, bool ctrl_c)
 
const char * target_get_gdb_arch (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...
 
static int target_get_gdb_fileio_info_default (struct target *target, struct gdb_fileio_info *fileio_info)
 
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 *target, enum target_event e)
 
void target_handle_md_output (struct command_invocation *cmd, struct target *target, target_addr_t address, unsigned size, unsigned count, const uint8_t *buffer)
 
bool target_has_event_action (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 **hit_watchpoint)
 Find out the just hit watchpoint for target. More...
 
static int target_init (struct command_context *cmd_ctx)
 
static int target_init_one (struct command_context *cmd_ctx, struct target *target)
 
static int target_mem2array (Jim_Interp *interp, struct target *target, int argc, Jim_Obj *const *argv)
 
static void target_merge_working_areas (struct target *target)
 
int target_poll (struct target *target)
 
static int target_process_reset (struct command_invocation *cmd, enum target_reset_mode reset_mode)
 
static int target_profiling (struct target *target, uint32_t *samples, uint32_t max_num_samples, uint32_t *num_samples, uint32_t seconds)
 
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)
 
static int target_read_buffer_default (struct target *target, target_addr_t address, uint32_t count, 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)
 
static int target_register_user_commands (struct command_context *cmd_ctx)
 
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...
 
static void target_reset_examined (struct target *target)
 Reset the examined flag for the given 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...
 
static int target_restore_working_area (struct target *target, struct working_area *area)
 
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, uint32_t entry_point, uint32_t exit_point, int timeout_ms, void *arch_info)
 Downloads a target-specific native code algorithm to the target, and executes it. 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)
 Streams data to a circular buffer on target intended for consumption by code running asynchronously on target. 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 int target_soft_reset_halt (struct target *target)
 
static void target_split_working_area (struct working_area *area, uint32_t size)
 
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, uint32_t entry_point, uint32_t exit_point, void *arch_info)
 Executes a target-specific native code algorithm and leaves it running. More...
 
const char * target_state_name (struct target *t)
 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...
 
static const char * target_strerror_safe (int err)
 
bool target_supports_gdb_connection (struct target *target)
 Check if target allows GDB connections. More...
 
static int target_timer_callback_periodic_restart (struct target_timer_callback *cb, struct timeval *now)
 
const char * target_type_name (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, uint32_t exit_point, int timeout_ms, void *arch_info)
 Waits for an algorithm started with target_start_algorithm() to complete. More...
 
int target_wait_state (struct target *target, enum target_state state, int ms)
 
int target_write_buffer (struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer)
 
static int target_write_buffer_default (struct target *target, target_addr_t address, uint32_t count, 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)
 
static void write_gmon (uint32_t *samples, uint32_t sampleNum, const char *filename, bool with_range, uint32_t start_address, uint32_t end_address, struct target *target, uint32_t duration_ms)
 
static void writeData (FILE *f, const void *data, size_t len)
 
static void writeLong (FILE *f, int l, struct target *target)
 
static void writeString (FILE *f, char *s)
 

Variables

struct target_type aarch64_target
 
struct targetall_targets
 
struct target_type arcv2_target
 
struct target_type arm11_target
 Holds methods for ARM11xx targets. More...
 
struct target_type arm720t_target
 Holds methods for ARM720 targets. More...
 
struct target_type arm7tdmi_target
 Holds methods for ARM7TDMI targets. More...
 
struct target_type arm920t_target
 Holds methods for ARM920 targets. More...
 
struct target_type arm926ejs_target
 Holds methods for ARM926 targets. More...
 
struct target_type arm946e_target
 Holds methods for ARM946 targets. More...
 
struct target_type arm966e_target
 Holds methods for ARM966 targets. More...
 
struct target_type arm9tdmi_target
 Holds methods for ARM9TDMI targets. More...
 
struct target_type avr32_ap7k_target
 
struct target_type avr_target
 
struct target_type cortexa_target
 
struct target_type cortexm_target
 
struct target_type cortexr4_target
 
struct target_type dragonite_target
 
struct target_type dsp563xx_target
 Holds methods for DSP563XX targets. More...
 
struct target_type dsp5680xx_target
 Holds methods for dsp5680xx targets. More...
 
struct target_type esirisc_target
 
struct target_type fa526_target
 Holds methods for FA526 targets. More...
 
static struct FastLoadfastload
 
static int fastload_num
 
struct target_type feroceon_target
 
struct target_type hla_target
 
struct target_type ls1_sap_target
 
struct target_type mem_ap_target
 
struct target_type mips_m4k_target
 
struct target_type mips_mips64_target
 
struct target_type nds32_v2_target
 Holds methods for V2 targets. More...
 
struct target_type nds32_v3_target
 Holds methods for Andes1337 targets. More...
 
struct target_type nds32_v3m_target
 Holds methods for NDS32 V3m targets. More...
 
static const Jim_Nvp nvp_assert []
 
static Jim_Nvp nvp_config_opts []
 
static const Jim_Nvp nvp_error_target []
 
static const Jim_Nvp nvp_reset_modes []
 
static const Jim_Nvp nvp_target_debug_reason []
 
static const Jim_Nvp nvp_target_endian []
 
static const Jim_Nvp nvp_target_event []
 
static const Jim_Nvp nvp_target_state []
 
struct target_type or1k_target
 
static const int polling_interval = 100
 
static int powerDropout
 
struct target_type quark_d20xx_target
 
struct target_type quark_x10xx_target
 
struct target_type riscv_target
 
static int runPowerDropout
 
static int runPowerRestore
 
static int runSrstAsserted
 
static int runSrstDeasserted
 
static int srstAsserted
 
struct target_type stm8_target
 
static const struct command_registration target_command_handlers []
 
static struct target_event_callbacktarget_event_callbacks
 
static const struct command_registration target_exec_command_handlers []
 
static const struct command_registration target_instance_command_handlers []
 
static bool target_reset_nag = true
 
static const struct command_registration target_subcommand_handlers []
 
static struct target_timer_callbacktarget_timer_callbacks
 
static struct target_typetarget_types []
 
struct target_type testee_target
 
struct target_type xscale_target
 

Macro Definition Documentation

◆ DEFAULT_HALT_TIMEOUT

#define DEFAULT_HALT_TIMEOUT   5000

Definition at line 60 of file target/target.c.

Referenced by COMMAND_HANDLER(), and target_poll().

Typedef Documentation

◆ target_write_fn

typedef int(* target_write_fn) (struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)

Definition at line 3445 of file target/target.c.

◆ UNIT

typedef unsigned char UNIT[2]

Definition at line 4141 of file target/target.c.

Enumeration Type Documentation

◆ target_cfg_param

Enumerator
TCFG_TYPE 
TCFG_EVENT 
TCFG_WORK_AREA_VIRT 
TCFG_WORK_AREA_PHYS 
TCFG_WORK_AREA_SIZE 
TCFG_WORK_AREA_BACKUP 
TCFG_ENDIAN 
TCFG_COREID 
TCFG_CHAIN_POSITION 
TCFG_DBGBASE 
TCFG_RTOS 
TCFG_DEFER_EXAMINE 
TCFG_GDB_PORT 
TCFG_GDB_MAX_CONNECTIONS 

Definition at line 4795 of file target/target.c.

◆ verify_mode

Enumerator
IMAGE_TEST 
IMAGE_VERIFY 
IMAGE_CHECKSUM_ONLY 

Definition at line 3729 of file target/target.c.

Function Documentation

◆ append_to_list_all_targets()

static void append_to_list_all_targets ( struct target target)
static

Definition at line 345 of file target/target.c.

References all_targets, and target.

Referenced by target_create().

◆ binprint()

static void binprint ( struct command_invocation cmd,
const char *  text,
const uint8_t *  buf,
int  size 
)
static

Definition at line 6211 of file target/target.c.

References command_print(), command_print_sameline(), NULL, and size.

Referenced by COMMAND_HANDLER().

◆ COMMAND_HANDLER() [1/29]

COMMAND_HANDLER ( handle_target_init_command  )

◆ COMMAND_HANDLER() [2/29]

◆ COMMAND_HANDLER() [3/29]

◆ COMMAND_HANDLER() [4/29]

◆ COMMAND_HANDLER() [5/29]

COMMAND_HANDLER ( handle_wait_halt_command  )

◆ COMMAND_HANDLER() [6/29]

COMMAND_HANDLER ( handle_halt_command  )

◆ COMMAND_HANDLER() [7/29]

COMMAND_HANDLER ( handle_soft_reset_halt_command  )

◆ COMMAND_HANDLER() [8/29]

COMMAND_HANDLER ( handle_reset_command  )

◆ COMMAND_HANDLER() [9/29]

COMMAND_HANDLER ( handle_resume_command  )

◆ COMMAND_HANDLER() [10/29]

COMMAND_HANDLER ( handle_step_command  )

◆ COMMAND_HANDLER() [11/29]

◆ COMMAND_HANDLER() [12/29]

◆ COMMAND_HANDLER() [13/29]

◆ COMMAND_HANDLER() [14/29]

◆ COMMAND_HANDLER() [15/29]

COMMAND_HANDLER ( handle_verify_image_checksum_command  )

Definition at line 3868 of file target/target.c.

References CALL_COMMAND_HANDLER, and IMAGE_CHECKSUM_ONLY.

◆ COMMAND_HANDLER() [16/29]

COMMAND_HANDLER ( handle_verify_image_command  )

Definition at line 3873 of file target/target.c.

References CALL_COMMAND_HANDLER, and IMAGE_VERIFY.

◆ COMMAND_HANDLER() [17/29]

COMMAND_HANDLER ( handle_test_image_command  )

Definition at line 3878 of file target/target.c.

References CALL_COMMAND_HANDLER, and IMAGE_TEST.

◆ COMMAND_HANDLER() [18/29]

◆ COMMAND_HANDLER() [19/29]

◆ COMMAND_HANDLER() [20/29]

◆ COMMAND_HANDLER() [21/29]

COMMAND_HANDLER ( handle_rwp_command  )

◆ COMMAND_HANDLER() [22/29]

COMMAND_HANDLER ( handle_virt2phys_command  )

Translate a virtual address to a physical address.

The low-level target implementation must have logged a detailed error which is forwarded to telnet/GDB session.

Definition at line 4104 of file target/target.c.

References CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_ADDRESS, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, get_current_target(), TARGET_ADDR_FMT, target::type, and target_type::virt2phys.

◆ COMMAND_HANDLER() [23/29]

COMMAND_HANDLER ( handle_profile_command  )

Some cores let us sample the PC without the annoying halt/resume step; for example, ARMv7 PCSR. Provide a way to use that more efficient mechanism.

Definition at line 4243 of file target/target.c.

References CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, get_current_target(), LOG_ERROR, NULL, offset, target::state, target_halt(), TARGET_HALTED, target_poll(), target_profiling(), target_resume(), TARGET_RUNNING, timeval_ms(), and write_gmon().

◆ COMMAND_HANDLER() [24/29]

◆ COMMAND_HANDLER() [25/29]

◆ COMMAND_HANDLER() [26/29]

◆ COMMAND_HANDLER() [27/29]

COMMAND_HANDLER ( handle_target_reset_nag  )

Definition at line 6183 of file target/target.c.

References CALL_COMMAND_HANDLER.

◆ COMMAND_HANDLER() [28/29]

◆ COMMAND_HANDLER() [29/29]

◆ COMMAND_HELPER() [1/2]

static COMMAND_HELPER ( parse_load_image_command_CMD_ARGV  ,
struct image image,
target_addr_t min_address,
target_addr_t max_address 
)
static

◆ COMMAND_HELPER() [2/2]

◆ debug_reason_name()

◆ default_check_reset()

static int default_check_reset ( struct target target)
static

Definition at line 714 of file target/target.c.

References ERROR_OK.

Referenced by target_init_one().

◆ default_examine()

static int default_examine ( struct target target)
static

Definition at line 707 of file target/target.c.

References ERROR_OK, and target_set_examined().

Referenced by target_init_one().

◆ find_target()

◆ free_fastload()

static void free_fastload ( void  )
static

Definition at line 6011 of file target/target.c.

References FastLoad::data, fastload_num, and NULL.

Referenced by COMMAND_HANDLER().

◆ get_current_target()

◆ get_current_target_or_null()

struct target* get_current_target_or_null ( struct command_context cmd_ctx)

◆ get_int_array_element()

static int get_int_array_element ( Jim_Interp *  interp,
const char *  varname,
int  idx,
uint32_t *  val 
)
static

Definition at line 4526 of file target/target.c.

References alloc_printf(), and NULL.

Referenced by target_array2mem().

◆ get_target()

◆ get_target_by_num()

struct target* get_target_by_num ( int  num)

Definition at line 512 of file target/target.c.

References all_targets, target::next, NULL, target, and target::target_number.

◆ get_target_reset_nag()

bool get_target_reset_nag ( void  )

Definition at line 6178 of file target/target.c.

References target_reset_nag.

Referenced by arm7_9_check_reset().

◆ handle_bp_command_list()

◆ handle_bp_command_set()

◆ handle_target()

◆ identity_virt2phys()

static int identity_virt2phys ( struct target target,
target_addr_t  virtual,
target_addr_t physical 
)
static

Definition at line 694 of file target/target.c.

References ERROR_OK.

Referenced by target_init_one().

◆ jim_array2mem()

static int jim_array2mem ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

◆ jim_mem2array()

static int jim_mem2array ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

◆ jim_target_array2mem()

static int jim_target_array2mem ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

Definition at line 5183 of file target/target.c.

References target_array2mem().

◆ jim_target_configure()

static int jim_target_configure ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

◆ jim_target_create()

static int jim_target_create ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

◆ jim_target_current()

static int jim_target_current ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

◆ jim_target_current_state()

static int jim_target_current_state ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

Definition at line 5408 of file target/target.c.

References target_state_name().

◆ jim_target_examine()

static int jim_target_examine ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

◆ jim_target_examine_deferred()

static int jim_target_examine_deferred ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

Definition at line 5242 of file target/target.c.

References target::defer_examine.

◆ jim_target_halt()

static int jim_target_halt ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

◆ jim_target_halt_gdb()

static int jim_target_halt_gdb ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

Definition at line 5250 of file target/target.c.

References ERROR_OK, target_call_event_callbacks(), and TARGET_EVENT_GDB_HALT.

◆ jim_target_invoke_event()

static int jim_target_invoke_event ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

◆ jim_target_mem2array()

static int jim_target_mem2array ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

Definition at line 5176 of file target/target.c.

References target_mem2array().

◆ jim_target_names()

static int jim_target_names ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

Definition at line 5876 of file target/target.c.

References all_targets, target::next, NULL, and target_name().

◆ jim_target_poll()

static int jim_target_poll ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

◆ jim_target_reset()

◆ jim_target_smp()

static int jim_target_smp ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

◆ jim_target_tap_disabled()

static int jim_target_tap_disabled ( Jim_Interp *  interp)
static

◆ jim_target_types()

static int jim_target_types ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

Definition at line 5862 of file target/target.c.

References name, and NULL.

◆ jim_target_wait_state()

◆ jim_target_was_examined()

static int jim_target_was_examined ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

Definition at line 5234 of file target/target.c.

References target_was_examined().

◆ jtag_enable_callback()

static int jtag_enable_callback ( enum jtag_event  event,
void *  priv 
)
static

◆ LIST_HEAD() [1/2]

static LIST_HEAD ( target_reset_callback_list  )
static

◆ LIST_HEAD() [2/2]

static LIST_HEAD ( target_trace_callback_list  )
static

◆ new_int_array_element()

static int new_int_array_element ( Jim_Interp *  interp,
const char *  varname,
int  idx,
uint32_t  val 
)
static

Definition at line 4327 of file target/target.c.

References alloc_printf().

Referenced by target_mem2array().

◆ new_target_number()

static int new_target_number ( void  )
static

Definition at line 329 of file target/target.c.

References all_targets, target::next, and target::target_number.

Referenced by target_create().

◆ no_mmu()

static int no_mmu ( struct target target,
int *  enabled 
)
static

Definition at line 701 of file target/target.c.

References ERROR_OK.

Referenced by target_init_one().

◆ print_wa_layout()

◆ sense_handler()

static int sense_handler ( void  )
static

◆ target_add_breakpoint()

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 1311 of file target/target.c.

References target_type::add_breakpoint, BKPT_HARD, ERROR_TARGET_NOT_HALTED, LOG_WARNING, target::state, TARGET_HALTED, target_name(), breakpoint::type, and target::type.

Referenced by breakpoint_add_internal(), nds32_v3_leave_debug_state(), and target_set_examined().

◆ target_add_context_breakpoint()

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 1321 of file target/target.c.

References target_type::add_context_breakpoint, ERROR_TARGET_NOT_HALTED, LOG_WARNING, target::state, TARGET_HALTED, target_name(), and target::type.

Referenced by context_breakpoint_add_internal(), and target_set_examined().

◆ target_add_hybrid_breakpoint()

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 1331 of file target/target.c.

References target_type::add_hybrid_breakpoint, ERROR_TARGET_NOT_HALTED, LOG_WARNING, target::state, TARGET_HALTED, target_name(), and target::type.

Referenced by hybrid_breakpoint_add_internal(), and target_set_examined().

◆ target_add_watchpoint()

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 1347 of file target/target.c.

References target_type::add_watchpoint, ERROR_TARGET_NOT_HALTED, LOG_WARNING, target::state, TARGET_HALTED, target_name(), and target::type.

Referenced by target_set_examined(), and watchpoint_add().

◆ target_address_bits()

unsigned 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 1471 of file target/target.c.

References target_type::address_bits, and target::type.

Referenced by target_address_max(), and target_set_examined().

◆ target_address_max()

target_addr_t target_address_max ( struct target target)

Return the highest accessible address for this target.

Definition at line 1462 of file target/target.c.

References bits, and target_address_bits().

Referenced by gdb_memory_map(), and target_set_examined().

◆ target_alloc_working_area()

int target_alloc_working_area ( struct target target,
uint32_t  size,
struct working_area **  area 
)

Definition at line 2070 of file target/target.c.

References ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_WARNING, 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(), 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_write_memory(), mips_mips64_bulk_write_memory(), mrvlqspi_flash_write(), msp432_init(), niietcm4_write_block(), nrf5_ll_flash_write(), numicro_writeblock(), pic32mx_write_block(), psoc4_sysreq(), psoc5lp_write(), psoc6_erase(), psoc6_program_row(), scratch_reserve(), sh_qspi_upload_helper(), sim3x_write_block(), sromalgo_prepare(), stellaris_write_block(), stm32l4_write_block(), stm32lx_write_half_pages(), stm32x_write_block(), stm8_blank_check_memory(), str9x_write_block(), target_set_examined(), xmc1xxx_erase(), xmc1xxx_erase_check(), and xmc1xxx_write().

◆ target_alloc_working_area_try()

◆ target_arch_state()

int target_arch_state ( struct target target)

◆ target_array2mem()

static int target_array2mem ( Jim_Interp *  interp,
struct target target,
int  argc,
Jim_Obj *const *  argv 
)
static

◆ target_blank_check_memory()

int target_blank_check_memory ( struct target target,
struct target_memory_check_block blocks,
int  num_blocks,
uint8_t  erased_value 
)

◆ target_buffer_get_u16()

◆ target_buffer_get_u16_array()

void target_buffer_get_u16_array ( struct target target,
const uint8_t *  buffer,
uint32_t  count,
uint16_t *  dstbuf 
)

◆ target_buffer_get_u24()

uint32_t target_buffer_get_u24 ( struct target target,
const uint8_t *  buffer 
)

Definition at line 373 of file target/target.c.

References be_to_h_u24(), target::endianness, le_to_h_u24(), and TARGET_LITTLE_ENDIAN.

Referenced by target_set_examined().

◆ target_buffer_get_u32()

◆ target_buffer_get_u32_array()

void target_buffer_get_u32_array ( struct target target,
const uint8_t *  buffer,
uint32_t  count,
uint32_t *  dstbuf 
)

◆ target_buffer_get_u64()

◆ target_buffer_get_u64_array()

void target_buffer_get_u64_array ( struct target target,
const uint8_t *  buffer,
uint32_t  count,
uint64_t *  dstbuf 
)

◆ target_buffer_set_u16()

◆ target_buffer_set_u16_array()

void target_buffer_set_u16_array ( struct target target,
uint8_t *  buffer,
uint32_t  count,
const uint16_t *  srcbuf 
)

◆ target_buffer_set_u24()

void target_buffer_set_u24 ( struct target target,
uint8_t *  buffer,
uint32_t  value 
)

Definition at line 409 of file target/target.c.

References target::endianness, h_u24_to_be(), h_u24_to_le(), and TARGET_LITTLE_ENDIAN.

Referenced by target_set_examined().

◆ target_buffer_set_u32()

◆ target_buffer_set_u32_array()

◆ target_buffer_set_u64()

void target_buffer_set_u64 ( struct target target,
uint8_t *  buffer,
uint64_t  value 
)

◆ target_buffer_set_u64_array()

void target_buffer_set_u64_array ( struct target target,
uint8_t *  buffer,
uint32_t  count,
const uint64_t *  srcbuf 
)

Definition at line 457 of file target/target.c.

References count, and target_buffer_set_u64().

Referenced by mips_mips64_read_memory(), and target_set_examined().

◆ target_buffer_set_u8()

static void target_buffer_set_u8 ( struct target target,
uint8_t *  buffer,
uint8_t  value 
)
static

Definition at line 427 of file target/target.c.

Referenced by target_fill_mem().

◆ target_call_event_callbacks()

int target_call_event_callbacks ( struct target target,
enum target_event  event 
)

Definition at line 1784 of file target/target.c.

References target_event_callback::callback, ERROR_OK, Jim_Nvp_value2name_simple(), LOG_DEBUG, name, target_event_callback::next, target_event_callback::priv, target_call_event_callbacks(), target_event_callbacks, TARGET_EVENT_GDB_HALT, TARGET_EVENT_HALTED, 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_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(), armv7m_trace_tpiu_config(), avr32_ap7k_poll(), avr32_ap7k_resume(), cortex_a_poll(), cortex_a_resume(), cortex_m_poll(), cortex_m_resume(), cortex_m_step(), do_resume(), dsp563xx_poll(), dsp563xx_resume(), dsp563xx_step(), esirisc_poll(), esirisc_resume_or_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(), jim_target_halt_gdb(), lakemont_poll(), lakemont_step(), lakemont_update_after_probemode_entry(), mips_m4k_internal_restore(), mips_m4k_poll(), mips_m4k_resume(), mips_m4k_step(), mips_mips64_poll(), mips_mips64_resume(), mips_mips64_step(), nds32_halt(), nds32_poll(), nds32_resume(), nds32_step(), or1k_poll(), or1k_resume_or_step(), resume_finish(), riscv_openocd_poll(), riscv_openocd_step(), semihosting_common(), stm8_poll(), stm8_resume(), stm8_step(), target_call_event_callbacks(), target_examine_one(), target_poll(), target_resume(), target_step(), xscale_poll(), xscale_resume(), xscale_step(), and xscale_step_inner().

◆ target_call_reset_callbacks()

int target_call_reset_callbacks ( struct target target,
enum target_reset_mode  reset_mode 
)

◆ target_call_timer_callback()

◆ target_call_timer_callbacks()

int target_call_timer_callbacks ( void  )

Definition at line 1892 of file target/target.c.

References target_call_timer_callbacks_check_time().

Referenced by server_loop().

◆ target_call_timer_callbacks_check_time()

◆ target_call_timer_callbacks_now()

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 1898 of file target/target.c.

References target_call_timer_callbacks_check_time().

Referenced by COMMAND_HANDLER(), gdb_query_packet(), script_command_run(), and target_process_reset().

◆ target_call_trace_callbacks()

int target_call_trace_callbacks ( struct target target,
size_t  len,
uint8_t *  data 
)

◆ target_checksum_memory()

◆ target_configure()

static int target_configure ( Jim_GetOptInfo goi,
struct target target 
)
static

◆ target_create()

static int target_create ( Jim_GetOptInfo goi)
static

◆ target_destroy()

◆ target_event_name()

const char* target_event_name ( enum target_event  event)

Return the name of a target event enumeration value.

Definition at line 306 of file target/target.c.

References Jim_Nvp_value2name_simple(), LOG_ERROR, and Jim_Nvp::name.

Referenced by target_set_examined(), and tcl_target_callback_event_handler().

◆ target_examine()

◆ target_examine_one()

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 721 of file target/target.c.

References ERROR_OK, target_type::examine, target_call_event_callbacks(), TARGET_EVENT_EXAMINE_END, TARGET_EVENT_EXAMINE_FAIL, TARGET_EVENT_EXAMINE_START, and target::type.

Referenced by arm7_9_deassert_reset(), COMMAND_HANDLER(), handle_target(), jtag_enable_callback(), and target_examine().

◆ target_fill_mem()

static int target_fill_mem ( struct target target,
target_addr_t  address,
target_write_fn  fn,
unsigned  data_size,
uint64_t  b,
unsigned  c 
)
static

◆ target_free_all_working_areas()

◆ target_free_all_working_areas_restore()

static void target_free_all_working_areas_restore ( struct target target,
int  restore 
)
static

◆ target_free_working_area()

int target_free_working_area ( struct target target,
struct working_area area 
)

Definition at line 2129 of file target/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(), 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(), nrf5_ll_flash_write(), numicro_writeblock(), pic32mx_write_block(), psoc4_sysreq(), psoc5lp_write(), psoc6_erase(), psoc6_program_row(), qspi_read_write_block(), qspi_verify(), 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(), stm8_blank_check_memory(), stmqspi_blank_check(), str7x_write_block(), str9x_write_block(), target_set_examined(), xmc1xxx_erase(), xmc1xxx_erase_check(), and xmc1xxx_write().

◆ target_free_working_area_restore()

static int target_free_working_area_restore ( struct target target,
struct working_area area,
int  restore 
)
static

◆ target_gdb_fileio_end()

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 1453 of file target/target.c.

References target::cmd_name, ERROR_TARGET_NOT_HALTED, target_type::gdb_fileio_end, LOG_WARNING, target::state, TARGET_HALTED, and target::type.

Referenced by gdb_fileio_response_packet(), and target_set_examined().

◆ target_gdb_fileio_end_default()

static int target_gdb_fileio_end_default ( struct target target,
int  retcode,
int  fileio_errno,
bool  ctrl_c 
)
static

Definition at line 2288 of file target/target.c.

References ERROR_OK.

Referenced by target_init_one().

◆ target_get_gdb_arch()

const char* target_get_gdb_arch ( struct target target)

Obtain the architecture for GDB.

This routine is a wrapper for target->type->get_gdb_arch.

Definition at line 1379 of file target/target.c.

References target_type::get_gdb_arch, NULL, and target::type.

Referenced by gdb_generate_target_description(), gdb_target_description_supported(), and target_set_examined().

◆ target_get_gdb_fileio_info()

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 1444 of file target/target.c.

References target::cmd_name, ERROR_TARGET_NOT_HALTED, target_type::get_gdb_fileio_info, LOG_WARNING, target::state, TARGET_HALTED, and target::type.

Referenced by gdb_frontend_halted(), and target_set_examined().

◆ target_get_gdb_fileio_info_default()

static int target_get_gdb_fileio_info_default ( struct target target,
struct gdb_fileio_info fileio_info 
)
static

Definition at line 2278 of file target/target.c.

References ERROR_FAIL.

Referenced by target_init_one().

◆ target_get_gdb_reg_list()

int target_get_gdb_reg_list ( struct target target,
struct reg **  reg_list[],
int *  reg_list_size,
enum target_register_class  reg_class 
)

◆ 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 1408 of file target/target.c.

References ERROR_OK, target_type::get_gdb_reg_list_noread, target_get_gdb_reg_list(), and target::type.

Referenced by gdb_generate_target_description(), gdb_get_register_packet(), gdb_set_register_packet(), gdb_target_description_supported(), and target_set_examined().

◆ target_get_working_area_avail()

◆ target_halt()

◆ target_handle_event()

◆ target_handle_md_output()

void target_handle_md_output ( struct command_invocation cmd,
struct target target,
target_addr_t  address,
unsigned  size,
unsigned  count,
const uint8_t *  buffer 
)

◆ target_has_event_action()

bool target_has_event_action ( struct target target,
enum target_event  event 
)

◆ target_hit_watchpoint()

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 1361 of file target/target.c.

References target::cmd_name, ERROR_FAIL, ERROR_TARGET_NOT_HALTED, target_type::hit_watchpoint, LOG_WARNING, NULL, target::state, TARGET_HALTED, and target::type.

Referenced by target_set_examined(), and watchpoint_hit().

◆ target_init()

◆ target_init_one()

◆ target_mem2array()

static int target_mem2array ( Jim_Interp *  interp,
struct target target,
int  argc,
Jim_Obj *const *  argv 
)
static

◆ target_merge_working_areas()

static void target_merge_working_areas ( struct target target)
static

◆ target_poll()

◆ target_process_reset()

◆ target_profiling()

static int target_profiling ( struct target target,
uint32_t *  samples,
uint32_t  max_num_samples,
uint32_t *  num_samples,
uint32_t  seconds 
)
static

Definition at line 1478 of file target/target.c.

References target_type::profiling, and target::type.

Referenced by COMMAND_HANDLER().

◆ target_profiling_default()

int target_profiling_default ( struct target target,
uint32_t *  samples,
uint32_t  max_num_samples,
uint32_t *  num_samples,
uint32_t  seconds 
)

◆ target_quit()

void target_quit ( void  )

Free all the resources allocated by targets and the target layer.

Definition at line 2234 of file target/target.c.

References 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(), and target_set_examined().

◆ target_read_buffer()

int target_read_buffer ( struct target target,
target_addr_t  address,
uint32_t  size,
uint8_t *  buffer 
)

Definition at line 2408 of file target/target.c.

References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, target_type::read_buffer, TARGET_ADDR_FMT, target_was_examined(), and target::type.

Referenced by arc_read_instruction_u32(), arc_set_breakpoint(), arm_access_size(), 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(), embKernel_get_tasks_details(), embKernel_get_thread_reg_list(), embKernel_update_threads(), FreeRTOS_get_symbol_list_to_lookup(), FreeRTOS_update_threads(), gdb_read_memory_packet(), get_stacking_info_arm926ejs(), image_read_section(), imx31_read_page(), jim_nds32_bulk_read(), mips32_run_algorithm(), mqx_target_read_buffer(), mxc_read_page(), nds32_read_opcode(), nuttx_update_threads(), read_channel_name(), read_from_channel(), read_rtt_channel(), riot_update_threads(), riscv_hit_watchpoint(), 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(), target_set_examined(), ThreadX_detect_rtos(), ThreadX_get_thread_reg_list(), ThreadX_update_threads(), tms470_erase_check(), and uCOS_III_update_threads().

◆ target_read_buffer_default()

static int target_read_buffer_default ( struct target target,
target_addr_t  address,
uint32_t  count,
uint8_t *  buffer 
)
static

Definition at line 2432 of file target/target.c.

References ERROR_OK, size, and target_read_memory().

Referenced by target_init_one().

◆ target_read_memory()

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 1255 of file target/target.c.

References ERROR_FAIL, LOG_ERROR, target_type::read_memory, 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(), 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(), read_userrow(), riscv_add_breakpoint(), riscv_semihosting(), rpchf_read(), 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_mem2array(), target_read_buffer_default(), target_read_u16(), target_read_u32(), target_read_u64(), target_read_u8(), target_set_examined(), uCOS_III_find_last_thread_address(), uCOS_III_get_thread_reg_list(), uCOS_III_update_thread_offsets(), uCOS_III_update_threads(), and xscale_set_breakpoint().

◆ target_read_phys_memory()

int target_read_phys_memory ( struct target target,
target_addr_t  address,
uint32_t  size,
uint32_t  count,
uint8_t *  buffer 
)

◆ target_read_u16()

◆ target_read_u32()

int target_read_u32 ( struct target target,
target_addr_t  address,
uint32_t *  value 
)

Definition at line 2544 of file target/target.c.

References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_buffer_get_u32(), target_read_memory(), and target_was_examined().

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_tpiu_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_profiling(), davinci_init(), davinci_nand_ready(), davinci_read_block_data(), davinci_write_page_ecc1(), davinci_write_page_ecc4(), davinci_write_page_ecc4infix(), EFC_GetResult(), EFC_GetStatus(), efm32x_read_info(), efm32x_read_lock_data(), efm32x_read_reg_u32(), em357_get_flash_status(), em357_protect(), em357_protect_check(), em357_read_options(), esirisc_flash_check_status(), esirisc_flash_disable_protect(), esirisc_flash_enable_protect(), esirisc_flash_wait(), fespi_read_reg(), FLASHD_ReadUniqueID(), 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(), kinetis_disable_wdog32(), kinetis_ke_probe(), kinetis_probe_chip(), kinetis_protect_check(), kinetis_read_pmstat(), lpc2000_iap_call(), lpc288x_read_part_info(), lpc288x_wait_status_busy(), 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(), 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(), nrf5_erase_page(), nrf5_get_ram_size(), nrf5_probe(), nrf5_protect_check_bprot(), nrf5_protect_check_clenr0(), nrf5_protect_clenr0(), nrf5_read_ficr_info(), nrf5_wait_for_nvmc(), nuc910_nand_ready(), numicro_erase(), numicro_fmc_cmd(), numicro_get_cpu_type(), numicro_init_isp(), numicro_reg_unlock(), numicro_write(), nuttx_get_thread_reg_list(), nuttx_update_threads(), pic32mx_get_flash_status(), pic32mx_probe(), pic32mx_protect_check(), psoc4_get_silicon_id(), psoc4_probe(), psoc4_sysreq(), psoc4_test_flash_wounding(), psoc5lp_eeprom_probe(), psoc5lp_get_device_id(), psoc6_probe(), read_sfdp_block(), riot_get_thread_reg_list(), riot_update_threads(), rpc_hf_mode(), rpc_hf_wait_tend(), rpc_hf_xfer(), s3c2440_read_block_data(), s6e2cc_probe(), sam3_page_write(), sam3_ReadThisReg(), sam4_ReadThisReg(), 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_size(), 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_probe(), str7x_protect_check(), str7x_result(), str7x_waitbusy(), str9x_protect_check(), target_run_flash_async_algorithm(), target_run_read_async_algorithm(), target_set_examined(), test_iomux_settings(), tms470_check_flash_unlocked(), tms470_erase_check(), tms470_erase_sector(), 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(), and xscale_update_vectors().

◆ target_read_u64()

◆ target_read_u8()

int target_read_u8 ( struct target target,
target_addr_t  address,
uint8_t *  value 
)

Definition at line 2592 of file target/target.c.

References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_read_memory(), and target_was_examined().

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(), 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_nand_ready(), s3c2410_read_data(), s3c2440_nand_ready(), s3c2440_read_block_data(), s3c24xx_read_data(), 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(), target_set_examined(), and uCOS_III_update_threads().

◆ target_register_commands()

int target_register_commands ( struct command_context cmd_ctx)

Definition at line 6171 of file target/target.c.

References NULL, and register_commands().

Referenced by setup_command_handler().

◆ target_register_event_callback()

int target_register_event_callback ( int(*)(struct target *target, enum target_event event, void *priv)  callback,
void *  priv 
)

◆ target_register_reset_callback()

int target_register_reset_callback ( int(*)(struct target *target, enum target_reset_mode reset_mode, void *priv)  callback,
void *  priv 
)

◆ target_register_timer_callback()

int target_register_timer_callback ( int(*)(void *priv)  callback,
unsigned int  time_ms,
enum target_timer_type  type,
void *  priv 
)

◆ target_register_trace_callback()

int target_register_trace_callback ( int(*)(struct target *target, size_t len, uint8_t *data, void *priv)  callback,
void *  priv 
)

◆ target_register_user_commands()

static int target_register_user_commands ( struct command_context cmd_ctx)
static

◆ target_remove_breakpoint()

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 1341 of file target/target.c.

References target_type::remove_breakpoint, and target::type.

Referenced by breakpoint_free(), nds32_v3_debug_entry(), and target_set_examined().

◆ target_remove_watchpoint()

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 1356 of file target/target.c.

References target_type::remove_watchpoint, and target::type.

Referenced by target_set_examined(), and watchpoint_free().

◆ target_reset_examined()

static void target_reset_examined ( struct target target)
static

Reset the examined flag for the given target.

Pure paranoia – targets are zeroed on allocation.

Definition at line 1489 of file target/target.c.

References target::examined, and handle_target().

Referenced by handle_target(), jim_target_reset(), and target_init_one().

◆ target_reset_mode_name()

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 317 of file target/target.c.

References Jim_Nvp_value2name_simple(), LOG_ERROR, and Jim_Nvp::name.

Referenced by target_set_examined(), and tcl_target_callback_reset_handler().

◆ target_restore_working_area()

static int target_restore_working_area ( struct target target,
struct working_area area 
)
static

◆ target_resume()

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).

Parameters
targetWhich target should start executing.
currentTrue to use the target's saved program counter instead of the address parameter
addressOptionally used as the program counter.
handle_breakpointsTrue 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_executionFalse 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.)
Todo:
Resolve the ambiguity about what the "debug_execution" flag signifies. For example, Target implementations don't agree on how it relates to invalidation of the register cache, or to whether breakpoints and watchpoints should be enabled. (It would seem wrong to enable breakpoints when running downloaded "helper" algorithms (debug_execution true), since the breakpoints would be set to match target firmware being debugged, not the helper algorithm.... and enabling them could cause such helpers to malfunction (for example, by overwriting data with a breakpoint instruction. On the other hand the infrastructure for running such helpers might use this procedure but rely on hardware breakpoint to detect termination.)

Definition at line 623 of file target/target.c.

References ERROR_FAIL, ERROR_OK, 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(), gdb_fileio_reply(), gdb_fileio_response_packet(), gdb_handle_vcont_packet(), gdb_step_continue_packet(), hl_deassert_reset(), mips32_run_and_wait(), nds32_gdb_detach(), or1k_profiling(), stm8_run_and_wait(), and target_profiling_default().

◆ target_run_algorithm()

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,
uint32_t  entry_point,
uint32_t  exit_point,
int  timeout_ms,
void *  arch_info 
)

Downloads a target-specific native code algorithm to the target, and executes it.

Run an algorithm on the target given.

  • Note that some targets may need to set up, enable, and tear down a breakpoint (hard or * soft) to detect algorithm termination, while others may support lower overhead schemes where soft breakpoints embedded in the algorithm automatically terminate the algorithm.
Parameters
targetused to run the algorithm
arch_infotarget-specific description of the algorithm.

Definition at line 808 of file target/target.c.

References 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(), 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(), sh_qspi_read(), sh_qspi_write(), steps_execute(), stm32lx_write_half_pages(), stm8_blank_check_memory(), stmqspi_blank_check(), str7x_write_block(), str9x_write_block(), target_set_examined(), xmc1xxx_erase(), xmc1xxx_erase_check(), and xmc1xxx_write().

◆ target_run_flash_async_algorithm()

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 
)

Streams data to a circular buffer on target intended for consumption by code running asynchronously on target.

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.

Parameters
targetused to run the algorithm
bufferaddress on the host where data to be sent is located
countnumber of blocks to send
block_sizesize in bytes of each block
num_mem_paramscount of memory-based params to pass to algorithm
mem_paramsmemory-based params to pass to algorithm
num_reg_paramscount of register-based params to pass to algorithm
reg_paramsmemory-based params to pass to algorithm
buffer_startaddress on the target of the circular buffer structure
buffer_sizesize of the circular buffer structure
entry_pointaddress on the target to execute to start the algorithm
exit_pointaddress at which to set a breakpoint to catch the end of the algorithm; can be 0 if target triggers a breakpoint itself

Definition at line 952 of file target/target.c.

References alive_sleep(), buffer, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, 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 target_set_examined().

◆ target_run_read_async_algorithm()

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 
)

◆ target_soft_reset_halt()

static int target_soft_reset_halt ( struct target target)
static

◆ target_split_working_area()

static void target_split_working_area ( struct working_area area,
uint32_t  size 
)
static

◆ target_start_algorithm()

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,
uint32_t  entry_point,
uint32_t  exit_point,
void *  arch_info 
)

Executes a target-specific native code algorithm and leaves it running.

Starts an algorithm in the background on the target given.

Parameters
targetused to run the algorithm
arch_infotarget-specific description of the algorithm.

Definition at line 843 of file target/target.c.

References ERROR_FAIL, LOG_ERROR, target::running_alg, target_type::start_algorithm, target_type_name(), target_was_examined(), and target::type.

Referenced by cc26xx_init(), msp432_init(), sromalgo_prepare(), target_run_flash_async_algorithm(), target_run_read_async_algorithm(), and target_set_examined().

◆ target_state_name()

◆ target_step()

int target_step ( struct target target,
int  current,
target_addr_t  address,
int  handle_breakpoints 
)

◆ target_strerror_safe()

static const char* target_strerror_safe ( int  err)
static

Definition at line 186 of file target/target.c.

References Jim_Nvp_value2name_simple(), Jim_Nvp::name, and NULL.

Referenced by jim_target_wait_state().

◆ target_supports_gdb_connection()

bool target_supports_gdb_connection ( struct target target)

Check if target allows GDB connections.

Some target do not implement the necessary code required by GDB.

Definition at line 1419 of file target/target.c.

References target::gdb_max_connections, target_type::get_gdb_reg_list, and target::type.

Referenced by gdb_target_add_one(), and target_set_examined().

◆ target_timer_callback_periodic_restart()

static int target_timer_callback_periodic_restart ( struct target_timer_callback cb,
struct timeval now 
)
static

◆ target_type_name()

const char* target_type_name ( 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 778 of file target/target.c.

References target_type::name, and target::type.

Referenced by arm_default_mcr(), arm_default_mrc(), cfi_spansion_write_block(), COMMAND_HANDLER(), embeddedice_build_reg_cache(), target_configure(), target_handle_event(), target_run_algorithm(), target_start_algorithm(), and target_wait_algorithm().

◆ target_unregister_event_callback()

int target_unregister_event_callback ( int(*)(struct target *target, enum target_event event, void *priv)  callback,
void *  priv 
)

◆ target_unregister_reset_callback()

int target_unregister_reset_callback ( int(*)(struct target *target, enum target_reset_mode reset_mode, void *priv)  callback,
void *  priv 
)

◆ target_unregister_timer_callback()

int target_unregister_timer_callback ( int(*)(void *priv)  callback,
void *  priv 
)

◆ target_unregister_trace_callback()

int target_unregister_trace_callback ( int(*)(struct target *target, size_t len, uint8_t *data, void *priv)  callback,
void *  priv 
)

◆ target_wait_algorithm()

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,
uint32_t  exit_point,
int  timeout_ms,
void *  arch_info 
)

Waits for an algorithm started with target_start_algorithm() to complete.

Wait for an algorithm on the target given.

Parameters
targetused to run the algorithm
arch_infotarget-specific description of the algorithm.

Definition at line 881 of file target/target.c.

References ERROR_FAIL, ERROR_TARGET_TIMEOUT, LOG_ERROR, target::running_alg, target_type_name(), target::type, and target_type::wait_algorithm.

Referenced by cc26xx_quit(), msp432_quit(), sromalgo_release(), target_run_flash_async_algorithm(), target_run_read_async_algorithm(), and target_set_examined().

◆ target_wait_state()

◆ target_write_buffer()

int target_write_buffer ( struct target target,
target_addr_t  address,
uint32_t  size,
const uint8_t *  buffer 
)

Definition at line 2346 of file target/target.c.

References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, 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(), esirisc_flash_fill_pb(), 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(), imx31_write_page(), jim_nds32_bulk_write(), jim_nds32_multi_write(), kinetis_disable_wdog_algo(), kinetis_ke_stop_watchdog(), kinetis_ke_write_words(), kinetis_write_block(), lpc2000_write(), lpc288x_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(), nrf5_ll_flash_write(), numicro_writeblock(), pic32mx_write_block(), psoc4_sysreq(), psoc5lp_write(), psoc6_program_row(), qspi_read_write_block(), qspi_verify(), semihosting_common(), sh_qspi_upload_helper(), sh_qspi_write(), sim3x_write_block(), smi_write_buffer(), stellaris_write(), stellaris_write_block(), steps_execute(), stm32l4_write_block(), stm32lx_write(), stm32lx_write_half_pages(), stm32x_write(), stm32x_write_block(), stm8_blank_check_memory(), stm8_run_algorithm(), stmqspi_blank_check(), str7x_write_block(), str9x_write_block(), target_run_flash_async_algorithm(), target_set_examined(), w600_write(), write_to_channel(), xmc1xxx_erase(), xmc1xxx_erase_check(), and xmc1xxx_write().

◆ target_write_buffer_default()

static int target_write_buffer_default ( struct target target,
target_addr_t  address,
uint32_t  count,
const uint8_t *  buffer 
)
static

Definition at line 2370 of file target/target.c.

References ERROR_OK, size, and target_write_memory().

Referenced by target_init_one().

◆ target_write_memory()

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.

Todo:
TODO: Really buffer should have been defined as "const void *" and buffer should have been aligned to size in the host memory.

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 1283 of file target/target.c.

References ERROR_FAIL, LOG_ERROR, 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(), riscv_add_breakpoint(), riscv_remove_breakpoint(), 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(), stm8_unset_breakpoint(), str7x_write(), str9x_write(), swm050_write(), target_array2mem(), target_restore_working_area(), target_set_examined(), target_write_buffer_default(), target_write_u16(), target_write_u32(), target_write_u64(), target_write_u8(), xmc1xxx_write(), and xscale_unset_breakpoint().

◆ target_write_phys_memory()

int target_write_phys_memory ( struct target target,
target_addr_t  address,
uint32_t  size,
uint32_t  count,
const uint8_t *  buffer 
)

◆ target_write_phys_u16()

int target_write_phys_u16 ( struct target target,
target_addr_t  address,
uint16_t  value 
)

◆ target_write_phys_u32()

◆ target_write_phys_u64()

int target_write_phys_u64 ( struct target target,
target_addr_t  address,
uint64_t  value 
)

◆ target_write_phys_u8()

int target_write_phys_u8 ( struct target target,
target_addr_t  address,
uint8_t  value 
)

◆ target_write_u16()

◆ target_write_u32()

int target_write_u32 ( struct target target,
target_addr_t  address,
uint32_t  value 
)

Definition at line 2635 of file target/target.c.

References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, TARGET_ADDR_FMT, target_buffer_set_u32(), target_was_examined(), and target_write_memory().

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(), armv7m_trace_tpiu_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_StartCommand(), 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(), 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(), 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_erase(), lpc288x_load_timer(), lpc288x_protect(), lpc288x_set_flash_clk(), lpc288x_write(), 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(), nrf5_nvmc_erase_enable(), nrf5_nvmc_generic_erase(), nrf5_nvmc_read_only(), nrf5_nvmc_write_enable(), nrf5_protect_clenr0(), nuc910_nand_address(), nuc910_nand_init(), numicro_erase(), numicro_fmc_cmd(), numicro_init_isp(), numicro_reg_unlock(), numicro_write(), 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(), qspi_erase_sector(), qspi_write_enable(), read_flash_id(), read_from_channel(), read_sfdp_block(), read_status_reg(), rpc_hf_mode(), rpc_hf_xfer(), s3c2410_init(), s3c2410_write_data(), s3c2412_init(), s3c2440_init(), s3c2440_write_block_data(), s3c2443_init(), s3c24xx_reset(), s3c6400_init(), sam3_page_write(), sam4_set_wait(), sam4l_flash_command(), samd_erase_row(), 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_blank_check(), stmqspi_probe(), stmqspi_read(), stmqspi_verify(), stmqspi_write(), str7x_erase(), str7x_protect(), str7x_write(), swm050_erase(), swm050_mass_erase(), swm050_write(), target_run_flash_async_algorithm(), target_run_read_async_algorithm(), target_set_examined(), tms470_erase_check(), tms470_erase_sector(), tms470_flash_initialize_internal_state_machine(), tms470_protect(), tms470_protect_check(), tms470_read_part_info(), tms470_try_flash_keys(), tms470_write(), w600_start_do(), write_to_channel(), xmc4xxx_clear_flash_status(), xmc4xxx_enter_page_mode(), xmc4xxx_write_command_sequence(), xmc4xxx_write_page(), and xscale_set_breakpoint().

◆ target_write_u64()

◆ target_write_u8()

◆ write_gmon()

static void write_gmon ( uint32_t *  samples,
uint32_t  sampleNum,
const char *  filename,
bool  with_range,
uint32_t  start_address,
uint32_t  end_address,
struct target target,
uint32_t  duration_ms 
)
static

Definition at line 4144 of file target/target.c.

References NULL, writeData(), writeLong(), and writeString().

Referenced by COMMAND_HANDLER().

◆ writeData()

static void writeData ( FILE *  f,
const void *  data,
size_t  len 
)
static

Definition at line 4121 of file target/target.c.

References LOG_ERROR.

Referenced by write_gmon(), writeLong(), and writeString().

◆ writeLong()

static void writeLong ( FILE *  f,
int  l,
struct target target 
)
static

Definition at line 4128 of file target/target.c.

References target_buffer_set_u32(), and writeData().

Referenced by write_gmon().

◆ writeString()

static void writeString ( FILE *  f,
char *  s 
)
static

Definition at line 4136 of file target/target.c.

References writeData().

Referenced by write_gmon().

Variable Documentation

◆ aarch64_target

struct target_type aarch64_target

Definition at line 2862 of file aarch64.c.

◆ all_targets

◆ arcv2_target

struct target_type arcv2_target

Definition at line 2239 of file arc.c.

◆ arm11_target

struct target_type arm11_target

Holds methods for ARM11xx targets.

Definition at line 1360 of file arm11.c.

◆ arm720t_target

struct target_type arm720t_target

Holds methods for ARM720 targets.

Definition at line 554 of file arm720t.c.

◆ arm7tdmi_target

struct target_type arm7tdmi_target

Holds methods for ARM7TDMI targets.

Definition at line 695 of file arm7tdmi.c.

◆ arm920t_target

struct target_type arm920t_target

Holds methods for ARM920 targets.

Definition at line 1690 of file arm920t.c.

◆ arm926ejs_target

struct target_type arm926ejs_target

Holds methods for ARM926 targets.

Definition at line 801 of file arm926ejs.c.

◆ arm946e_target

struct target_type arm946e_target

Holds methods for ARM946 targets.

Definition at line 749 of file arm946e.c.

◆ arm966e_target

struct target_type arm966e_target

Holds methods for ARM966 targets.

Definition at line 256 of file arm966e.c.

◆ arm9tdmi_target

struct target_type arm9tdmi_target

Holds methods for ARM9TDMI targets.

Definition at line 899 of file arm9tdmi.c.

◆ avr32_ap7k_target

struct target_type avr32_ap7k_target

Definition at line 592 of file avr32_ap7k.c.

◆ avr_target

struct target_type avr_target

Definition at line 50 of file avrt.c.

◆ cortexa_target

struct target_type cortexa_target

Definition at line 3144 of file cortex_a.c.

◆ cortexm_target

struct target_type cortexm_target

Definition at line 2499 of file cortex_m.c.

◆ cortexr4_target

struct target_type cortexr4_target

Definition at line 3225 of file cortex_a.c.

◆ dragonite_target

struct target_type dragonite_target

Definition at line 741 of file feroceon.c.

◆ dsp563xx_target

struct target_type dsp563xx_target

Holds methods for DSP563XX targets.

Definition at line 2252 of file dsp563xx.c.

◆ dsp5680xx_target

struct target_type dsp5680xx_target

Holds methods for dsp5680xx targets.

Definition at line 2277 of file dsp5680xx.c.

◆ esirisc_target

struct target_type esirisc_target

Definition at line 1803 of file esirisc.c.

◆ fa526_target

struct target_type fa526_target

Holds methods for FA526 targets.

Definition at line 361 of file fa526.c.

◆ fastload

struct FastLoad* fastload
static

Definition at line 6009 of file target/target.c.

◆ fastload_num

int fastload_num
static

Definition at line 6008 of file target/target.c.

Referenced by COMMAND_HANDLER(), and free_fastload().

◆ feroceon_target

struct target_type feroceon_target

Definition at line 702 of file feroceon.c.

◆ hla_target

struct target_type hla_target

Definition at line 636 of file hla_target.c.

◆ ls1_sap_target

struct target_type ls1_sap_target

Definition at line 225 of file ls1_sap.c.

◆ mem_ap_target

struct target_type mem_ap_target

Definition at line 176 of file mem_ap.c.

◆ mips_m4k_target

struct target_type mips_m4k_target

Definition at line 1393 of file mips_m4k.c.

◆ mips_mips64_target

struct target_type mips_mips64_target

Definition at line 1158 of file mips_mips64.c.

◆ nds32_v2_target

struct target_type nds32_v2_target

Holds methods for V2 targets.

Definition at line 740 of file nds32_v2.c.

◆ nds32_v3_target

struct target_type nds32_v3_target

Holds methods for Andes1337 targets.

Definition at line 471 of file nds32_v3.c.

◆ nds32_v3m_target

struct target_type nds32_v3m_target

Holds methods for NDS32 V3m targets.

Definition at line 458 of file nds32_v3m.c.

◆ nvp_assert

const Jim_Nvp nvp_assert[]
static
Initial value:
= {
{ .name = "assert", NVP_ASSERT },
{ .name = "deassert", NVP_DEASSERT },
{ .name = "T", NVP_ASSERT },
{ .name = "F", NVP_DEASSERT },
{ .name = "t", NVP_ASSERT },
{ .name = "f", NVP_DEASSERT },
{ .name = NULL, .value = -1 }
}
#define NULL
Definition: usb.h:27

Definition at line 161 of file target/target.c.

◆ nvp_config_opts

Jim_Nvp nvp_config_opts[]
static
Initial value:
= {
{ .name = "-type", .value = TCFG_TYPE },
{ .name = "-event", .value = TCFG_EVENT },
{ .name = "-work-area-virt", .value = TCFG_WORK_AREA_VIRT },
{ .name = "-work-area-phys", .value = TCFG_WORK_AREA_PHYS },
{ .name = "-work-area-size", .value = TCFG_WORK_AREA_SIZE },
{ .name = "-work-area-backup", .value = TCFG_WORK_AREA_BACKUP },
{ .name = "-endian", .value = TCFG_ENDIAN },
{ .name = "-coreid", .value = TCFG_COREID },
{ .name = "-chain-position", .value = TCFG_CHAIN_POSITION },
{ .name = "-dbgbase", .value = TCFG_DBGBASE },
{ .name = "-rtos", .value = TCFG_RTOS },
{ .name = "-defer-examine", .value = TCFG_DEFER_EXAMINE },
{ .name = "-gdb-port", .value = TCFG_GDB_PORT },
{ .name = "-gdb-max-connections", .value = TCFG_GDB_MAX_CONNECTIONS },
{ .name = NULL, .value = -1 }
}
#define NULL
Definition: usb.h:27

Definition at line 4812 of file target/target.c.

◆ nvp_error_target

const Jim_Nvp nvp_error_target[]
static
Initial value:
= {
{ .value = ERROR_TARGET_INVALID, .name = "err-invalid" },
{ .value = ERROR_TARGET_INIT_FAILED, .name = "err-init-failed" },
{ .value = ERROR_TARGET_TIMEOUT, .name = "err-timeout" },
{ .value = ERROR_TARGET_NOT_HALTED, .name = "err-not-halted" },
{ .value = ERROR_TARGET_FAILURE, .name = "err-failure" },
{ .value = ERROR_TARGET_UNALIGNED_ACCESS, .name = "err-unaligned-access" },
{ .value = ERROR_TARGET_DATA_ABORT, .name = "err-data-abort" },
{ .value = ERROR_TARGET_RESOURCE_NOT_AVAILABLE, .name = "err-resource-not-available" },
{ .value = ERROR_TARGET_TRANSLATION_FAULT, .name = "err-translation-fault" },
{ .value = ERROR_TARGET_NOT_RUNNING, .name = "err-not-running" },
{ .value = ERROR_TARGET_NOT_EXAMINED, .name = "err-not-examined" },
{ .value = -1, .name = NULL }
}
#define ERROR_TARGET_NOT_HALTED
Definition: target.h:771
#define ERROR_TARGET_UNALIGNED_ACCESS
Definition: target.h:773
#define ERROR_TARGET_INVALID
Definition: target.h:768
#define ERROR_TARGET_FAILURE
Definition: target.h:772
#define ERROR_TARGET_INIT_FAILED
Definition: target.h:769
#define ERROR_TARGET_NOT_EXAMINED
Definition: target.h:778
#define ERROR_TARGET_NOT_RUNNING
Definition: target.h:777
#define ERROR_TARGET_TIMEOUT
Definition: target.h:770
#define ERROR_TARGET_RESOURCE_NOT_AVAILABLE
Definition: target.h:775
#define ERROR_TARGET_TRANSLATION_FAULT
Definition: target.h:776
#define NULL
Definition: usb.h:27
#define ERROR_TARGET_DATA_ABORT
Definition: target.h:774

Definition at line 171 of file target/target.c.

◆ nvp_reset_modes

const Jim_Nvp nvp_reset_modes[]
static
Initial value:
= {
{ .name = "unknown", .value = RESET_UNKNOWN },
{ .name = "run", .value = RESET_RUN },
{ .name = "halt", .value = RESET_HALT },
{ .name = "init", .value = RESET_INIT },
{ .name = NULL, .value = -1 },
}
#define NULL
Definition: usb.h:27

Definition at line 270 of file target/target.c.

◆ nvp_target_debug_reason

const Jim_Nvp nvp_target_debug_reason[]
static
Initial value:
= {
{ .name = "debug-request", .value = DBG_REASON_DBGRQ },
{ .name = "breakpoint", .value = DBG_REASON_BREAKPOINT },
{ .name = "watchpoint", .value = DBG_REASON_WATCHPOINT },
{ .name = "watchpoint-and-breakpoint", .value = DBG_REASON_WPTANDBKPT },
{ .name = "single-step", .value = DBG_REASON_SINGLESTEP },
{ .name = "target-not-halted", .value = DBG_REASON_NOTHALTED },
{ .name = "program-exit", .value = DBG_REASON_EXIT },
{ .name = "exception-catch", .value = DBG_REASON_EXC_CATCH },
{ .name = "undefined", .value = DBG_REASON_UNDEFINED },
{ .name = NULL, .value = -1 },
}
#define NULL
Definition: usb.h:27

Definition at line 249 of file target/target.c.

◆ nvp_target_endian

const Jim_Nvp nvp_target_endian[]
static
Initial value:
= {
{ .name = "big", .value = TARGET_BIG_ENDIAN },
{ .name = "little", .value = TARGET_LITTLE_ENDIAN },
{ .name = "be", .value = TARGET_BIG_ENDIAN },
{ .name = "le", .value = TARGET_LITTLE_ENDIAN },
{ .name = NULL, .value = -1 },
}
#define NULL
Definition: usb.h:27

Definition at line 262 of file target/target.c.

◆ nvp_target_event

const Jim_Nvp nvp_target_event[]
static

Definition at line 197 of file target/target.c.

◆ nvp_target_state

const Jim_Nvp nvp_target_state[]
static
Initial value:
= {
{ .name = "unknown", .value = TARGET_UNKNOWN },
{ .name = "running", .value = TARGET_RUNNING },
{ .name = "halted", .value = TARGET_HALTED },
{ .name = "reset", .value = TARGET_RESET },
{ .name = "debug-running", .value = TARGET_DEBUG_RUNNING },
{ .name = NULL, .value = -1 },
}
#define NULL
Definition: usb.h:27

Definition at line 240 of file target/target.c.

◆ or1k_target

struct target_type or1k_target

Definition at line 1428 of file or1k.c.

◆ polling_interval

const int polling_interval = 100
static

Definition at line 159 of file target/target.c.

Referenced by handle_target(), and target_init().

◆ powerDropout

int powerDropout
static

Definition at line 2843 of file target/target.c.

Referenced by readPowerDropout(), and sense_handler().

◆ quark_d20xx_target

struct target_type quark_d20xx_target

Definition at line 90 of file quark_d20xx.c.

◆ quark_x10xx_target

struct target_type quark_x10xx_target

Definition at line 68 of file quark_x10xx.c.

◆ riscv_target

struct target_type riscv_target

Definition at line 2742 of file riscv.c.

◆ runPowerDropout

int runPowerDropout
static

Definition at line 2847 of file target/target.c.

◆ runPowerRestore

int runPowerRestore
static

Definition at line 2846 of file target/target.c.

◆ runSrstAsserted

int runSrstAsserted
static

Definition at line 2848 of file target/target.c.

◆ runSrstDeasserted

int runSrstDeasserted
static

Definition at line 2849 of file target/target.c.

◆ srstAsserted

int srstAsserted
static

Definition at line 2844 of file target/target.c.

Referenced by readSRST(), sense_handler(), and waitSRST().

◆ stm8_target

struct target_type stm8_target

Definition at line 2173 of file stm8.c.

Referenced by stm8_get_core_reg().

◆ target_command_handlers

const struct command_registration target_command_handlers[]
static
Initial value:
= {
{
.name = "targets",
.handler = handle_targets_command,
.mode = COMMAND_ANY,
.help = "change current default target (one parameter) "
"or prints table of all targets (no parameters)",
.usage = "[target]",
},
{
.name = "target",
.mode = COMMAND_CONFIG,
.help = "configure target",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:234
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:222
static const struct command_registration target_subcommand_handlers[]

Definition at line 6152 of file target/target.c.

◆ target_event_callbacks

◆ target_exec_command_handlers

const struct command_registration target_exec_command_handlers[]
static

Definition at line 6403 of file target/target.c.

◆ target_instance_command_handlers

const struct command_registration target_instance_command_handlers[]
static

Definition at line 5438 of file target/target.c.

Referenced by target_create().

◆ target_reset_nag

bool target_reset_nag = true
static

Definition at line 6176 of file target/target.c.

Referenced by get_target_reset_nag().

◆ target_subcommand_handlers

const struct command_registration target_subcommand_handlers[]
static

Definition at line 5956 of file target/target.c.

◆ target_timer_callbacks

struct target_timer_callback* target_timer_callbacks
static

◆ target_types

struct target_type* target_types[]
static

Definition at line 114 of file target/target.c.

◆ testee_target

struct target_type testee_target

Definition at line 64 of file testee.c.

◆ xscale_target

struct target_type xscale_target

Definition at line 3714 of file xscale.c.