smp: deprecate legacy SMP core switching support 62/6862/2
authorAntonio Borneo <borneo.antonio@gmail.com>
Mon, 28 Feb 2022 10:46:46 +0000 (11:46 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 7 May 2022 11:00:00 +0000 (11:00 +0000)
The deprecation was already in the documentation since v0.11.0
through commit 85ba2dc4c6ab ("rtos/hwthread: add hardware-thread
pseudo rtos") but OpenOCD was not informing the user printing a
runtime message.

Remove the deprecated method from the documentation and print a
deprecated message at runtime.
There is no reliable way to print the same message in GDB console,
so we have to rely on user noticing it in the OpenOCD log.
Target is to remove the functionality after v0.12.0.

Change-Id: Idd2d9e3b6eccc92dcf0432c3c7de2f8a0fcabe9f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6862
Tested-by: jenkins
doc/openocd.texi
src/server/gdb_server.c
src/target/smp.c
src/target/smp.h

index d55002733196a394c14da9154c978328535b1e12..07d4ad70acbe33230a609a90365aacac90482119 100644 (file)
@@ -11568,57 +11568,6 @@ The @command{step} and @command{stepi} commands can be used to step a specific c
 while other cores are free-running or remain halted, depending on the
 scheduler-locking mode configured in GDB.
 
-@section Legacy SMP core switching support
-@quotation Note
-This method is deprecated in favor of the @emph{hwthread} pseudo RTOS.
-@end quotation
-
-For SMP support following GDB serial protocol packet have been defined :
-@itemize @bullet
-@item j - smp status request
-@item J - smp set request
-@end itemize
-
-OpenOCD implements :
-@itemize @bullet
-@item @option{jc} packet for reading core id displayed by
-GDB connection. Reply is @option{XXXXXXXX} (8 hex digits giving core id) or
- @option{E01} for target not smp.
-@item @option{JcXXXXXXXX} (8 hex digits) packet for setting core id displayed at next GDB continue
-(core id -1 is reserved for returning to normal resume mode). Reply @option{E01}
-for target not smp or @option{OK} on success.
-@end itemize
-
-Handling of this packet within GDB can be done :
-@itemize @bullet
-@item by the creation of an internal variable (i.e @option{_core}) by mean
-of function allocate_computed_value allowing following GDB command.
-@example
-set $_core 1
-#Jc01 packet is sent
-print $_core
-#jc packet is sent and result is affected in $
-@end example
-
-@item by the usage of GDB maintenance command as described in following example (2 cpus in SMP with
-core id 0 and 1 @pxref{definecputargetsworkinginsmp,,Define CPU targets working in SMP}).
-
-@example
-# toggle0 : force display of coreid 0
-define toggle0
-maint packet Jc0
-continue
-main packet Jc-1
-end
-# toggle1 : force display of coreid 1
-define toggle1
-maint packet Jc1
-continue
-main packet Jc-1
-end
-@end example
-@end itemize
-
 @node Tcl Scripting API
 @chapter Tcl Scripting API
 @cindex Tcl Scripting API
index fcc87fba1c45a542e5d8f6855107dcee551d3bfe..728cb53bbf3ab56316e416a1f54d50b8a8517d90 100644 (file)
@@ -3657,12 +3657,14 @@ static int gdb_input_inner(struct connection *connection)
                                        break;
 
                                case 'j':
+                                       /* DEPRECATED */
                                        /* packet supported only by smp target i.e cortex_a.c*/
                                        /* handle smp packet replying coreid played to gbd */
                                        gdb_read_smp_packet(connection, packet, packet_size);
                                        break;
 
                                case 'J':
+                                       /* DEPRECATED */
                                        /* packet supported only by smp target i.e cortex_a.c */
                                        /* handle smp packet setting coreid to be played at next
                                         * resume to gdb */
index 3e1ded8bc3e0b5e128f5f559ddcf720946556119..569abd7860a4f632a6de652042583173a7cb3b12 100644 (file)
@@ -28,6 +28,7 @@
 #include "smp.h"
 #include "helper/binarybuffer.h"
 
+/* DEPRECATED: gdb_read_smp_packet/gdb_write_smp_packet to be removed      */
 /*  implementation of new packet in gdb interface for smp feature          */
 /*                                                                         */
 /*   j : smp  status request                                               */
 /*  maint packet jc                                                        */
 
 /* packet j :smp status request */
+#define DEPRECATED_MSG "DEPRECATED: This method is deprecated in favor of the hwthread pseudo RTOS"
 int gdb_read_smp_packet(struct connection *connection,
                char const *packet, int packet_size)
 {
        struct target *target = get_target_from_connection(connection);
        int retval = ERROR_OK;
+
+       LOG_WARNING(DEPRECATED_MSG);
+
        if (target->smp) {
                if (strncmp(packet, "jc", 2) == 0) {
                        const uint32_t len = sizeof(target->gdb_service->core[0]);
@@ -83,6 +88,8 @@ int gdb_write_smp_packet(struct connection *connection,
        int coreid = 0;
        int retval = ERROR_OK;
 
+       LOG_WARNING(DEPRECATED_MSG);
+
        /* skip command character */
        if (target->smp) {
                if (strncmp(packet, "Jc", 2) == 0) {
index 490a4931051af1306e99a86626e05640c2e0c641..d373c90bc15183a0082803363c1a235687a0d7a9 100644 (file)
 
 extern const struct command_registration smp_command_handlers[];
 
+/* DEPRECATED */
 int gdb_read_smp_packet(struct connection *connection,
                char const *packet, int packet_size);
+/* DEPRECATED */
 int gdb_write_smp_packet(struct connection *connection,
                char const *packet, int packet_size);
 

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)