aboutsummaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2022-05-16 10:22:32 -0700
committerAntonio Borneo <borneo.antonio@gmail.com>2022-05-27 22:52:35 +0000
commitbce93f6d513b373c1fbfb42a12cfeb2305d5e822 (patch)
tree4c5a1e7c034b5c022407c7c062c36ab237eca31b /src/target
parent390720c283992a0a6e8d7aea94924a15d3c8e900 (diff)
downloadriscv-openocd-bce93f6d513b373c1fbfb42a12cfeb2305d5e822.zip
riscv-openocd-bce93f6d513b373c1fbfb42a12cfeb2305d5e822.tar.gz
riscv-openocd-bce93f6d513b373c1fbfb42a12cfeb2305d5e822.tar.bz2
Give each SMP group a unique number.
This helps e.g. if there are 8 cores, and cores 0--3 are in one SMP group while 4--7 are in another group. (And there are 2 gdb instances connected, one debugging the first group, and one the second.) Signed-off-by: Tim Newsome <tim@sifive.com> Change-Id: I7b6c9382eadf964529105eaf0411a42d48768668 Reviewed-on: https://review.openocd.org/c/openocd/+/6979 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/target')
-rw-r--r--src/target/target.c4
-rw-r--r--src/target/target.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/target/target.c b/src/target/target.c
index 8edd632..596364c 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -6444,6 +6444,7 @@ static int jim_target_smp(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
int i;
const char *targetname;
int retval, len;
+ static int smp_group = 1;
struct target *target = NULL;
struct target_list *head, *new;
@@ -6475,9 +6476,10 @@ static int jim_target_smp(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
/* now parse the list of cpu and put the target in smp mode*/
foreach_smp_target(head, lh) {
target = head->target;
- target->smp = 1;
+ target->smp = smp_group;
target->smp_targets = lh;
}
+ smp_group++;
if (target && target->rtos)
retval = rtos_smp_init(target);
diff --git a/src/target/target.h b/src/target/target.h
index 1f1a354..45ef962 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -200,7 +200,7 @@ struct target {
bool rtos_auto_detect; /* A flag that indicates that the RTOS has been specified as "auto"
* and must be detected when symbols are offered */
struct backoff_timer backoff;
- int smp; /* add some target attributes for smp support */
+ int smp; /* Unique non-zero number for each SMP group */
struct list_head *smp_targets; /* list all targets in this smp group/cluster
* The head of the list is shared between the
* cluster, thus here there is a pointer */