aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Welwarsky <matthias.welwarsky@sysgo.com>2016-09-26 11:44:25 +0200
committerMatthias Welwarsky <matthias.welwarsky@sysgo.com>2017-02-10 14:18:34 +0100
commitfc3ce94bba5420402ea11f37d2113b0b9e380bd0 (patch)
tree16aab5c1017e261186ef9d84230e3a54a174ec60
parent40ce7374d3d6c495834b41f0a98f0bd6cb620dc4 (diff)
aarch64: slightly simplify breakpoint set function
Set HDE bit through helper function instead of manual mem_ap access. Change-Id: I68c157870f3f3c47a875d425ade6e975d8075424 Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
-rw-r--r--src/target/aarch64.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/target/aarch64.c b/src/target/aarch64.c
index 05abe6b..f818344 100644
--- a/src/target/aarch64.c
+++ b/src/target/aarch64.c
@@ -861,7 +861,6 @@ static int aarch64_set_breakpoint(struct target *target,
struct aarch64_common *aarch64 = target_to_aarch64(target);
struct armv8_common *armv8 = &aarch64->armv8_common;
struct aarch64_brp *brp_list = aarch64->brp_list;
- uint32_t dscr;
if (breakpoint->set) {
LOG_WARNING("breakpoint already set");
@@ -940,12 +939,8 @@ static int aarch64_set_breakpoint(struct target *target,
breakpoint->set = 0x11; /* Any nice value but 0 */
}
- retval = mem_ap_read_atomic_u32(armv8->debug_ap,
- armv8->debug_base + CPUV8_DBG_DSCR, &dscr);
/* Ensure that halting debug mode is enable */
- dscr = dscr | DSCR_HDE;
- retval = mem_ap_write_atomic_u32(armv8->debug_ap,
- armv8->debug_base + CPUV8_DBG_DSCR, dscr);
+ retval = aarch64_set_dscr_bits(target, DSCR_HDE, DSCR_HDE);
if (retval != ERROR_OK) {
LOG_DEBUG("Failed to set DSCR.HDE");
return retval;