smp: move command deprecation to startup.tcl
[fw/openocd] / src / target / smp.c
index 87944331e059aa3d865e094784e8ad7b23a5eecb..6501dc08a790982cb5c88a2c6536e9f38187014f 100644 (file)
@@ -106,7 +106,7 @@ COMMAND_HANDLER(default_handle_smp_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        if (!CMD_ARGC) {
-               command_print(CMD_CTX, "%s", target->smp ? "on" : "off");
+               command_print(CMD, "%s", target->smp ? "on" : "off");
                return ERROR_OK;
        }
 
@@ -131,24 +131,25 @@ COMMAND_HANDLER(default_handle_smp_command)
        return ERROR_COMMAND_SYNTAX_ERROR;
 }
 
-COMMAND_HANDLER(deprecated_handle_smp_on_command)
+COMMAND_HANDLER(handle_smp_gdb_command)
 {
-       const char *argv[] = {"on", NULL};
-
-       LOG_WARNING("\'smp_on\' is deprecated, please use \'smp on\' instead.");
-       CMD_ARGC = 1;
-       CMD_ARGV = argv;
-       return CALL_COMMAND_HANDLER(default_handle_smp_command);
-}
-
-COMMAND_HANDLER(deprecated_handle_smp_off_command)
-{
-       const char *argv[] = {"off", NULL};
+       struct target *target = get_current_target(CMD_CTX);
+       int retval = ERROR_OK;
+       struct target_list *head;
+       head = target->head;
+       if (head != (struct target_list *)NULL) {
+               if (CMD_ARGC == 1) {
+                       int coreid = 0;
+                       COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], coreid);
+                       if (ERROR_OK != retval)
+                               return retval;
+                       target->gdb_service->core[1] = coreid;
 
-       LOG_WARNING("\'smp_off\' is deprecated, please use \'smp off\' instead.");
-       CMD_ARGC = 1;
-       CMD_ARGV = argv;
-       return CALL_COMMAND_HANDLER(default_handle_smp_command);
+               }
+               command_print(CMD, "gdb coreid  %" PRId32 " -> %" PRId32, target->gdb_service->core[0]
+                       , target->gdb_service->core[1]);
+       }
+       return ERROR_OK;
 }
 
 const struct command_registration smp_command_handlers[] = {
@@ -160,17 +161,10 @@ const struct command_registration smp_command_handlers[] = {
                .usage = "[on|off]",
        },
        {
-               .name = "smp_on",
-               .handler = deprecated_handle_smp_on_command,
-               .mode = COMMAND_EXEC,
-               .help = "Restart smp handling",
-               .usage = "",
-       },
-       {
-               .name = "smp_off",
-               .handler = deprecated_handle_smp_off_command,
+               .name = "smp_gdb",
+               .handler = handle_smp_gdb_command,
                .mode = COMMAND_EXEC,
-               .help = "Stop smp handling",
+               .help = "display/fix current core played to gdb",
                .usage = "",
        },
        COMMAND_REGISTRATION_DONE