aboutsummaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2019-01-25 15:31:42 -0800
committerTim Newsome <tim@sifive.com>2019-01-25 15:31:42 -0800
commite186f62962673a3bfdee151693521d46f2adcefb (patch)
tree3019ca0f1cbe2fa157bd88442cf0021b48a3ca6c /src/target
parent96df1db7b17b5a2298150f21c1c1bee00ffbe0f9 (diff)
downloadriscv-openocd-e186f62962673a3bfdee151693521d46f2adcefb.zip
riscv-openocd-e186f62962673a3bfdee151693521d46f2adcefb.tar.gz
riscv-openocd-e186f62962673a3bfdee151693521d46f2adcefb.tar.bz2
More cleanup.
Change-Id: I804bdcec23b69d77dfc376e23c6d1f29f99e7335
Diffstat (limited to 'src/target')
-rw-r--r--src/target/breakpoints.c2
-rw-r--r--src/target/riscv/riscv.c45
-rw-r--r--src/target/target.c2
3 files changed, 6 insertions, 43 deletions
diff --git a/src/target/breakpoints.c b/src/target/breakpoints.c
index f76c318..58e4f61 100644
--- a/src/target/breakpoints.c
+++ b/src/target/breakpoints.c
@@ -549,8 +549,6 @@ int watchpoint_hit(struct target *target, enum watchpoint_rw *rw,
int retval;
struct watchpoint *hit_watchpoint;
- LOG_DEBUG("[%d]", target->coreid);
-
retval = target_hit_watchpoint(target, &hit_watchpoint);
if (retval != ERROR_OK)
return ERROR_FAIL;
diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c
index 6ba6127..01b84bf 100644
--- a/src/target/riscv/riscv.c
+++ b/src/target/riscv/riscv.c
@@ -648,33 +648,12 @@ static void trigger_from_watchpoint(struct trigger *trigger,
int riscv_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
{
- LOG_DEBUG("[%d] @0x%" TARGET_PRIxADDR, target->coreid, watchpoint->address);
struct trigger trigger;
trigger_from_watchpoint(&trigger, watchpoint);
- if (target->smp) {
- struct target *failed = NULL;
- for (struct target_list *list = target->head; list != NULL;
- list = list->next) {
- struct target *t = list->target;
- if (add_trigger(t, &trigger) != ERROR_OK) {
- failed = t;
- break;
- }
- }
- if (failed) {
- for (struct target_list *list = target->head;
- list->target != failed; list = list->next) {
- struct target *t = list->target;
- remove_trigger(t, &trigger);
- }
- return ERROR_FAIL;
- }
- } else {
- int result = add_trigger(target, &trigger);
- if (result != ERROR_OK)
- return result;
- }
+ int result = add_trigger(target, &trigger);
+ if (result != ERROR_OK)
+ return result;
watchpoint->set = true;
return ERROR_OK;
@@ -688,21 +667,9 @@ int riscv_remove_watchpoint(struct target *target,
struct trigger trigger;
trigger_from_watchpoint(&trigger, watchpoint);
- if (target->smp) {
- bool failed = false;
- for (struct target_list *list = target->head; list != NULL;
- list = list->next) {
- struct target *t = list->target;
- if (remove_trigger(t, &trigger) != ERROR_OK)
- failed = true;
- }
- if (failed)
- return ERROR_FAIL;
- } else {
- int result = remove_trigger(target, &trigger);
- if (result != ERROR_OK)
- return result;
- }
+ int result = remove_trigger(target, &trigger);
+ if (result != ERROR_OK)
+ return result;
watchpoint->set = false;
return ERROR_OK;
diff --git a/src/target/target.c b/src/target/target.c
index 8b94fc9..ffd82fb 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -1206,8 +1206,6 @@ int target_hit_watchpoint(struct target *target,
return ERROR_FAIL;
}
- LOG_DEBUG("[%d]", target->coreid);
-
return target->type->hit_watchpoint(target, hit_watchpoint);
}