101 LOG_ERROR(
"cannot read system control register in this mode: (%s : 0x%x)",
134 LOG_ERROR(
"trying to enable mmu on target stopped with mmu disable");
224 LOG_DEBUG(
"Examine %s failed",
"oslock");
295 uint32_t
mask, uint32_t val,
int *p_result, uint32_t *p_prsr)
308 *p_result = (prsr &
mask) == (val &
mask);
347 if (exc_target && curr ==
target)
371 if (exc_target && first)
430 bool all_halted =
true;
479 LOG_DEBUG(
"Halting remaining targets in SMP group");
498 if (curr == gdb_target)
508 if (gdb_target && gdb_target !=
target)
559 switch (prev_target_state) {
593 uint64_t *
address,
bool handle_breakpoints,
bool debug_execution)
602 if (!debug_execution)
617 resume_pc &= 0xFFFFFFFC;
620 resume_pc &= 0xFFFFFFFFFFFFFFFCULL;
630 LOG_ERROR(
"How do I resume into Jazelle state??");
633 LOG_DEBUG(
"resume pc = 0x%016" PRIx64, resume_pc);
667 LOG_ERROR(
"DSCR.ITE must be set before leaving debug!");
669 LOG_ERROR(
"DSCR.ERR must be cleared before leaving debug!");
757 bool handle_breakpoints,
struct target **p_first)
818 bool all_resumed =
true;
850 LOG_ERROR(
"%s: timeout waiting for target resume", __func__);
908 bool all_resumed =
true;
961 if (!debug_execution) {
1080 LOG_ERROR(
"cannot read system control register in this mode: (%s : 0x%x)",
1119 bool handle_breakpoints)
1162 LOG_ERROR(
"Failed to restart non-stepping targets in SMP group");
1165 LOG_DEBUG(
"Restarted all non-stepping targets in SMP group");
1177 if (!handle_breakpoints)
1191 LOG_ERROR(
"timeout waiting for target %s halt after step",
1223 return saved_retval;
1264 uint8_t byte_addr_select = 0x0F;
1276 while (brp_list[brp_i].
used && (brp_i < aarch64->brp_num))
1278 if (brp_i >= aarch64->
brp_num) {
1279 LOG_ERROR(
"ERROR Can not find free Breakpoint Register Pair");
1285 control = ((matchmode & 0x7) << 20)
1287 | (byte_addr_select << 5)
1289 brp_list[brp_i].
used = 1;
1292 bpt_value = brp_list[brp_i].
value;
1296 (uint32_t)(bpt_value & 0xFFFFFFFF));
1301 (uint32_t)(bpt_value >> 32));
1312 brp_list[brp_i].
value);
1322 LOG_ERROR(
"bug: breakpoint length should be 4 in AArch64 mode");
1385 uint8_t byte_addr_select = 0x0F;
1395 while ((brp_list[brp_i].
used ||
1399 if (brp_i >= aarch64->
brp_num) {
1400 LOG_ERROR(
"ERROR Can not find free Breakpoint Register Pair");
1405 control = ((matchmode & 0x7) << 20)
1407 | (byte_addr_select << 5)
1409 brp_list[brp_i].
used = 1;
1414 brp_list[brp_i].
value);
1424 brp_list[brp_i].
value);
1434 uint32_t control_ctx, control_iva;
1435 uint8_t ctx_byte_addr_select = 0x0F;
1436 uint8_t iva_byte_addr_select = 0x0F;
1437 uint8_t ctx_machmode = 0x03;
1438 uint8_t iva_machmode = 0x01;
1448 while ((brp_list[brp_1].
used ||
1452 LOG_DEBUG(
"brp(CTX) found num: %d", brp_1);
1453 if (brp_1 >= aarch64->
brp_num) {
1454 LOG_ERROR(
"ERROR Can not find free Breakpoint Register Pair");
1458 while ((brp_list[brp_2].
used ||
1459 (brp_list[brp_2].
type !=
BRP_NORMAL)) && (brp_2 < aarch64->brp_num))
1462 LOG_DEBUG(
"brp(IVA) found num: %d", brp_2);
1463 if (brp_2 >= aarch64->
brp_num) {
1464 LOG_ERROR(
"ERROR Can not find free Breakpoint Register Pair");
1470 control_ctx = ((ctx_machmode & 0x7) << 20)
1473 | (ctx_byte_addr_select << 5)
1475 brp_list[brp_1].
used = 1;
1477 brp_list[brp_1].
control = control_ctx;
1480 brp_list[brp_1].
value);
1489 control_iva = ((iva_machmode & 0x7) << 20)
1492 | (iva_byte_addr_select << 5)
1494 brp_list[brp_2].
used = 1;
1496 brp_list[brp_2].
control = control_iva;
1499 brp_list[brp_2].
value & 0xFFFFFFFF);
1504 brp_list[brp_2].
value >> 32);
1532 if (brp_i >= aarch64->
brp_num) {
1533 LOG_DEBUG(
"Invalid BRP number in breakpoint");
1538 brp_list[brp_i].
used = 0;
1539 brp_list[brp_i].
value = 0;
1548 (uint32_t)brp_list[brp_i].
value);
1553 (uint32_t)brp_list[brp_i].
value);
1556 if ((brp_j < 0) || (brp_j >= aarch64->
brp_num)) {
1557 LOG_DEBUG(
"Invalid BRP number in breakpoint");
1560 LOG_DEBUG(
"rbp %i control 0x%0" PRIx32
" value 0x%0" PRIx64, brp_j,
1562 brp_list[brp_j].
used = 0;
1563 brp_list[brp_j].
value = 0;
1572 (uint32_t)brp_list[brp_j].
value);
1577 (uint32_t)brp_list[brp_j].
value);
1587 if (brp_i >= aarch64->
brp_num) {
1588 LOG_DEBUG(
"Invalid BRP number in breakpoint");
1591 LOG_DEBUG(
"rbp %i control 0x%0" PRIx32
" value 0x%0" PRIx64, brp_i,
1593 brp_list[brp_i].
used = 0;
1594 brp_list[brp_i].
value = 0;
1603 brp_list[brp_i].
value);
1609 (uint32_t)brp_list[brp_i].
value);
1655 LOG_INFO(
"no hardware breakpoint available");
1671 LOG_INFO(
"no hardware breakpoint available");
1687 LOG_INFO(
"no hardware breakpoint available");
1734 while (wp_list[wp_i].
used && (wp_i < aarch64->wp_num))
1736 if (wp_i >= aarch64->
wp_num) {
1737 LOG_ERROR(
"ERROR Can not find free Watchpoint Register Pair");
1762 LOG_WARNING(
"Adjust watchpoint match inside 8-byte boundary");
1772 (uint32_t)(wp_list[wp_i].
value & 0xFFFFFFFF));
1777 (uint32_t)(wp_list[wp_i].
value >> 32));
1796 wp_list[wp_i].
used = 1;
1817 if (wp_i >= aarch64->
wp_num) {
1818 LOG_DEBUG(
"Invalid WP number in watchpoint");
1821 LOG_DEBUG(
"rwp %i control 0x%0" PRIx32
" value 0x%0" PRIx64, wp_i,
1823 wp_list[wp_i].
used = 0;
1824 wp_list[wp_i].
value = 0;
1833 wp_list[wp_i].
value);
1839 (uint32_t)wp_list[wp_i].
value);
1854 LOG_INFO(
"no hardware watchpoint available");
1895 if (exception_address == 0xFFFFFFFF)
1900 *hit_watchpoint = wp;
1919 LOG_DEBUG(
"EDECR = 0x%08" PRIx32
", enable=%d", edecr, enable);
1945 was_triggered = !!(edesr &
ESR_RC);
1947 was_triggered ?
"triggered" :
"NOT triggered!");
1949 if (was_triggered) {
1994 LOG_WARNING(
"%s: Error enabling Reset Catch debug event; the CPU will not halt immediately after reset!",
1997 LOG_WARNING(
"%s: Target not examined, will not halt immediately after reset!",
2047 LOG_WARNING(
"%s: Clearing Reset Catch debug event failed",
2053 LOG_WARNING(
"%s: Disabling Reset Catch debug event failed",
2057 LOG_WARNING(
"%s: ran after reset and before halt ...",
2081 LOG_ERROR(
"memory write sizes greater than 4 bytes is only supported for AArch64 state");
2150 uint32_t
count,
const uint8_t *
buffer, uint32_t *dscr)
2260 LOG_ERROR(
"abort occurred - dscr = 0x%08" PRIx32, dscr);
2278 LOG_ERROR(
"memory read sizes greater than 4 bytes is only supported for AArch64 state");
2334 data = (uint64_t)lower | (uint64_t)higher << 32;
2433 LOG_DEBUG(
"Reading CPU memory address 0x%016" PRIx64
" size %" PRIu32
" count %" PRIu32,
2504 LOG_ERROR(
"abort occurred - dscr = 0x%08" PRIx32, dscr);
2532 int mmu_enabled = 0;
2569 int mmu_enabled = 0;
2626 uint64_t debug, ttypr;
2628 uint32_t tmp0, tmp1, tmp2, tmp3;
2629 debug = ttypr = cpuid = 0;
2639 LOG_ERROR(
"Could not find APB-AP for debug access");
2653 LOG_ERROR(
"Could not initialize the APB-AP");
2673 LOG_DEBUG(
"Examine %s failed",
"oslock");
2680 LOG_DEBUG(
"Examine %s failed",
"CPUID");
2689 LOG_DEBUG(
"Examine %s failed",
"Memory Model Type");
2697 LOG_DEBUG(
"Examine %s failed",
"ID_AA64DFR0_EL1");
2708 ttypr = (ttypr << 32) | tmp0;
2710 debug = (debug << 32) | tmp2;
2712 LOG_DEBUG(
"cpuid = 0x%08" PRIx32, cpuid);
2713 LOG_DEBUG(
"ttypr = 0x%08" PRIx64, ttypr);
2714 LOG_DEBUG(
"debug = 0x%08" PRIx64, debug);
2728 aarch64->
brp_num = (uint32_t)((debug >> 12) & 0x0F) + 1;
2732 for (i = 0; i < aarch64->
brp_num; i++) {
2744 aarch64->
wp_num = (uint32_t)((debug >> 20) & 0x0F) + 1;
2747 for (i = 0; i < aarch64->
wp_num; i++) {
2755 LOG_DEBUG(
"Configured %i hw breakpoints, %i watchpoints",
2902 { .name =
NULL, .value = -1 }
2926 if (e != JIM_CONTINUE)
2930 if (goi->
argc > 0) {
2931 Jim_SetEmptyResult(goi->
interp);
2937 return JIM_CONTINUE;
2953 Jim_SetResultString(goi->
interp,
"CTI name invalid!", -1);
2958 if (goi->
argc != 0) {
2959 Jim_WrongNumArgs(goi->
interp,
2965 if (!pc || !pc->
cti) {
2966 Jim_SetResultString(goi->
interp,
"CTI not configured", -1);
2975 return JIM_CONTINUE;
3040 static const struct nvp nvp_maskisr_modes[] = {
3043 { .name =
NULL, .value = -1 },
3045 const struct nvp *n;
3065 bool is_mcr =
false;
3066 unsigned int arg_cnt = 5;
3149 int retval =
arm->
mcr(
target, cpnum, op1, op2, crn, crm, value);
3156 int retval =
arm->
mrc(
target, cpnum, op1, op2, crn, crm, &value);
3168 .
name =
"cache_info",
3169 .handler = aarch64_handle_cache_info_command,
3171 .help =
"display information about target caches",
3176 .handler = aarch64_handle_dbginit_command,
3178 .help =
"Initialize core debug",
3182 .name =
"disassemble",
3183 .handler = aarch64_handle_disassemble_command,
3185 .help =
"Disassemble instructions",
3186 .usage =
"address [count]",
3190 .handler = aarch64_mask_interrupts_command,
3192 .help =
"mask aarch64 interrupts during single-step",
3193 .usage =
"['on'|'off']",
3198 .handler = aarch64_mcrmrc_command,
3199 .help =
"write coprocessor register",
3200 .usage =
"cpnum op1 CRn CRm op2 value",
3205 .handler = aarch64_mcrmrc_command,
3206 .help =
"read coprocessor register",
3207 .usage =
"cpnum op1 CRn CRm op2",
3221 .help =
"ARM Command Group",
3231 .help =
"Aarch64 command group",
int a64_disassemble(struct command_invocation *cmd, struct target *target, target_addr_t address, size_t count)
static int aarch64_write_cpu_memory_slow(struct target *target, uint32_t size, uint32_t count, const uint8_t *buffer, uint32_t *dscr)
static int aarch64_set_breakpoint(struct target *target, struct breakpoint *breakpoint, uint8_t matchmode)
static int aarch64_unset_watchpoint(struct target *target, struct watchpoint *watchpoint)
static int aarch64_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
COMMAND_HANDLER(aarch64_handle_cache_info_command)
static int aarch64_set_dscr_bits(struct target *target, unsigned long bit_mask, unsigned long value)
static int aarch64_assert_reset(struct target *target)
static void aarch64_deinit_target(struct target *target)
static int aarch64_add_context_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int aarch64_write_phys_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
static const struct jim_nvp nvp_config_opts[]
static int aarch64_examine(struct target *target)
static const struct command_registration aarch64_exec_command_handlers[]
static int aarch64_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int aarch64_read_prsr(struct target *target, uint32_t *prsr)
static int aarch64_set_context_breakpoint(struct target *target, struct breakpoint *breakpoint, uint8_t matchmode)
static int aarch64_mmu_modify(struct target *target, int enable)
static int aarch64_read_cpu_memory_fast(struct target *target, uint32_t count, uint8_t *buffer, uint32_t *dscr)
static int aarch64_examine_first(struct target *target)
static int aarch64_poll(struct target *target)
static int aarch64_init_target(struct command_context *cmd_ctx, struct target *target)
static int aarch64_read_cpu_memory(struct target *target, uint64_t address, uint32_t size, uint32_t count, uint8_t *buffer)
static int aarch64_target_create(struct target *target, Jim_Interp *interp)
static int aarch64_prepare_restart_one(struct target *target)
prepare single target for restart
static int aarch64_step(struct target *target, bool current, target_addr_t address, bool handle_breakpoints)
static int aarch64_restore_context(struct target *target, bool bpwp)
static int aarch64_enable_reset_catch(struct target *target, bool enable)
static int aarch64_jim_configure(struct target *target, struct jim_getopt_info *goi)
static int aarch64_halt(struct target *target)
static int aarch64_restore_one(struct target *target, bool current, uint64_t *address, bool handle_breakpoints, bool debug_execution)
static int update_halt_gdb(struct target *target, enum target_debug_reason debug_reason)
static int aarch64_mmu(struct target *target, int *enabled)
static int aarch64_read_phys_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
static int aarch64_check_state_one(struct target *target, uint32_t mask, uint32_t val, int *p_result, uint32_t *p_prsr)
static int aarch64_restore_system_control_reg(struct target *target)
static int aarch64_write_cpu_memory_fast(struct target *target, uint32_t count, const uint8_t *buffer, uint32_t *dscr)
static int aarch64_set_watchpoint(struct target *target, struct watchpoint *watchpoint)
static int aarch64_remove_watchpoint(struct target *target, struct watchpoint *watchpoint)
static int aarch64_restart_one(struct target *target, enum restart_mode mode)
static int aarch64_step_restart_smp(struct target *target)
static int aarch64_dap_write_memap_register_u32(struct target *target, target_addr_t address, uint32_t value)
static int aarch64_debug_entry(struct target *target)
static int aarch64_prep_restart_smp(struct target *target, bool handle_breakpoints, struct target **p_first)
static int aarch64_prepare_halt_smp(struct target *target, bool exc_target, struct target **p_first)
struct target_type aarch64_target
static const struct command_registration aarch64_command_handlers[]
static int aarch64_write_cpu_memory(struct target *target, uint64_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
static int aarch64_unset_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int aarch64_virt2phys(struct target *target, target_addr_t virt, target_addr_t *phys)
static int aarch64_handle_target_request(void *priv)
static int aarch64_clear_reset_catch(struct target *target)
static int aarch64_halt_one(struct target *target, enum halt_mode mode)
static int aarch64_hit_watchpoint(struct target *target, struct watchpoint **hit_watchpoint)
find out which watchpoint hits get exception address and compare the address to watchpoints
static int aarch64_deassert_reset(struct target *target)
static int armv8r_target_create(struct target *target, Jim_Interp *interp)
static int aarch64_write_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
struct target_type armv8r_target
static int aarch64_do_restart_one(struct target *target, enum restart_mode mode)
static int aarch64_dpm_setup(struct aarch64_common *a8, uint64_t debug)
static int aarch64_add_hybrid_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int aarch64_wait_halt_one(struct target *target)
static int aarch64_read_cpu_memory_slow(struct target *target, uint32_t size, uint32_t count, uint8_t *buffer, uint32_t *dscr)
static int aarch64_init_arch_info(struct target *target, struct aarch64_common *aarch64, struct adiv5_dap *dap)
static int aarch64_remove_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int aarch64_resume(struct target *target, bool current, target_addr_t address, bool handle_breakpoints, bool debug_execution)
static int aarch64_set_hybrid_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int aarch64_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
static int aarch64_halt_smp(struct target *target, bool exc_target)
static int aarch64_post_debug_entry(struct target *target)
static int aarch64_init_debug_access(struct target *target)
static struct aarch64_common * target_to_aarch64(struct target *target)
#define AARCH64_COMMON_MAGIC
const char * armv8_get_gdb_arch(const struct target *target)
struct reg * armv8_reg_current(struct arm *arm, unsigned int regnum)
int armv8_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
static bool is_arm(struct arm *arm)
arm_mode
Represent state of an ARM core.
static struct arm * target_to_arm(const struct target *target)
Convert target handle to generic ARM target state handle.
arm_state
The PSR "T" and "J" bits define the mode of "classic ARM" cores.
int dap_lookup_cs_component(struct adiv5_ap *ap, uint8_t type, target_addr_t *addr, int32_t core_id)
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 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 adiv5_jim_configure_ext(struct target *target, struct jim_getopt_info *goi, struct adiv5_private_config *pc, enum adiv5_configure_dap_optional optional)
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_atomic_u32(struct adiv5_ap *ap, target_addr_t address, uint32_t value)
Synchronous write of a word to memory or a system register.
@ ADI_CONFIGURE_DAP_COMPULSORY
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...
#define ARM_CS_C9_DEVTYPE_CORE_DEBUG
int arm_cti_ack_events(struct arm_cti *self, uint32_t event)
int arm_cti_write_reg(struct arm_cti *self, unsigned int reg, uint32_t value)
int arm_cti_gate_channel(struct arm_cti *self, uint32_t channel)
int arm_cti_pulse_channel(struct arm_cti *self, uint32_t channel)
int arm_cti_enable(struct arm_cti *self, bool enable)
const char * arm_cti_name(struct arm_cti *self)
struct arm_cti * cti_instance_by_jim_obj(Jim_Interp *interp, Jim_Obj *o)
int arm_cti_ungate_channel(struct arm_cti *self, uint32_t channel)
#define ARMV4_5_MRC(cp, op1, rd, crn, crm, op2)
#define ARMV4_5_MCR(cp, op1, rd, crn, crm, op2)
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.
int armv8_init_arch_info(struct target *target, struct armv8_common *armv8)
int armv8_set_dbgreg_bits(struct armv8_common *armv8, unsigned int reg, unsigned long mask, unsigned long value)
int armv8_read_mpidr(struct armv8_common *armv8)
void armv8_free_reg_cache(struct target *target)
int armv8_arch_state(struct target *target)
int armv8_mmu_translate_va_pa(struct target *target, target_addr_t va, target_addr_t *val, int meminfo)
const struct command_registration armv8_command_handlers[]
void armv8_select_reg_access(struct armv8_common *armv8, bool is_aarch64)
const char * armv8_mode_name(unsigned int psr_mode)
Map PSR mode bits to the name of an ARM processor operating mode.
int armv8_handle_cache_info_command(struct command_invocation *cmd, struct armv8_cache_common *armv8_cache)
int armv8_identify_cache(struct armv8_common *armv8)
static struct armv8_common * target_to_armv8(struct target *target)
#define CPUV8_DBG_BVR_BASE
@ ARMV8_RUNCONTROL_RESUME
#define CPUV8_DBG_MAINID0
#define CPUV8_DBG_MEMFEATURE0
#define CPUV8_DBG_DBGFEATURE0
#define CPUV8_DBG_WVR_BASE
#define CPUV8_DBG_WCR_BASE
#define CPUV8_DBG_BCR_BASE
int armv8_cache_d_inner_flush_virt(struct armv8_common *armv8, target_addr_t va, size_t size)
int armv8_cache_i_inner_inval_virt(struct armv8_common *armv8, target_addr_t va, size_t size)
void armv8_dpm_report_dscr(struct arm_dpm *dpm, uint32_t dscr)
int armv8_dpm_write_dirty_registers(struct arm_dpm *dpm, bool bpwp)
Writes all modified core registers for all processor modes.
enum arm_state armv8_dpm_get_core_state(struct arm_dpm *dpm)
Get core state from EDSCR, without necessity to retrieve CPSR.
int armv8_dpm_read_current_registers(struct arm_dpm *dpm)
Read basic registers of the current context: R0 to R15, and CPSR in AArch32 state or R0 to R31,...
int armv8_dpm_initialize(struct arm_dpm *dpm)
Reinitializes DPM state at the beginning of a new debug session or after a reset which may have affec...
int armv8_dpm_modeswitch(struct arm_dpm *dpm, enum arm_mode mode)
void armv8_dpm_handle_exception(struct arm_dpm *dpm, bool do_restore)
int armv8_dpm_setup(struct arm_dpm *dpm)
Hooks up this DPM to its associated target; call only once.
#define DSCR_SYS_ERROR_PEND
void armv8_select_opcodes(struct armv8_common *armv8, bool state_is_aarch64)
#define ARMV8_MSR_GP(system, rt)
#define ARMV8_MRS(system, rt)
#define SYSTEM_DBG_DTRTX_EL0
#define SYSTEM_DBG_DBGDTR_EL0
#define SYSTEM_DBG_DTRRX_EL0
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.
static uint64_t buf_get_u64(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 64-bit word.
static void buf_set_u64(uint8_t *_buffer, unsigned int first, unsigned int num, uint64_t value)
Sets num bits in _buffer, starting at the first bit, using the bits in value.
static void watchpoint_set(struct watchpoint *watchpoint, unsigned int number)
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 COMMAND_PARSE_ADDRESS(in, out)
#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 COMMAND_PARSE_NUMBER(type, in, out)
parses the string in into out as a type, or prints a command error and passes the error code to the c...
#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.
#define ERROR_COMMAND_ARGUMENT_INVALID
static int halted(struct target *target, const char *label)
uint64_t buffer
Pointer to data buffer to send over SPI.
uint32_t size
Size of dw_spi_transaction::buffer.
uint32_t address
Starting address. Sector aligned.
static struct esp_usb_jtag * priv
int jim_nvp_name2value_obj(Jim_Interp *interp, const struct jim_nvp *p, Jim_Obj *o, struct jim_nvp **result)
int jim_getopt_obj(struct jim_getopt_info *goi, Jim_Obj **puthere)
Remove argv[0] from the list.
int adapter_deassert_reset(void)
enum reset_types jtag_get_reset_config(void)
int adapter_assert_reset(void)
#define LOG_TARGET_INFO(target, fmt_str,...)
#define LOG_WARNING(expr ...)
#define LOG_TARGET_ERROR(target, fmt_str,...)
#define LOG_ERROR(expr ...)
#define LOG_INFO(expr ...)
#define LOG_DEBUG(expr ...)
const struct nvp * nvp_name2value(const struct nvp *p, const char *name)
const struct nvp * nvp_value2name(const struct nvp *p, int value)
void register_cache_invalidate(struct reg_cache *cache)
Marks the contents of the register cache as invalid (and clean).
target_addr_t addr
Start address to search for the control block.
const struct command_registration semihosting_common_handlers[]
const struct command_registration smp_command_handlers[]
#define foreach_smp_target(pos, head)
unsigned int common_magic
struct aarch64_brp * wp_list
uint64_t system_control_reg_curr
struct armv8_common armv8_common
struct aarch64_brp * brp_list
enum aarch64_isrmasking_mode isrmasking_mode
uint64_t system_control_reg
struct adiv5_private_config adiv5_config
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).
This wraps an implementation of DPM primitives.
target_addr_t wp_addr
Target dependent watchpoint address.
uint64_t didr
Cache of DIDR.
int(* instr_write_data_r0_64)(struct arm_dpm *dpm, uint32_t opcode, uint64_t data)
Runs one instruction, writing data to R0 before execution.
int(* instr_execute)(struct arm_dpm *dpm, uint32_t opcode)
Runs one instruction.
int(* instr_write_data_dcc_64)(struct arm_dpm *dpm, uint32_t opcode, uint64_t data)
int(* instr_write_data_dcc)(struct arm_dpm *dpm, uint32_t opcode, uint32_t data)
Runs one instruction, writing data to DCC before execution.
int(* instr_read_data_r0_64)(struct arm_dpm *dpm, uint32_t opcode, uint64_t *data)
int(* instr_cpsr_sync)(struct arm_dpm *dpm)
Optional core-specific operation invoked after CPSR writes.
uint32_t dscr
Recent value of DSCR.
Represents a generic ARM core, with standard application registers.
int(* mrc)(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t crn, uint32_t crm, uint32_t *value)
Read coprocessor register.
enum arm_mode core_mode
Record the current core mode: SVC, USR, or some other mode.
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.
struct reg_cache * core_cache
struct arm_dpm * dpm
Handle for the debug module, if one is present.
int(* mcr)(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t crn, uint32_t crm, uint32_t value)
Write coprocessor register.
enum arm_state core_state
Record the current core state: ARM, Thumb, or otherwise.
int(* flush_all_data_cache)(struct target *target)
enum run_control_op last_run_control_op
struct armv8_mmu_common armv8_mmu
struct adiv5_ap * debug_ap
void(* pre_restore_context)(struct target *target)
int(* examine_debug_reason)(struct target *target)
int(* post_debug_entry)(struct target *target)
int(* read_physical_memory)(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
struct armv8_cache_common armv8_cache
enum breakpoint_type type
const struct command_registration * chain
If non-NULL, the commands in chain will be registered in the same context and scope of this registrat...
A TCL -ish GetOpt like code.
Name Value Pairs, aka: NVP.
Name Value Pairs, aka: NVP.
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 list_head * smp_targets
struct watchpoint * watchpoints
uint64_t target_buffer_get_u64(struct target *target, const uint8_t *buffer)
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)
void target_buffer_set_u32(struct target *target, uint8_t *buffer, uint32_t value)
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_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...
void target_buffer_set_u64(struct target *target, uint8_t *buffer, uint64_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)
uint32_t target_buffer_get_u32(struct target *target, const uint8_t *buffer)
#define ERROR_TARGET_NOT_HALTED
static bool target_was_examined(const struct target *target)
@ TARGET_TIMER_TYPE_PERIODIC
@ TARGET_EVENT_DEBUG_RESUMED
@ TARGET_EVENT_DEBUG_HALTED
@ TARGET_EVENT_RESET_ASSERT
static const char * target_name(const struct target *target)
Returns the instance-specific name of the specified target.
#define ERROR_TARGET_NOT_EXAMINED
#define ERROR_TARGET_TIMEOUT
#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)