rtos: move in rtos.h the rtos_type's declaration

The static analyser 'sparse' complains, while compiling a rtos'
file, that the struct rtos_type is declared in the file as non
static, but it is not exposed through an include file.
The message is:
	warning: symbol 'XXX' was not declared. Should it be static?

Move the list of rtos_type's declaration in rtos.h

Change-Id: Ia96dff077407a6653b11920519c1724e4c1167a3
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7660
Tested-by: jenkins
This commit is contained in:
Antonio Borneo 2023-04-30 23:54:44 +02:00
parent ed46188a72
commit f07efff961
2 changed files with 15 additions and 16 deletions

View File

@ -15,22 +15,6 @@
#include "helper/binarybuffer.h" #include "helper/binarybuffer.h"
#include "server/gdb_server.h" #include "server/gdb_server.h"
/* RTOSs */
extern const struct rtos_type freertos_rtos;
extern const struct rtos_type threadx_rtos;
extern const struct rtos_type ecos_rtos;
extern const struct rtos_type linux_rtos;
extern const struct rtos_type chibios_rtos;
extern const struct rtos_type chromium_ec_rtos;
extern const struct rtos_type embkernel_rtos;
extern const struct rtos_type mqx_rtos;
extern const struct rtos_type ucos_iii_rtos;
extern const struct rtos_type nuttx_rtos;
extern const struct rtos_type hwthread_rtos;
extern const struct rtos_type riot_rtos;
extern const struct rtos_type zephyr_rtos;
extern const struct rtos_type rtkernel_rtos;
static const struct rtos_type *rtos_types[] = { static const struct rtos_type *rtos_types[] = {
&threadx_rtos, &threadx_rtos,
&freertos_rtos, &freertos_rtos,

View File

@ -135,4 +135,19 @@ int rtos_read_buffer(struct target *target, target_addr_t address,
int rtos_write_buffer(struct target *target, target_addr_t address, int rtos_write_buffer(struct target *target, target_addr_t address,
uint32_t size, const uint8_t *buffer); uint32_t size, const uint8_t *buffer);
extern const struct rtos_type chibios_rtos;
extern const struct rtos_type chromium_ec_rtos;
extern const struct rtos_type ecos_rtos;
extern const struct rtos_type embkernel_rtos;
extern const struct rtos_type freertos_rtos;
extern const struct rtos_type hwthread_rtos;
extern const struct rtos_type linux_rtos;
extern const struct rtos_type mqx_rtos;
extern const struct rtos_type nuttx_rtos;
extern const struct rtos_type riot_rtos;
extern const struct rtos_type rtkernel_rtos;
extern const struct rtos_type threadx_rtos;
extern const struct rtos_type ucos_iii_rtos;
extern const struct rtos_type zephyr_rtos;
#endif /* OPENOCD_RTOS_RTOS_H */ #endif /* OPENOCD_RTOS_RTOS_H */