48 #define DHCSR_S_REGRDY_TIMEOUT (500)
98 .name =
"Cortex-M35P",
104 .name =
"Cortex-M52",
110 .name =
"Cortex-M55",
116 .name =
"Cortex-M85",
128 .name =
"Infineon-SLx2",
133 .name =
"Real-M200 (KM0)",
138 .name =
"Real-M300 (KM4)",
146 uint32_t num, uint32_t value);
177 uint32_t regsel, uint32_t *value)
182 uint32_t dcrdr, tmp_value;
241 for (
unsigned int reg_id = 0; reg_id < num_regs; reg_id++) {
257 uint32_t *reg_value, uint32_t *dhcsr)
283 if (dbg_msg_enabled) {
294 uint32_t r_vals[n_r32];
295 uint32_t dhcsr[n_r32];
299 for (reg_id = 0; reg_id < num_regs; reg_id++) {
317 assert(r->
size == 32 || r->
size == 64);
336 if (dbg_msg_enabled) {
344 bool not_ready =
false;
345 for (
unsigned int i = 0; i < wi; i++) {
362 for (reg_id = 0; reg_id < num_regs; reg_id++) {
369 unsigned int reg32_id;
382 assert(r->
size == 32 || r->
size == 64);
399 uint32_t regsel, uint32_t
value)
449 uint32_t mask_on, uint32_t mask_off)
455 cortex_m->
dcb_dhcsr &= ~((0xFFFFul << 16) | mask_off);
672 for (
unsigned int i = 0; i < cortex_m->
dwt_num_comp; i++) {
682 dwt_list[i].
function);
733 uint32_t shcsr = 0, except_sr = 0, cfsr = -1, except_ar = -1;
748 if (except_sr & 0x40000000) {
801 ", CFSR 0x%" PRIx32
", AR 0x%" PRIx32,
803 shcsr, except_sr, cfsr, except_ar);
826 if (pc >= 0xe0000000u)
923 ", cpu in %s state, target->state: %s",
926 secure_state ?
"Secure" :
"Non-Secure",
1035 ", ARM Cortex-M7 erratum 3092511",
1098 retval = detected_failure;
1291 "DHCSR 0x%08" PRIx32
", %d ms",
1327 if (!debug_execution) {
1333 if (debug_execution) {
1375 && !debug_execution)
1380 *address = resume_pc;
1387 if (handle_breakpoints) {
1420 if (!debug_execution) {
1447 handle_breakpoints,
false);
1461 target_addr_t address,
int handle_breakpoints,
int debug_execution)
1472 LOG_WARNING(
"resume of a SMP target failed, trying to resume current one");
1482 debug_execution ?
"debug " :
"", address);
1495 bool bkpt_inst_found =
false;
1497 bool isr_timed_out =
false;
1519 if (handle_breakpoints) {
1536 if (!bkpt_inst_found) {
1591 if (cortex_m->
fp_rev == 0 && pc_value > 0x1FFFFFFF) {
1598 bool tmp_bp_set = (retval ==
ERROR_OK);
1621 isr_timed_out = ((
timeval_ms() - t_start) > 500);
1632 if (isr_timed_out) {
1634 "leaving target running");
1661 if (isr_timed_out) {
1669 " nvic_icsr = 0x%" PRIx32,
1678 " nvic_icsr = 0x%" PRIx32,
1806 ?
"SYSRESETREQ" :
"VECTRESET");
1810 "handler to reset any peripherals or configure hardware srst support.");
1874 unsigned int fp_num = 0;
1885 while (comparator_list[fp_num].
used && (fp_num < cortex_m->fp_num_code))
1893 if (cortex_m->
fp_rev == 0) {
1896 "cannot handle HW breakpoint above address 0x1FFFFFFE");
1902 }
else if (cortex_m->
fp_rev > 1) {
1906 comparator_list[fp_num].
used =
true;
1980 comparator_list[fp_num].
used =
false;
2022 unsigned int dwt_num = 0;
2033 comparator->
used && dwt_num < cortex_m->dwt_num_comp;
2034 comparator++, dwt_num++)
2040 comparator->
used =
true;
2049 uint32_t
mask = 0, temp;
2125 comparator->
used =
false;
2208 unsigned int dwt_num = wp->number;
2211 uint32_t dwt_function;
2217 if (dwt_function &
BIT(24)) {
2218 *hit_watchpoint = wp;
2245 if (((
size == 4) && (address & 0x3u)) || ((
size == 2) && (address & 0x1u)))
2259 if (((
size == 4) && (address & 0x3u)) || ((
size == 2) && (address & 0x1u)))
2292 uint32_t max_num_samples, uint32_t *num_samples, uint32_t seconds)
2304 if (reg_value == 0) {
2324 uint32_t sample_count = 0;
2328 uint32_t read_count = max_num_samples - sample_count;
2329 if (read_count > 1024)
2333 (
void *)&samples[sample_count],
2335 sample_count += read_count;
2353 *num_samples = sample_count;
2406 #define DWT_COMPARATOR(i) \
2407 { DWT_COMP0 + 0x10 * (i), "dwt_" #i "_comp", 32, }, \
2408 { DWT_MASK0 + 0x10 * (i), "dwt_" #i "_mask", 4, }, \
2409 { DWT_FUNCTION0 + 0x10 * (i), "dwt_" #i "_function", 32, }
2426 #undef DWT_COMPARATOR
2480 cache = calloc(1,
sizeof(*cache));
2486 cache->
name =
"Cortex-M DWT registers";
2499 for (
unsigned int i = 0; i < cm->
dwt_num_comp; i++, comparator++) {
2503 for (j = 0; j < 3; j++,
reg++)
2516 (dwtcr & (0xf << 24)) ?
" only" :
"/trigger");
2537 for (
size_t i = 0; i < cache->
num_regs; i++)
2549 uint32_t dauthstatus;
2556 LOG_WARNING(
"Error reading DAUTHSTATUS register");
2563 #define MVFR0 0xE000EF40
2564 #define MVFR0_SP_MASK 0x000000F0
2565 #define MVFR0_SP 0x00000020
2566 #define MVFR0_DP_MASK 0x00000F00
2567 #define MVFR0_DP 0x00000200
2569 #define MVFR1 0xE000EF44
2570 #define MVFR1_MVE_MASK 0x00000F00
2571 #define MVFR1_MVE_I 0x00000100
2572 #define MVFR1_MVE_F 0x00000200
2586 uint32_t cpuid, fpcr;
2645 (uint8_t)((cpuid >> 20) & 0xf),
2646 (uint8_t)((cpuid >> 0) & 0xf));
2652 rev = (cpuid >> 20) & 0xf;
2653 patch = (cpuid >> 0) & 0xf;
2654 if ((rev == 0) && (patch < 2)) {
2659 LOG_TARGET_WARNING(
target,
"Erratum 3092511: Cortex-M7 can halt in an incorrect address when breakpoint and exception occurs simultaneously");
2662 LOG_WARNING(
"No erratum 3092511 workaround on hla adapter");
2664 LOG_INFO(
"The erratum 3092511 workaround will resume after an incorrect halt");
2678 uint32_t mvfr0, mvfr1;
2764 cortex_m->
fp_num_code = ((fpcr >> 8) & 0x70) | ((fpcr >> 4) & 0xF);
2768 cortex_m->
fp_rev = (fpcr >> 28) & 0xf;
2812 *
ctrl = (uint8_t)dcrdr;
2813 *value = (uint8_t)(dcrdr >> 8);
2819 if (dcrdr & (1 << 0)) {
2836 for (i = 0; i < (
size * 4); i++) {
2865 if (
ctrl & (1 << 0)) {
2870 for (
int i = 1; i <= 3; i++) {
2874 request |= ((uint32_t)data << (i * 8));
2959 static const struct {
2987 unsigned int catch = 0;
2990 if (strcmp(
CMD_ARGV[0],
"all") == 0) {
2995 }
else if (strcmp(
CMD_ARGV[0],
"none") == 0)
3013 armv7m->
demcr =
catch;
3046 static const struct nvp nvp_maskisr_modes[] = {
3051 { .name =
NULL, .value = -1 },
3053 const struct nvp *n;
3091 if (strcmp(*
CMD_ARGV,
"sysresetreq") == 0)
3094 else if (strcmp(*
CMD_ARGV,
"vectreset") == 0) {
3107 reset_config =
"sysresetreq";
3111 reset_config =
"vectreset";
3115 reset_config =
"unknown";
3127 .handler = handle_cortex_m_mask_interrupts_command,
3129 .help =
"mask cortex_m interrupts",
3130 .usage =
"['auto'|'on'|'off'|'steponly']",
3133 .name =
"vector_catch",
3134 .handler = handle_cortex_m_vector_catch_command,
3136 .help =
"configure hardware vectors to trigger debug entry",
3137 .usage =
"['all'|'none'|('bus_err'|'chk_err'|...)*]",
3140 .name =
"reset_config",
3141 .handler = handle_cortex_m_reset_config_command,
3143 .help =
"configure software reset handling",
3144 .usage =
"['sysresetreq'|'vectreset']",
3166 .help =
"Cortex-M command group",
const char * arm_get_gdb_arch(const struct target *target)
const char * arm_mode_name(unsigned int psr_mode)
Map PSR mode bits to the name of an ARM processor operating mode.
int mem_ap_read_buf(struct adiv5_ap *ap, uint8_t *buffer, uint32_t size, uint32_t count, target_addr_t address)
int mem_ap_read_buf_noincr(struct adiv5_ap *ap, uint8_t *buffer, uint32_t size, uint32_t count, target_addr_t address)
int adiv5_verify_config(struct adiv5_private_config *pc)
int mem_ap_read_u32(struct adiv5_ap *ap, target_addr_t address, uint32_t *value)
Asynchronous (queued) read of a word from memory or a system register.
int mem_ap_write_u32(struct adiv5_ap *ap, target_addr_t address, uint32_t value)
Asynchronous (queued) write of a word to memory or a system register.
int adiv5_jim_configure(struct target *target, struct jim_getopt_info *goi)
int dap_find_get_ap(struct adiv5_dap *dap, enum ap_type type_to_find, struct adiv5_ap **ap_out)
int mem_ap_write_buf_noincr(struct adiv5_ap *ap, const uint8_t *buffer, uint32_t size, uint32_t count, target_addr_t address)
int dap_dp_init_or_reconnect(struct adiv5_dap *dap)
Initialize a DAP or do reconnect if DAP is not accessible.
int mem_ap_read_atomic_u32(struct adiv5_ap *ap, target_addr_t address, uint32_t *value)
Synchronous read of a word from memory or a system register.
struct adiv5_ap * dap_get_ap(struct adiv5_dap *dap, uint64_t ap_num)
int dap_put_ap(struct adiv5_ap *ap)
int mem_ap_init(struct adiv5_ap *ap)
Initialize a DAP.
int mem_ap_write_buf(struct adiv5_ap *ap, const uint8_t *buffer, uint32_t size, uint32_t count, target_addr_t address)
int mem_ap_write_atomic_u32(struct adiv5_ap *ap, target_addr_t address, uint32_t value)
Synchronous write of a word to memory or a system register.
This defines formats and data structures used to talk to ADIv5 entities.
static int dap_run(struct adiv5_dap *dap)
Perform all queued DAP operations, and clear any errors posted in the CTRL_STAT register when they ar...
Macros used to generate various ARM or Thumb opcodes.
int arm_semihosting(struct target *target, int *retval)
Checks for and processes an ARM semihosting request.
int arm_semihosting_init(struct target *target)
Initialize ARM semihosting support.
const struct command_registration arm_tpiu_deprecated_command_handlers[]
int armv7m_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
Returns generic ARM userspace registers to GDB.
int armv7m_maybe_skip_bkpt_inst(struct target *target, bool *inst_found)
void armv7m_free_reg_cache(struct target *target)
const int armv7m_psp_reg_map[ARMV7M_NUM_CORE_REGS]
uint32_t armv7m_map_id_to_regsel(unsigned int arm_reg_id)
struct reg_cache * armv7m_build_reg_cache(struct target *target)
Builds cache of architecturally defined registers.
const int armv7m_msp_reg_map[ARMV7M_NUM_CORE_REGS]
int armv7m_run_algorithm(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t entry_point, target_addr_t exit_point, unsigned int timeout_ms, void *arch_info)
Runs a Thumb algorithm in the target.
int armv7m_checksum_memory(struct target *target, target_addr_t address, uint32_t count, uint32_t *checksum)
Generates a CRC32 checksum of a memory region.
int armv7m_wait_algorithm(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t exit_point, unsigned int timeout_ms, void *arch_info)
Waits for an algorithm in the target.
bool armv7m_map_reg_packing(unsigned int arm_reg_id, unsigned int *reg32_id, uint32_t *offset)
int armv7m_blank_check_memory(struct target *target, struct target_memory_check_block *blocks, int num_blocks, uint8_t erased_value)
Checks an array of memory regions whether they are erased.
int armv7m_arch_state(struct target *target)
Logs summary of ARMv7-M state for a halted target.
int armv7m_restore_context(struct target *target)
Restores target context using the cache of core registers set up by armv7m_build_reg_cache(),...
const char * armv7m_exception_string(int number)
Maps ISR number (from xPSR) to name.
int armv7m_start_algorithm(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t entry_point, target_addr_t exit_point, void *arch_info)
Starts a Thumb algorithm in the target.
const struct command_registration armv7m_command_handlers[]
int armv7m_init_arch_info(struct target *target, struct armv7m_common *armv7m)
Sets up target as a generic ARMv7-M core.
static struct armv7m_common * target_to_armv7m(struct target *target)
const struct command_registration armv7m_trace_command_handlers[]
int armv7m_trace_itm_config(struct target *target)
Configure hardware accordingly to the current ITM target settings.
void * buf_cpy(const void *from, void *_to, unsigned int size)
Copies size bits out of from and into to.
static uint32_t buf_get_u32(const uint8_t *_buffer, unsigned int first, unsigned int num)
Retrieves num bits from _buffer, starting at the first bit, returning the bits in a 32-bit word.
static void buf_set_u32(uint8_t *_buffer, unsigned int first, unsigned int num, uint32_t value)
Sets num bits in _buffer, starting at the first bit, using the bits in value.
int breakpoint_remove(struct target *target, target_addr_t address)
int breakpoint_add(struct target *target, target_addr_t address, unsigned int length, enum breakpoint_type type)
struct breakpoint * breakpoint_find(struct target *target, target_addr_t address)
static void watchpoint_set(struct watchpoint *watchpoint, unsigned int number)
#define WATCHPOINT_IGNORE_DATA_VALUE_MASK
static void breakpoint_hw_set(struct breakpoint *breakpoint, unsigned int hw_number)
void command_print(struct command_invocation *cmd, const char *format,...)
#define CMD
Use this macro to access the command being handled, rather than accessing the variable directly.
#define CMD_NAME
Use this macro to access the name of the command being handled, rather than accessing the variable di...
#define CMD_ARGV
Use this macro to access the arguments for the command being handled, rather than accessing the varia...
#define ERROR_COMMAND_SYNTAX_ERROR
#define CMD_ARGC
Use this macro to access the number of arguments for the command being handled, rather than accessing...
#define CMD_CTX
Use this macro to access the context of the command being handled, rather than accessing the variable...
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
static int cortex_m_debug_entry(struct target *target)
static void cortex_m_dwt_free(struct target *target)
static int cortex_m_unset_watchpoint(struct target *target, struct watchpoint *watchpoint)
COMMAND_HANDLER(handle_cortex_m_vector_catch_command)
static int cortex_m_set_maskints_for_run(struct target *target)
static int cortex_m_find_mem_ap(struct adiv5_dap *swjdp, struct adiv5_ap **debug_ap)
static int cortex_m_dwt_get_reg(struct reg *reg)
static int cortex_m_poll_smp(struct list_head *smp_targets)
static int cortex_m_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
static int cortex_m_restore_smp(struct target *target, bool handle_breakpoints)
static int cortex_m_target_create(struct target *target, Jim_Interp *interp)
static int cortex_m_restart_one(struct target *target, bool debug_execution)
static int cortex_m_enable_fpb(struct target *target)
static int cortex_m_erratum_check_breakpoint(struct target *target)
static int cortex_m_single_step_core(struct target *target)
static int cortex_m_write_debug_halt_mask(struct target *target, uint32_t mask_on, uint32_t mask_off)
static int cortex_m_set_maskints_for_halt(struct target *target)
struct target_type cortexm_target
static int cortex_m_halt_one(struct target *target)
static int cortex_m_clear_halt(struct target *target)
#define DHCSR_S_REGRDY_TIMEOUT
static const struct command_registration cortex_m_command_handlers[]
static int cortex_m_set_maskints_for_step(struct target *target)
static int cortex_m_poll(struct target *target)
void cortex_m_enable_watchpoints(struct target *target)
static int cortex_m_target_request_data(struct target *target, uint32_t size, uint8_t *buffer)
static int cortex_m_init_target(struct command_context *cmd_ctx, struct target *target)
static int cortex_m_examine_exception_reason(struct target *target)
static int cortex_m_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
static int cortex_m_poll_one(struct target *target)
int cortex_m_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
static int cortex_m_store_core_reg_u32(struct target *target, uint32_t num, uint32_t value)
static int cortex_m_slow_read_all_regs(struct target *target)
static int cortex_m_init_arch_info(struct target *target, struct cortex_m_common *cortex_m, struct adiv5_dap *dap)
static int cortex_m_set_watchpoint(struct target *target, struct watchpoint *watchpoint)
void cortex_m_enable_breakpoints(struct target *target)
int cortex_m_remove_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int cortex_m_endreset_event(struct target *target)
static int cortex_m_smp_post_halt_poll(struct list_head *smp_targets)
static int cortex_m_smp_halt_all(struct list_head *smp_targets)
static int cortex_m_examine_debug_reason(struct target *target)
static int cortex_m_handle_target_request(void *priv)
static int cortex_m_fast_read_all_regs(struct target *target)
static int cortex_m_deassert_reset(struct target *target)
static const struct reg_arch_type dwt_reg_type
static void cortex_m_dwt_addreg(struct target *t, struct reg *r, const struct dwt_reg *d)
static int cortex_m_load_core_reg_u32(struct target *target, uint32_t regsel, uint32_t *value)
int cortex_m_examine(struct target *target)
int cortex_m_remove_watchpoint(struct target *target, struct watchpoint *watchpoint)
static int cortex_m_assert_reset(struct target *target)
int cortex_m_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int cortex_m_hit_watchpoint(struct target *target, struct watchpoint **hit_watchpoint)
static const struct cortex_m_part_info cortex_m_parts[]
static int cortex_m_verify_pointer(struct command_invocation *cmd, struct cortex_m_common *cm)
static const struct command_registration cortex_m_exec_command_handlers[]
static int cortex_m_write_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
static int cortex_m_dcc_read(struct target *target, uint8_t *value, uint8_t *ctrl)
int cortex_m_set_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int cortex_m_read_dhcsr_atomic_sticky(struct target *target)
Read DCB DHCSR register to cortex_m->dcb_dhcsr and cumulate sticky bits in cortex_m->dcb_dhcsr_cumula...
static int cortex_m_set_maskints(struct target *target, bool mask)
static void cortex_m_cumulate_dhcsr_sticky(struct cortex_m_common *cortex_m, uint32_t dhcsr)
DCB DHCSR register contains S_RETIRE_ST and S_RESET_ST bits cleared on a read.
static bool cortex_m_has_tz(struct target *target)
static int cortex_m_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
static void cortex_m_dwt_setup(struct cortex_m_common *cm, struct target *target)
void cortex_m_deinit_target(struct target *target)
int cortex_m_unset_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int cortex_m_soft_reset_halt(struct target *target)
int cortex_m_profiling(struct target *target, uint32_t *samples, uint32_t max_num_samples, uint32_t *num_samples, uint32_t seconds)
static const struct dwt_reg dwt_comp[]
static int cortex_m_halt(struct target *target)
#define DWT_COMPARATOR(i)
static int cortex_m_restore_one(struct target *target, bool current, target_addr_t *address, bool handle_breakpoints, bool debug_execution)
static const struct dwt_reg dwt_base_regs[]
static int cortex_m_queue_reg_read(struct target *target, uint32_t regsel, uint32_t *reg_value, uint32_t *dhcsr)
static int cortex_m_dwt_set_reg(struct reg *reg, uint8_t *buf)
#define FPCR_REPLACE_BKPT_HIGH
#define DWT_DEVARCH_ARMV8M_V2_1
#define ARM_CPUID_IMPLEMENTER_MASK
#define FPCR_REPLACE_BKPT_LOW
#define CORTEX_M_F_HAS_FPV4
#define CORTEX_M_F_HAS_FPV5
#define CORTEX_M_COMMON_MAGIC
#define AIRCR_SYSRESETREQ
static bool is_cortex_m_with_dap_access(const struct cortex_m_common *cortex_m)
#define DAUTHSTATUS_SID_MASK
#define ARM_CPUID_PARTNO_MASK
static struct cortex_m_common * target_to_cm(struct target *target)
@ CORTEX_M_ISRMASK_STEPONLY
#define DWT_DEVARCH_ARMV8M_V2_0
#define CORTEX_M_F_TAR_AUTOINCR_BLOCK_4K
cortex_m_soft_reset_config
@ CORTEX_M_RESET_VECTRESET
@ CORTEX_M_RESET_SYSRESETREQ
static int halted(struct target *target, const char *label)
static struct esp_usb_jtag * priv
static enum reset_types jtag_reset_config
int adapter_deassert_reset(void)
void jtag_sleep(uint32_t us)
enum reset_types jtag_get_reset_config(void)
int adapter_assert_reset(void)
#define list_last_entry(ptr, type, member)
void alive_sleep(uint64_t ms)
#define LOG_TARGET_INFO(target, fmt_str,...)
#define LOG_TARGET_WARNING(target, fmt_str,...)
#define LOG_WARNING(expr ...)
#define LOG_TARGET_ERROR(target, fmt_str,...)
#define LOG_TARGET_DEBUG(target, fmt_str,...)
#define LOG_ERROR(expr ...)
#define ERROR_TIMEOUT_REACHED
#define LOG_INFO(expr ...)
const struct nvp * nvp_name2value(const struct nvp *p, const char *name)
const struct nvp * nvp_value2name(const struct nvp *p, int value)
static uint32_t lh(unsigned int rd, unsigned int base, uint16_t offset) __attribute__((unused))
struct reg_cache ** register_get_last_cache_p(struct reg_cache **first)
void register_unlink_cache(struct reg_cache **cache_p, const struct reg_cache *cache)
void register_cache_invalidate(struct reg_cache *cache)
Marks the contents of the register cache as invalid (and clean).
int gettimeofday(struct timeval *tv, struct timezone *tz)
struct rtt_control ctrl
Control block.
size_t size
Size of the control block search area.
const struct command_registration rtt_target_command_handlers[]
const struct command_registration smp_command_handlers[]
#define foreach_smp_target(pos, head)
This represents an ARM Debug Interface (v5) Access Port (AP).
uint32_t tar_autoincr_block
struct adiv5_dap * dap
DAP this AP belongs to.
uint32_t memaccess_tck
Configures how many extra tck clocks are added after starting a MEM-AP access before we try to read i...
This represents an ARM Debug Interface (v5) Debug Access Port (DAP).
Represents a generic ARM core, with standard application registers.
enum arm_arch arch
ARM architecture version.
enum arm_mode core_mode
Record the current core mode: SVC, USR, or some other mode.
struct reg * cpsr
Handle to the CPSR/xPSR; valid in all core modes.
struct adiv5_dap * dap
For targets conforming to ARM Debug Interface v5, this handle references the Debug Access Port (DAP) ...
struct reg * pc
Handle to the PC; valid in all core modes.
const int * map
Support for arm_reg_current()
int(* read_core_reg)(struct target *target, struct reg *reg, int num, enum arm_mode mode)
Retrieve a single core register.
struct reg_cache * core_cache
void(* pre_restore_context)(struct target *target)
int(* store_core_reg_u32)(struct target *target, uint32_t regsel, uint32_t value)
int(* load_core_reg_u32)(struct target *target, uint32_t regsel, uint32_t *value)
struct adiv5_ap * debug_ap
int(* examine_debug_reason)(struct target *target)
int(* post_debug_entry)(struct target *target)
enum breakpoint_type type
When run_command is called, a new instance will be created on the stack, filled with the proper value...
const struct command_registration * chain
If non-NULL, the commands in chain will be registered in the same context and scope of this registrat...
const struct cortex_m_part_info * core_info
enum cortex_m_soft_reset_config soft_reset_config
struct armv7m_common armv7m
unsigned int dwt_comp_available
unsigned int dwt_num_comp
struct cortex_m_dwt_comparator * dwt_comparator_list
bool incorrect_halt_erratum
bool dcb_dhcsr_sticky_is_recent
struct cortex_m_fp_comparator * fp_comparator_list
struct reg_cache * dwt_cache
enum cortex_m_isrmasking_mode isrmasking_mode
unsigned int common_magic
uint32_t dcb_dhcsr_cumulated_sticky
uint32_t dwt_comparator_address
enum cortex_m_impl_part impl_part
Name Value Pairs, aka: NVP.
int(* get)(struct reg *reg)
const struct reg_arch_type * type
This holds methods shared between all instances of a given target type.
const char * name
Name of this type of target.
struct gdb_service * gdb_service
enum target_debug_reason debug_reason
struct reg_cache * reg_cache
struct list_head * smp_targets
struct breakpoint * breakpoints
struct watchpoint * watchpoints
bool smp_halt_event_postponed
bool defer_examine
Should we defer examine to later.
int target_call_event_callbacks(struct target *target, enum target_event event)
void target_free_all_working_areas(struct target *target)
void target_buffer_set_u16(struct target *target, uint8_t *buffer, uint16_t value)
int target_profiling_default(struct target *target, uint32_t *samples, uint32_t max_num_samples, uint32_t *num_samples, uint32_t seconds)
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.
int target_write_u32(struct target *target, target_addr_t address, uint32_t value)
int target_examine_one(struct target *target)
Examine the specified target, letting it perform any Initialisation that requires JTAG access.
const char * target_state_name(const struct target *t)
Return the name of this targets current state.
int target_poll(struct target *target)
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 spec...
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)
uint16_t target_buffer_get_u16(struct target *target, const 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.
bool target_has_event_action(const struct target *target, enum target_event event)
Returns true only if the target has a handler for the specified event.
struct target * get_current_target(struct command_context *cmd_ctx)
void target_handle_event(struct target *target, enum target_event e)
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 modificatio...
#define ERROR_TARGET_NOT_HALTED
static bool target_was_examined(const struct target *target)
#define ERROR_TARGET_UNALIGNED_ACCESS
#define ERROR_TARGET_INVALID
@ TARGET_TIMER_TYPE_PERIODIC
@ TARGET_EVENT_DEBUG_RESUMED
@ TARGET_EVENT_DEBUG_HALTED
@ TARGET_EVENT_RESET_ASSERT
#define ERROR_TARGET_HALTED_DO_RESUME
#define ERROR_TARGET_NOT_EXAMINED
#define ERROR_TARGET_RESOURCE_NOT_AVAILABLE
static void target_set_examined(struct target *target)
Sets the examined flag for the given target.
int target_request(struct target *target, uint32_t request)
int timeval_compare(const struct timeval *x, const struct timeval *y)
int timeval_add_time(struct timeval *result, long sec, long usec)
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.
static const struct @125 vec_ids[]