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,
int handle_breakpoints,
int debug_execution)
602 if (!debug_execution)
608 resume_pc = *address;
610 *address = resume_pc;
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!");
816 bool all_resumed =
true;
848 LOG_ERROR(
"%s: timeout waiting for target resume", __func__);
868 target_addr_t address,
int handle_breakpoints,
int debug_execution)
871 uint64_t
addr = address;
906 bool all_resumed =
true;
959 if (!debug_execution) {
1078 LOG_ERROR(
"cannot read system control register in this mode: (%s : 0x%x)",
1117 int handle_breakpoints)
1160 LOG_ERROR(
"Failed to restart non-stepping targets in SMP group");
1163 LOG_DEBUG(
"Restarted all non-stepping targets in SMP group");
1174 LOG_DEBUG(
"target step-resumed at 0x%" PRIx64, address);
1175 if (!handle_breakpoints)
1189 LOG_ERROR(
"timeout waiting for target %s halt after step",
1221 return saved_retval;
1262 uint8_t byte_addr_select = 0x0F;
1274 while (brp_list[brp_i].
used && (brp_i < aarch64->brp_num))
1276 if (brp_i >= aarch64->
brp_num) {
1277 LOG_ERROR(
"ERROR Can not find free Breakpoint Register Pair");
1283 control = ((matchmode & 0x7) << 20)
1285 | (byte_addr_select << 5)
1287 brp_list[brp_i].
used = 1;
1290 bpt_value = brp_list[brp_i].
value;
1294 (uint32_t)(bpt_value & 0xFFFFFFFF));
1299 (uint32_t)(bpt_value >> 32));
1310 brp_list[brp_i].
value);
1320 LOG_ERROR(
"bug: breakpoint length should be 4 in AArch64 mode");
1383 uint8_t byte_addr_select = 0x0F;
1393 while ((brp_list[brp_i].
used ||
1397 if (brp_i >= aarch64->
brp_num) {
1398 LOG_ERROR(
"ERROR Can not find free Breakpoint Register Pair");
1403 control = ((matchmode & 0x7) << 20)
1405 | (byte_addr_select << 5)
1407 brp_list[brp_i].
used = 1;
1412 brp_list[brp_i].
value);
1422 brp_list[brp_i].
value);
1432 uint32_t control_ctx, control_iva;
1433 uint8_t ctx_byte_addr_select = 0x0F;
1434 uint8_t iva_byte_addr_select = 0x0F;
1435 uint8_t ctx_machmode = 0x03;
1436 uint8_t iva_machmode = 0x01;
1446 while ((brp_list[brp_1].
used ||
1450 LOG_DEBUG(
"brp(CTX) found num: %d", brp_1);
1451 if (brp_1 >= aarch64->
brp_num) {
1452 LOG_ERROR(
"ERROR Can not find free Breakpoint Register Pair");
1456 while ((brp_list[brp_2].
used ||
1457 (brp_list[brp_2].
type !=
BRP_NORMAL)) && (brp_2 < aarch64->brp_num))
1460 LOG_DEBUG(
"brp(IVA) found num: %d", brp_2);
1461 if (brp_2 >= aarch64->
brp_num) {
1462 LOG_ERROR(
"ERROR Can not find free Breakpoint Register Pair");
1468 control_ctx = ((ctx_machmode & 0x7) << 20)
1471 | (ctx_byte_addr_select << 5)
1473 brp_list[brp_1].
used = 1;
1475 brp_list[brp_1].
control = control_ctx;
1478 brp_list[brp_1].
value);
1487 control_iva = ((iva_machmode & 0x7) << 20)
1490 | (iva_byte_addr_select << 5)
1492 brp_list[brp_2].
used = 1;
1494 brp_list[brp_2].
control = control_iva;
1497 brp_list[brp_2].
value & 0xFFFFFFFF);
1502 brp_list[brp_2].
value >> 32);
1530 if (brp_i >= aarch64->
brp_num) {
1531 LOG_DEBUG(
"Invalid BRP number in breakpoint");
1536 brp_list[brp_i].
used = 0;
1537 brp_list[brp_i].
value = 0;
1546 (uint32_t)brp_list[brp_i].
value);
1551 (uint32_t)brp_list[brp_i].
value);
1554 if ((brp_j < 0) || (brp_j >= aarch64->
brp_num)) {
1555 LOG_DEBUG(
"Invalid BRP number in breakpoint");
1558 LOG_DEBUG(
"rbp %i control 0x%0" PRIx32
" value 0x%0" PRIx64, brp_j,
1560 brp_list[brp_j].
used = 0;
1561 brp_list[brp_j].
value = 0;
1570 (uint32_t)brp_list[brp_j].
value);
1575 (uint32_t)brp_list[brp_j].
value);
1585 if (brp_i >= aarch64->
brp_num) {
1586 LOG_DEBUG(
"Invalid BRP number in breakpoint");
1589 LOG_DEBUG(
"rbp %i control 0x%0" PRIx32
" value 0x%0" PRIx64, brp_i,
1591 brp_list[brp_i].
used = 0;
1592 brp_list[brp_i].
value = 0;
1601 brp_list[brp_i].
value);
1607 (uint32_t)brp_list[brp_i].
value);
1653 LOG_INFO(
"no hardware breakpoint available");
1669 LOG_INFO(
"no hardware breakpoint available");
1685 LOG_INFO(
"no hardware breakpoint available");
1732 while (wp_list[wp_i].
used && (wp_i < aarch64->wp_num))
1734 if (wp_i >= aarch64->
wp_num) {
1735 LOG_ERROR(
"ERROR Can not find free Watchpoint Register Pair");
1760 LOG_WARNING(
"Adjust watchpoint match inside 8-byte boundary");
1770 (uint32_t)(wp_list[wp_i].
value & 0xFFFFFFFF));
1775 (uint32_t)(wp_list[wp_i].
value >> 32));
1794 wp_list[wp_i].
used = 1;
1815 if (wp_i >= aarch64->
wp_num) {
1816 LOG_DEBUG(
"Invalid WP number in watchpoint");
1819 LOG_DEBUG(
"rwp %i control 0x%0" PRIx32
" value 0x%0" PRIx64, wp_i,
1821 wp_list[wp_i].
used = 0;
1822 wp_list[wp_i].
value = 0;
1831 wp_list[wp_i].
value);
1837 (uint32_t)wp_list[wp_i].
value);
1852 LOG_INFO(
"no hardware watchpoint available");
1893 if (exception_address == 0xFFFFFFFF)
1898 *hit_watchpoint = wp;
1917 LOG_DEBUG(
"EDECR = 0x%08" PRIx32
", enable=%d", edecr, enable);
1943 was_triggered = !!(edesr &
ESR_RC);
1945 was_triggered ?
"triggered" :
"NOT triggered!");
1947 if (was_triggered) {
1992 LOG_WARNING(
"%s: Error enabling Reset Catch debug event; the CPU will not halt immediately after reset!",
1995 LOG_WARNING(
"%s: Target not examined, will not halt immediately after reset!",
2045 LOG_WARNING(
"%s: Clearing Reset Catch debug event failed",
2051 LOG_WARNING(
"%s: Disabling Reset Catch debug event failed",
2055 LOG_WARNING(
"%s: ran after reset and before halt ...",
2079 LOG_ERROR(
"memory write sizes greater than 4 bytes is only supported for AArch64 state");
2148 uint32_t
count,
const uint8_t *
buffer, uint32_t *dscr)
2181 uint64_t address, uint32_t
size,
2235 if (
size == 4 && (address % 4) == 0)
2258 LOG_ERROR(
"abort occurred - dscr = 0x%08" PRIx32, dscr);
2276 LOG_ERROR(
"memory read sizes greater than 4 bytes is only supported for AArch64 state");
2332 data = (uint64_t)lower | (uint64_t)higher << 32;
2431 LOG_DEBUG(
"Reading CPU memory address 0x%016" PRIx64
" size %" PRIu32
" count %" PRIu32,
2478 if (
size == 4 && (address % 4) == 0)
2502 LOG_ERROR(
"abort occurred - dscr = 0x%08" PRIx32, dscr);
2530 int mmu_enabled = 0;
2567 int mmu_enabled = 0;
2624 uint64_t debug, ttypr;
2626 uint32_t tmp0, tmp1, tmp2, tmp3;
2627 debug = ttypr = cpuid = 0;
2637 LOG_ERROR(
"Could not find APB-AP for debug access");
2651 LOG_ERROR(
"Could not initialize the APB-AP");
2671 LOG_DEBUG(
"Examine %s failed",
"oslock");
2678 LOG_DEBUG(
"Examine %s failed",
"CPUID");
2687 LOG_DEBUG(
"Examine %s failed",
"Memory Model Type");
2695 LOG_DEBUG(
"Examine %s failed",
"ID_AA64DFR0_EL1");
2706 ttypr = (ttypr << 32) | tmp0;
2708 debug = (debug << 32) | tmp2;
2710 LOG_DEBUG(
"cpuid = 0x%08" PRIx32, cpuid);
2711 LOG_DEBUG(
"ttypr = 0x%08" PRIx64, ttypr);
2712 LOG_DEBUG(
"debug = 0x%08" PRIx64, debug);
2726 aarch64->
brp_num = (uint32_t)((debug >> 12) & 0x0F) + 1;
2730 for (i = 0; i < aarch64->
brp_num; i++) {
2742 aarch64->
wp_num = (uint32_t)((debug >> 20) & 0x0F) + 1;
2745 for (i = 0; i < aarch64->
wp_num; i++) {
2753 LOG_DEBUG(
"Configured %i hw breakpoints, %i watchpoints",
2900 { .name =
NULL, .value = -1 }
2924 if (e != JIM_CONTINUE)
2928 if (goi->
argc > 0) {
2929 Jim_SetEmptyResult(goi->
interp);
2935 return JIM_CONTINUE;
2951 Jim_SetResultString(goi->
interp,
"CTI name invalid!", -1);
2956 if (goi->
argc != 0) {
2957 Jim_WrongNumArgs(goi->
interp,
2963 if (!pc || !pc->
cti) {
2964 Jim_SetResultString(goi->
interp,
"CTI not configured", -1);
2973 return JIM_CONTINUE;
3038 static const struct nvp nvp_maskisr_modes[] = {
3041 { .name =
NULL, .value = -1 },
3043 const struct nvp *n;
3063 bool is_mcr =
false;
3064 unsigned int arg_cnt = 5;
3147 int retval =
arm->
mcr(
target, cpnum, op1, op2, crn, crm, value);
3154 int retval =
arm->
mrc(
target, cpnum, op1, op2, crn, crm, &value);
3166 .
name =
"cache_info",
3167 .handler = aarch64_handle_cache_info_command,
3169 .help =
"display information about target caches",
3174 .handler = aarch64_handle_dbginit_command,
3176 .help =
"Initialize core debug",
3180 .name =
"disassemble",
3181 .handler = aarch64_handle_disassemble_command,
3183 .help =
"Disassemble instructions",
3184 .usage =
"address [count]",
3188 .handler = aarch64_mask_interrupts_command,
3190 .help =
"mask aarch64 interrupts during single-step",
3191 .usage =
"['on'|'off']",
3196 .handler = aarch64_mcrmrc_command,
3197 .help =
"write coprocessor register",
3198 .usage =
"cpnum op1 CRn CRm op2 value",
3203 .handler = aarch64_mcrmrc_command,
3204 .help =
"read coprocessor register",
3205 .usage =
"cpnum op1 CRn CRm op2",
3219 .help =
"ARM Command Group",
3229 .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_prep_restart_smp(struct target *target, int handle_breakpoints, struct target **p_first)
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 int aarch64_restore_one(struct target *target, int current, uint64_t *address, int handle_breakpoints, int debug_execution)
static const struct jim_nvp nvp_config_opts[]
static int aarch64_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
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_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 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_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_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
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_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)
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.
size_t size
Size of the control block search area.
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)