smp: deprecate legacy SMP core switching support

The deprecation was already in the documentation since v0.11.0
through commit 85ba2dc4c6 ("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
This commit is contained in:
Antonio Borneo
2022-02-28 11:46:46 +01:00
parent 66335683fe
commit b4f8d99c8d
4 changed files with 11 additions and 51 deletions

View 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 */
@@ -53,11 +54,15 @@
/* 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) {

View File

@@ -30,8 +30,10 @@
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);