armv8->debug_base + CPUV8_DBG_DSCR, &dscr);
if (retval != ERROR_OK)
return retval;
- aarch64->cpudbg_dscr = dscr;
if (DSCR_RUN_MODE(dscr) == 0x3) {
if (prev_target_state != TARGET_HALTED) {
static int aarch64_debug_entry(struct target *target)
{
int retval = ERROR_OK;
- struct aarch64_common *aarch64 = target_to_aarch64(target);
struct armv8_common *armv8 = target_to_armv8(target);
struct arm_dpm *dpm = &armv8->dpm;
enum arm_state core_state;
+ uint32_t dscr;
+
+ /* make sure to clear all sticky errors */
+ retval = mem_ap_write_atomic_u32(armv8->debug_ap,
+ armv8->debug_base + CPUV8_DBG_DRCR, DRCR_CSE);
+ if (retval == ERROR_OK)
+ retval = mem_ap_read_atomic_u32(armv8->debug_ap,
+ armv8->debug_base + CPUV8_DBG_DSCR, &dscr);
- LOG_DEBUG("%s dscr = 0x%08" PRIx32, target_name(target), aarch64->cpudbg_dscr);
+ if (retval != ERROR_OK)
+ return retval;
+
+ LOG_DEBUG("%s dscr = 0x%08" PRIx32, target_name(target), dscr);
- dpm->dscr = aarch64->cpudbg_dscr;
+ dpm->dscr = dscr;
core_state = armv8_dpm_get_core_state(dpm);
armv8_select_opcodes(armv8, core_state == ARM_STATE_AARCH64);
armv8_select_reg_access(armv8, core_state == ARM_STATE_AARCH64);
- /* make sure to clear all sticky errors */
- retval = mem_ap_write_atomic_u32(armv8->debug_ap,
- armv8->debug_base + CPUV8_DBG_DRCR, DRCR_CSE);
-
/* discard async exceptions */
if (retval == ERROR_OK)
retval = dpm->instr_cpsr_sync(dpm);
return retval;
/* Examine debug reason */
- armv8_dpm_report_dscr(dpm, aarch64->cpudbg_dscr);
+ armv8_dpm_report_dscr(dpm, dscr);
/* save address of instruction that triggered the watchpoint? */
if (target->debug_reason == DBG_REASON_WATCHPOINT) {
(aarch64->system_control_reg & 0x4U) ? 1 : 0;
armv8->armv8_mmu.armv8_cache.i_cache_enabled =
(aarch64->system_control_reg & 0x1000U) ? 1 : 0;
- aarch64->curr_mode = armv8->arm.core_mode;
return ERROR_OK;
}
armv8->arm.dap = tap->dap;
- aarch64->fast_reg_read = 0;
-
/* register arch-specific functions */
armv8->examine_debug_reason = NULL;
int common_magic;
/* Context information */
- uint32_t cpudbg_dscr;
-
uint32_t system_control_reg;
uint32_t system_control_reg_curr;
- enum arm_mode curr_mode;
-
-
/* Breakpoint register pairs */
int brp_num_context;
int brp_num;
int brp_num_available;
struct aarch64_brp *brp_list;
- /* Use aarch64_read_regs_through_mem for fast register reads */
- int fast_reg_read;
-
struct armv8_common armv8_common;
-
};
static inline struct aarch64_common *