+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;
+}
+
+