Give each SMP group a unique number. 79/6979/2
authorTim Newsome <tim@sifive.com>
Mon, 16 May 2022 17:22:32 +0000 (10:22 -0700)
committerAntonio Borneo <borneo.antonio@gmail.com>
Fri, 27 May 2022 22:52:35 +0000 (22:52 +0000)
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>
src/target/target.c
src/target/target.h

index 8edd632916a7877cacf4c5f25045f97b570221fe..596364cdc49ed233b5c13d79a23ba4a361db8781 100644 (file)
@@ -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);
index 1f1a3542077f72e11c3db9c60feae0c95a26cf4f..45ef962694697a3051f5c8161bcbf3230cbbd14a 100644 (file)
@@ -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 */

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)