target_type struct
This holds methods shared between all instances of a given target type. For example, all Cortex-M3 targets on a scan chain share the same method table.
Fields
Name of this type of target. Do @b not access this field directly, use target_type_name() instead.
int (*)(struct target *target) int (*)(struct target *target) int (*)(struct target *target, uint32_t size, uint8_t *buffer) int (*)(struct target *target) int (*)(struct target *target, int current, target_addr_t address,
int handle_breakpoints, int debug_execution)
int (*)(struct target *target) int (*)(struct target *target) The implementation is responsible for polling the target such that target->state reflects the state correctly. Otherwise the following would fail, as there will not be any "poll" invoked between the "reset run" and "halt". reset run; halt.
int (*)(struct target *target) const char *(*)(const struct target *target) Target architecture for GDB. The string returned by this function will not be automatically freed; if dynamic allocation is used for this value, it must be managed by the target, ideally by caching the result for subsequent calls.
Target register access for GDB. Do @b not call this function directly, use target_get_gdb_reg_list() instead. Danger! this function will succeed even if the target is running and return a register list with dummy values. The reason is that GDB connection will fail without a valid register list, however it is after GDB is connected that monitor commands can be run to properly initialize the target.
Same as get_gdb_reg_list, but doesn't read the register values.
int (*)(struct target *target, target_addr_t address,
uint32_t size, uint32_t count, uint8_t *buffer)
Target memory read callback. Do @b not call this function directly, use target_read_memory() instead.
int (*)(struct target *target, target_addr_t address,
uint32_t size, uint32_t count, const uint8_t *buffer)
Target memory write callback. Do @b not call this function directly, use target_write_memory() instead.
Target algorithm support. Do @b not call this method directly, use target_run_algorithm() instead.
int (*)(struct target *target, int num_mem_params,
struct mem_param *mem_params, int num_reg_params,
struct reg_param *reg_param, target_addr_t exit_point,
unsigned int timeout_ms, void *arch_info)
int (*)(struct target *target) This method is used to perform target setup that requires JTAG access. This may be called multiple times. It is called after the scan chain is initially validated, or later after the target is enabled by a JRC. It may also be called during some parts of the reset sequence. For one-time initialization tasks, use target_was_examined() and target_set_examined(). For example, probe the hardware before setting up chip-specific state, and then set that flag so you don't do that again.
void (*)(struct target *target) Free all the resources allocated by the target. WARNING: deinit_target is called unconditionally regardless the target has ever been examined/initialised or not. If a problem has prevented establishing JTAG/SWD/... communication or if the target was created with -defer-examine flag and has never been examined then it is not possible to communicate with the target. If you need to talk to the target during deinit, first check if target_was_examined()!.
int (*)(struct target *target, target_addr_t phys_address,
uint32_t size, uint32_t count, uint8_t *buffer)
int (*)(struct target *target, target_addr_t phys_address,
uint32_t size, uint32_t count, const uint8_t *buffer)
int (*)(struct target *target, int *enabled) int (*)(struct target *target) int (*)(struct target *target, int retcode, int fileio_errno, bool ctrl_c) int (*)(struct target *target, const char *packet, char **response_p) int (*)(struct target *target, uint32_t *samples,
uint32_t max_num_samples, uint32_t *num_samples, uint32_t seconds)
unsigned (*)(struct target *target) unsigned int (*)(struct target *target)