dsp5680xx: disable for now, it generates warnings
[openocd.git] / src / target / target.c
index 026ca13b9c41875b43bac347893d7b42b3b50bd3..f62915ef35ebb21240160786706c849bebb888b0 100644 (file)
  *   Copyright (C) 2008 by Rick Altherr                                    *
  *   kc8apf@kc8apf.net>                                                    *
  *                                                                         *
+ *   Copyright (C) 2011 by Broadcom Corporation                            *
+ *   Evan Hunter - ehunter@broadcom.com                                    *
+ *                                                                         *
+ *   Copyright (C) ST-Ericsson SA 2011                                     *
+ *   michel.jaouen@stericsson.com : smp minimum support                    *
+ *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
@@ -44,6 +50,7 @@
 #include "register.h"
 #include "trace.h"
 #include "image.h"
+#include "rtos/rtos.h"
 
 
 static int target_read_buffer_default(struct target *target, uint32_t address,
@@ -74,6 +81,7 @@ extern struct target_type arm11_target;
 extern struct target_type mips_m4k_target;
 extern struct target_type avr_target;
 extern struct target_type dsp563xx_target;
+//extern struct target_type dsp5680xx_target;
 extern struct target_type testee_target;
 extern struct target_type avr32_ap7k_target;
 
@@ -96,6 +104,8 @@ static struct target_type *target_types[] =
        &mips_m4k_target,
        &avr_target,
        &dsp563xx_target,
+// Disabled for now, it generates warnings
+//     &dsp5680xx_target,
        &testee_target,
        &avr32_ap7k_target,
        NULL,
@@ -725,7 +735,7 @@ int target_bulk_write_memory(struct target *target,
 int target_add_breakpoint(struct target *target,
                struct breakpoint *breakpoint)
 {
-       if (target->state != TARGET_HALTED) {
+       if ((target->state != TARGET_HALTED)&&(breakpoint->type!=BKPT_HARD)) {
                LOG_WARNING("target %s is not halted", target->cmd_name);
                return ERROR_TARGET_NOT_HALTED;
        }
@@ -3704,6 +3714,7 @@ enum target_cfg_param {
        TCFG_COREID,
        TCFG_CHAIN_POSITION,
        TCFG_DBGBASE,
+       TCFG_RTOS,
 };
 
 static Jim_Nvp nvp_config_opts[] = {
@@ -3718,6 +3729,7 @@ static Jim_Nvp nvp_config_opts[] = {
        { .name = "-coreid",           .value = TCFG_COREID },
        { .name = "-chain-position",   .value = TCFG_CHAIN_POSITION },
        { .name = "-dbgbase",          .value = TCFG_DBGBASE },
+       { .name = "-rtos",             .value = TCFG_RTOS },
        { .name = NULL, .value = -1 }
 };
 
@@ -3925,6 +3937,7 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target)
                        /* loop for more e*/
                        break;
 
+
                case TCFG_ENDIAN:
                        if (goi->isconfigure) {
                                e = Jim_GetOpt_Nvp(goi, nvp_target_endian, &n);
@@ -3975,7 +3988,7 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target)
                                if (e != JIM_OK) {
                                        return e;
                                }
-                               target->coreid = (int)w;
+                               target->coreid = (int32_t)w;
                        } else {
                                if (goi->argc != 0) {
                                        goto no_params;
@@ -4024,6 +4037,18 @@ static int target_configure(Jim_GetOptInfo *goi, struct target *target)
                        Jim_SetResult(goi->interp, Jim_NewIntObj(goi->interp, target->dbgbase));
                        /* loop for more */
                        break;
+
+               case TCFG_RTOS:
+                       /* RTOS */
+                       {
+                               int result = rtos_create( goi, target );
+                               if ( result != JIM_OK )
+                               {
+                                       return result;
+                               }
+                       }
+                       /* loop for more */
+                       break;
                }
        } /* while (goi->argc) */
 
@@ -4746,6 +4771,9 @@ static int target_create(Jim_GetOptInfo *goi)
 
        target->endianness = TARGET_ENDIAN_UNKNOWN;
 
+       target->rtos = NULL;
+       target->rtos_auto_detect = false;
+
        /* Do the rest as "configure" options */
        goi->isconfigure = 1;
        e = target_configure(goi, target);
@@ -4872,6 +4900,61 @@ static int jim_target_names(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
        return JIM_OK;
 }
 
+static int jim_target_smp(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
+{
+       int i;
+       const char *targetname;
+       int retval,len;
+       struct target *target;
+       struct target_list *head, *curr, *new;
+    curr = (struct target_list*) NULL;
+       head = (struct target_list*) NULL;
+       new = (struct target_list*) NULL;
+
+       retval = 0;
+       LOG_DEBUG("%d",argc);
+       /* argv[1] = target to associate in smp
+        * argv[2] = target to assoicate in smp 
+        * argv[3] ...
+        */
+
+       for(i=1;i<argc;i++)
+       {
+
+               targetname = Jim_GetString(argv[i], &len);
+               target = get_target(targetname);
+               LOG_DEBUG("%s ",targetname);
+               if (target)
+               {
+                       new=malloc(sizeof(struct target_list));
+                       new->target = target;
+                       new->next = (struct target_list*)NULL;
+                       if (head == (struct target_list*)NULL)
+                       {
+                               head = new;
+                               curr = head;
+                       }
+                       else
+                       {
+                               curr->next = new;
+                               curr = new;
+                       }
+               }
+       }
+    /*  now parse the list of cpu and put the target in smp mode*/
+       curr=head;
+
+    while(curr!=(struct target_list *)NULL)
+       {
+    target=curr->target;
+       target->smp = 1;
+       target->head = head;
+       curr=curr->next;
+       }
+       return retval; 
+}
+
+
 static int jim_target_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 {
        Jim_GetOptInfo goi;
@@ -4987,6 +5070,14 @@ static const struct command_registration target_subcommand_handlers[] = {
                .help = "Returns the number of targets as an integer "
                        "(DEPRECATED)",
        },
+       {
+               .name = "smp",
+               .mode = COMMAND_ANY,
+               .jim_handler = jim_target_smp,
+               .usage = "targetname1 targetname2 ...",
+               .help = "gather several target in a smp list"
+       },
+
        COMMAND_REGISTRATION_DONE
 };
 

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)