99 LOG_ERROR(
"cannot read system control register in this mode: (%s : 0x%x)",
132 LOG_ERROR(
"trying to enable mmu on target stopped with mmu disable");
207 LOG_DEBUG(
"Examine %s failed",
"oslock");
279 uint32_t
mask, uint32_t val,
int *p_result, uint32_t *p_prsr)
294 *p_result = (prsr &
mask) == (val &
mask);
333 if (exc_target && curr ==
target)
357 if (exc_target && first)
416 bool all_halted =
true;
465 LOG_DEBUG(
"Halting remaining targets in SMP group");
484 if (curr == gdb_target)
494 if (gdb_target && gdb_target !=
target)
533 switch (prev_target_state) {
564 uint64_t *address,
int handle_breakpoints,
int debug_execution)
573 if (!debug_execution)
579 resume_pc = *address;
581 *address = resume_pc;
588 resume_pc &= 0xFFFFFFFC;
591 resume_pc &= 0xFFFFFFFFFFFFFFFC;
601 LOG_ERROR(
"How do I resume into Jazelle state??");
604 LOG_DEBUG(
"resume pc = 0x%016" PRIx64, resume_pc);
638 LOG_ERROR(
"DSCR.ITE must be set before leaving debug!");
640 LOG_ERROR(
"DSCR.ERR must be cleared before leaving debug!");
788 bool all_resumed =
true;
820 LOG_ERROR(
"%s: timeout waiting for target resume", __func__);
840 target_addr_t address,
int handle_breakpoints,
int debug_execution)
843 uint64_t
addr = address;
876 bool all_resumed =
true;
929 if (!debug_execution) {
1047 LOG_ERROR(
"cannot read system control register in this mode: (%s : 0x%x)",
1083 int handle_breakpoints)
1125 LOG_ERROR(
"Failed to restart non-stepping targets in SMP group");
1128 LOG_DEBUG(
"Restarted all non-stepping targets in SMP group");
1139 LOG_DEBUG(
"target step-resumed at 0x%" PRIx64, address);
1140 if (!handle_breakpoints)
1154 LOG_ERROR(
"timeout waiting for target %s halt after step",
1184 return saved_retval;
1222 uint8_t byte_addr_select = 0x0F;
1234 while (brp_list[brp_i].
used && (brp_i < aarch64->brp_num))
1236 if (brp_i >= aarch64->
brp_num) {
1237 LOG_ERROR(
"ERROR Can not find free Breakpoint Register Pair");
1243 control = ((matchmode & 0x7) << 20)
1245 | (byte_addr_select << 5)
1247 brp_list[brp_i].
used = 1;
1250 bpt_value = brp_list[brp_i].
value;
1254 (uint32_t)(bpt_value & 0xFFFFFFFF));
1259 (uint32_t)(bpt_value >> 32));
1270 brp_list[brp_i].
value);
1280 LOG_ERROR(
"bug: breakpoint length should be 4 in AArch64 mode");
1343 uint8_t byte_addr_select = 0x0F;
1353 while ((brp_list[brp_i].
used ||
1357 if (brp_i >= aarch64->
brp_num) {
1358 LOG_ERROR(
"ERROR Can not find free Breakpoint Register Pair");
1363 control = ((matchmode & 0x7) << 20)
1365 | (byte_addr_select << 5)
1367 brp_list[brp_i].
used = 1;
1372 brp_list[brp_i].
value);
1382 brp_list[brp_i].
value);
1392 uint32_t control_ctx, control_iva;
1393 uint8_t ctx_byte_addr_select = 0x0F;
1394 uint8_t iva_byte_addr_select = 0x0F;
1395 uint8_t ctx_machmode = 0x03;
1396 uint8_t iva_machmode = 0x01;
1406 while ((brp_list[brp_1].
used ||
1410 LOG_DEBUG(
"brp(CTX) found num: %d", brp_1);
1411 if (brp_1 >= aarch64->
brp_num) {
1412 LOG_ERROR(
"ERROR Can not find free Breakpoint Register Pair");
1416 while ((brp_list[brp_2].
used ||
1417 (brp_list[brp_2].
type !=
BRP_NORMAL)) && (brp_2 < aarch64->brp_num))
1420 LOG_DEBUG(
"brp(IVA) found num: %d", brp_2);
1421 if (brp_2 >= aarch64->
brp_num) {
1422 LOG_ERROR(
"ERROR Can not find free Breakpoint Register Pair");
1428 control_ctx = ((ctx_machmode & 0x7) << 20)
1431 | (ctx_byte_addr_select << 5)
1433 brp_list[brp_1].
used = 1;
1435 brp_list[brp_1].
control = control_ctx;
1438 brp_list[brp_1].
value);
1447 control_iva = ((iva_machmode & 0x7) << 20)
1450 | (iva_byte_addr_select << 5)
1452 brp_list[brp_2].
used = 1;
1454 brp_list[brp_2].
control = control_iva;
1457 brp_list[brp_2].
value & 0xFFFFFFFF);
1462 brp_list[brp_2].
value >> 32);
1490 if (brp_i >= aarch64->
brp_num) {
1491 LOG_DEBUG(
"Invalid BRP number in breakpoint");
1496 brp_list[brp_i].
used = 0;
1497 brp_list[brp_i].
value = 0;
1506 (uint32_t)brp_list[brp_i].
value);
1511 (uint32_t)brp_list[brp_i].
value);
1514 if ((brp_j < 0) || (brp_j >= aarch64->
brp_num)) {
1515 LOG_DEBUG(
"Invalid BRP number in breakpoint");
1518 LOG_DEBUG(
"rbp %i control 0x%0" PRIx32
" value 0x%0" PRIx64, brp_j,
1520 brp_list[brp_j].
used = 0;
1521 brp_list[brp_j].
value = 0;
1530 (uint32_t)brp_list[brp_j].
value);
1535 (uint32_t)brp_list[brp_j].
value);
1545 if (brp_i >= aarch64->
brp_num) {
1546 LOG_DEBUG(
"Invalid BRP number in breakpoint");
1549 LOG_DEBUG(
"rbp %i control 0x%0" PRIx32
" value 0x%0" PRIx64, brp_i,
1551 brp_list[brp_i].
used = 0;
1552 brp_list[brp_i].
value = 0;
1561 brp_list[brp_i].
value);
1567 (uint32_t)brp_list[brp_i].
value);
1613 LOG_INFO(
"no hardware breakpoint available");
1629 LOG_INFO(
"no hardware breakpoint available");
1645 LOG_INFO(
"no hardware breakpoint available");
1692 while (wp_list[wp_i].
used && (wp_i < aarch64->wp_num))
1694 if (wp_i >= aarch64->
wp_num) {
1695 LOG_ERROR(
"ERROR Can not find free Watchpoint Register Pair");
1720 LOG_WARNING(
"Adjust watchpoint match inside 8-byte boundary");
1730 (uint32_t)(wp_list[wp_i].
value & 0xFFFFFFFF));
1735 (uint32_t)(wp_list[wp_i].
value >> 32));
1754 wp_list[wp_i].
used = 1;
1775 if (wp_i >= aarch64->
wp_num) {
1776 LOG_DEBUG(
"Invalid WP number in watchpoint");
1779 LOG_DEBUG(
"rwp %i control 0x%0" PRIx32
" value 0x%0" PRIx64, wp_i,
1781 wp_list[wp_i].
used = 0;
1782 wp_list[wp_i].
value = 0;
1791 wp_list[wp_i].
value);
1797 (uint32_t)wp_list[wp_i].
value);
1812 LOG_INFO(
"no hardware watchpoint available");
1853 if (exception_address == 0xFFFFFFFF)
1858 *hit_watchpoint = wp;
1877 LOG_DEBUG(
"EDECR = 0x%08" PRIx32
", enable=%d", edecr, enable);
1903 was_triggered = !!(edesr &
ESR_RC);
1905 was_triggered ?
"triggered" :
"NOT triggered!");
1907 if (was_triggered) {
1952 LOG_WARNING(
"%s: Error enabling Reset Catch debug event; the CPU will not halt immediately after reset!",
1955 LOG_WARNING(
"%s: Target not examined, will not halt immediately after reset!",
2005 LOG_WARNING(
"%s: Clearing Reset Catch debug event failed",
2011 LOG_WARNING(
"%s: Disabling Reset Catch debug event failed",
2015 LOG_WARNING(
"%s: ran after reset and before halt ...",
2050 uint32_t data, opcode;
2090 uint32_t
count,
const uint8_t *
buffer, uint32_t *dscr)
2123 uint64_t address, uint32_t
size,
2177 if (
size == 4 && (address % 4) == 0)
2200 LOG_ERROR(
"abort occurred - dscr = 0x%08" PRIx32, dscr);
2229 uint32_t opcode, data;
2348 LOG_DEBUG(
"Reading CPU memory address 0x%016" PRIx64
" size %" PRIu32
" count %" PRIu32,
2395 if (
size == 4 && (address % 4) == 0)
2419 LOG_ERROR(
"abort occurred - dscr = 0x%08" PRIx32, dscr);
2447 int mmu_enabled = 0;
2484 int mmu_enabled = 0;
2541 uint64_t debug, ttypr;
2543 uint32_t tmp0, tmp1, tmp2, tmp3;
2544 debug = ttypr = cpuid = 0;
2554 LOG_ERROR(
"Could not find APB-AP for debug access");
2568 LOG_ERROR(
"Could not initialize the APB-AP");
2588 LOG_DEBUG(
"Examine %s failed",
"oslock");
2595 LOG_DEBUG(
"Examine %s failed",
"CPUID");
2604 LOG_DEBUG(
"Examine %s failed",
"Memory Model Type");
2612 LOG_DEBUG(
"Examine %s failed",
"ID_AA64DFR0_EL1");
2623 ttypr = (ttypr << 32) | tmp0;
2625 debug = (debug << 32) | tmp2;
2627 LOG_DEBUG(
"cpuid = 0x%08" PRIx32, cpuid);
2628 LOG_DEBUG(
"ttypr = 0x%08" PRIx64, ttypr);
2629 LOG_DEBUG(
"debug = 0x%08" PRIx64, debug);
2643 aarch64->
brp_num = (uint32_t)((debug >> 12) & 0x0F) + 1;
2647 for (i = 0; i < aarch64->
brp_num; i++) {
2659 aarch64->
wp_num = (uint32_t)((debug >> 20) & 0x0F) + 1;
2662 for (i = 0; i < aarch64->
wp_num; i++) {
2670 LOG_DEBUG(
"Configured %i hw breakpoints, %i watchpoints",
2789 { .name =
NULL, .value = -1 }
2818 if (e != JIM_CONTINUE)
2822 if (goi->
argc > 0) {
2823 Jim_SetEmptyResult(goi->
interp);
2829 return JIM_CONTINUE;
2845 Jim_SetResultString(goi->
interp,
"CTI name invalid!", -1);
2850 if (goi->
argc != 0) {
2851 Jim_WrongNumArgs(goi->
interp,
2857 if (!pc || !pc->
cti) {
2858 Jim_SetResultString(goi->
interp,
"CTI not configured", -1);
2867 return JIM_CONTINUE;
2932 static const struct jim_nvp nvp_maskisr_modes[] = {
2935 { .name =
NULL, .value = -1 },
2955 static int jim_mcrmrc(Jim_Interp *interp,
int argc, Jim_Obj *
const *argv)
2962 bool is_mcr =
false;
2965 if (!strcmp(c->
name,
"mcr")) {
2977 LOG_ERROR(
"%s: no current target", __func__);
2999 if (argc != arg_cnt) {
3000 LOG_ERROR(
"%s: wrong number of arguments", __func__);
3017 retval = Jim_GetLong(interp, argv[1], &l);
3018 if (retval != JIM_OK)
3021 LOG_ERROR(
"%s: %s %d out of range", __func__,
3022 "coprocessor", (
int) l);
3027 retval = Jim_GetLong(interp, argv[2], &l);
3028 if (retval != JIM_OK)
3031 LOG_ERROR(
"%s: %s %d out of range", __func__,
3037 retval = Jim_GetLong(interp, argv[3], &l);
3038 if (retval != JIM_OK)
3041 LOG_ERROR(
"%s: %s %d out of range", __func__,
3047 retval = Jim_GetLong(interp, argv[4], &l);
3048 if (retval != JIM_OK)
3051 LOG_ERROR(
"%s: %s %d out of range", __func__,
3057 retval = Jim_GetLong(interp, argv[5], &l);
3058 if (retval != JIM_OK)
3061 LOG_ERROR(
"%s: %s %d out of range", __func__,
3069 if (is_mcr ==
true) {
3070 retval = Jim_GetLong(interp, argv[6], &l);
3071 if (retval != JIM_OK)
3077 retval =
arm->
mcr(
target, cpnum, op1, op2, crn, crm, value);
3083 retval =
arm->
mrc(
target, cpnum, op1, op2, crn, crm, &value);
3087 Jim_SetResult(interp, Jim_NewIntObj(interp, value));
3095 .
name =
"cache_info",
3096 .handler = aarch64_handle_cache_info_command,
3098 .help =
"display information about target caches",
3103 .handler = aarch64_handle_dbginit_command,
3105 .help =
"Initialize core debug",
3109 .name =
"disassemble",
3110 .handler = aarch64_handle_disassemble_command,
3112 .help =
"Disassemble instructions",
3113 .usage =
"address [count]",
3117 .handler = aarch64_mask_interrupts_command,
3119 .help =
"mask aarch64 interrupts during single-step",
3120 .usage =
"['on'|'off']",
3126 .help =
"write coprocessor register",
3127 .usage =
"cpnum op1 CRn CRm op2 value",
3133 .help =
"read coprocessor register",
3134 .usage =
"cpnum op1 CRn CRm op2",
3148 .help =
"ARM Command Group",
3158 .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_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 aarch64_write_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
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 jim_mcrmrc(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
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
struct reg * armv8_reg_current(struct arm *arm, unsigned regnum)
const char * armv8_get_gdb_arch(struct target *target)
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.
arm_state
The PSR "T" and "J" bits define the mode of "classic ARM" cores.
static struct arm * target_to_arm(struct target *target)
Convert target handle to generic ARM target state handle.
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 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 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.
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[]
const char * armv8_mode_name(unsigned psr_mode)
Map PSR mode bits to the name of an ARM processor operating mode.
void armv8_select_reg_access(struct armv8_common *armv8, bool is_aarch64)
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; sets the core mode (such as USR or ...
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_u64(uint8_t *_buffer, unsigned first, unsigned num, uint64_t value)
Sets num bits in _buffer, starting at the first bit, using the bits in value.
static void buf_set_u32(uint8_t *_buffer, unsigned first, unsigned 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 first, unsigned num)
Retrieves num bits from _buffer, starting at the first bit, returning the bits in a 64-bit word.
static void watchpoint_set(struct watchpoint *watchpoint, unsigned int number)
static void breakpoint_hw_set(struct breakpoint *breakpoint, unsigned int hw_number)
struct command_context * current_command_context(Jim_Interp *interp)
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_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...
static struct command * jim_to_command(Jim_Interp *interp)
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
static int halted(struct target *target, const char *label)
static struct esp_usb_jtag * priv
struct jim_nvp * jim_nvp_name2value_simple(const struct jim_nvp *p, const char *name)
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.
struct jim_nvp * jim_nvp_value2name_simple(const struct jim_nvp *p, int value)
int adapter_deassert_reset(void)
enum reset_types jtag_get_reset_config(void)
int adapter_assert_reset(void)
#define LOG_WARNING(expr ...)
#define LOG_TARGET_ERROR(target, fmt_str,...)
#define LOG_ERROR(expr ...)
#define LOG_INFO(expr ...)
#define LOG_DEBUG(expr ...)
void register_cache_invalidate(struct reg_cache *cache)
Marks the contents of the register cache as invalid (and clean).
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)
uint32_t system_control_reg
unsigned int common_magic
struct aarch64_brp * wp_list
uint32_t system_control_reg_curr
struct armv8_common armv8_common
struct aarch64_brp * brp_list
enum aarch64_isrmasking_mode isrmasking_mode
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_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_r0)(struct arm_dpm *dpm, uint32_t opcode, uint32_t data)
Runs one instruction, writing data to R0 before execution.
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)(struct arm_dpm *dpm, uint32_t opcode, uint32_t *data)
Runs one instruction, reading data from r0 after execution.
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.
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
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)
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.
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...
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.
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
#define ERROR_TARGET_INVALID
@ TARGET_TIMER_TYPE_PERIODIC
@ TARGET_EVENT_DEBUG_RESUMED
@ TARGET_EVENT_DEBUG_HALTED
@ TARGET_EVENT_RESET_ASSERT
static const char * target_name(struct target *target)
Returns the instance-specific name of the specified target.
#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.
static bool target_was_examined(struct target *target)
int target_request(struct target *target, uint32_t request)