#include "helper/types.h"
#include "rtos_chibios_stackings.h"
-
/**
* @brief ChibiOS/RT memory signature record.
*
/**
* @brief ChibiOS thread states.
*/
-const char *ChibiOS_thread_states[] = {
+static const char * const ChibiOS_thread_states[] = {
"READY", "CURRENT", "SUSPENDED", "WTSEM", "WTMTX", "WTCOND", "SLEEPING",
"WTEXIT", "WTOREVT", "WTANDEVT", "SNDMSGQ", "SNDMSG", "WTMSG", "WTQUEUE",
"FINAL"
const struct rtos_register_stacking *stacking_info;
};
-struct ChibiOS_params ChibiOS_params_list[] = {
+static const struct ChibiOS_params ChibiOS_params_list[] = {
{
"cortex_m", /* target_name */
0,
ChibiOS_VAL_chSysInit = 2
};
-static char *ChibiOS_symbol_list[] = {
+static const char * const ChibiOS_symbol_list[] = {
"rlist", /* Thread ready list*/
"ch_debug", /* Memory Signatur containing offsets of fields in rlist*/
"chSysInit", /* Necessary part of API, used for ChibiOS detection*/
return -1;
}
- target->rtos->rtos_specific_params = &ChibiOS_params_list[i];
+ target->rtos->rtos_specific_params = (void *) &ChibiOS_params_list[i];
return 0;
}
const struct rtos_register_stacking *stacking_info;
};
-const struct FreeRTOS_params FreeRTOS_params_list[] = {
+static const struct FreeRTOS_params FreeRTOS_params_list[] = {
{
"cortex_m", /* target_name */
4, /* thread_count_width; */
FreeRTOS_VAL_uxTopUsedPriority = 10,
};
-static char *FreeRTOS_symbol_list[] = {
+static const char * const FreeRTOS_symbol_list[] = {
"pxCurrentTCB",
"pxReadyTasksLists",
"xDelayedTaskList1",
struct ThreadX_thread_state {
int value;
- char *desc;
+ const char *desc;
};
-struct ThreadX_thread_state ThreadX_thread_states[] = {
+static const struct ThreadX_thread_state ThreadX_thread_states[] = {
{ 0, "Ready" },
{ 1, "Completed" },
{ 2, "Terminated" },
#define THREADX_NUM_STATES (sizeof(ThreadX_thread_states)/sizeof(struct ThreadX_thread_state))
struct ThreadX_params {
- char *target_name;
+ const char *target_name;
unsigned char pointer_width;
unsigned char thread_stack_offset;
unsigned char thread_name_offset;
const struct rtos_register_stacking *stacking_info;
};
-const struct ThreadX_params ThreadX_params_list[] = {
+static const struct ThreadX_params ThreadX_params_list[] = {
{
"cortex_m", /* target_name */
4, /* pointer_width; */
ThreadX_VAL_tx_thread_created_count = 2,
};
-static char *ThreadX_symbol_list[] = {
+static const char * const ThreadX_symbol_list[] = {
"_tx_thread_current_ptr",
"_tx_thread_created_ptr",
"_tx_thread_created_count",
.update_threads = ThreadX_update_threads,
.get_thread_reg_list = ThreadX_get_thread_reg_list,
.get_symbol_list_to_lookup = ThreadX_get_symbol_list_to_lookup,
-
};
static int ThreadX_update_threads(struct rtos *rtos)
/* empty */
}
- char *state_desc;
+ const char *state_desc;
if (i < THREADX_NUM_STATES)
state_desc = ThreadX_thread_states[i].desc;
else
struct eCos_thread_state {
int value;
- char *desc;
+ const char *desc;
};
-struct eCos_thread_state eCos_thread_states[] = {
+static const struct eCos_thread_state eCos_thread_states[] = {
{ 0, "Ready" },
{ 1, "Sleeping" },
{ 2, "Countsleep" },
#define ECOS_NUM_STATES (sizeof(eCos_thread_states)/sizeof(struct eCos_thread_state))
struct eCos_params {
- char *target_name;
+ const char *target_name;
unsigned char pointer_width;
unsigned char thread_stack_offset;
unsigned char thread_name_offset;
const struct rtos_register_stacking *stacking_info;
};
-const struct eCos_params eCos_params_list[] = {
+static const struct eCos_params eCos_params_list[] = {
{
"cortex_m", /* target_name */
4, /* pointer_width; */
eCos_VAL_current_thread_ptr = 1
};
-static char *eCos_symbol_list[] = {
+static const char * const eCos_symbol_list[] = {
"Cyg_Thread::thread_list",
"Cyg_Scheduler_Base::current_thread",
NULL
*/
}
- char *state_desc;
+ const char *state_desc;
if (i < ECOS_NUM_STATES)
state_desc = eCos_thread_states[i].desc;
else
SYMBOL_ID_sCurrentTaskCount = 5,
};
-static char *embKernel_symbol_list[] = {
+static const char * const embKernel_symbol_list[] = {
"Rtos::sCurrentTask",
"Rtos::sListReady",
"Rtos::sListSleep",
const struct rtos_register_stacking *stacking_info;
};
-struct embKernel_params embKernel_params_list[] = {
+static const struct embKernel_params embKernel_params_list[] = {
{
"cortex_m", /* target_name */
4, /* pointer_width */
return -1;
}
- target->rtos->rtos_specific_params = &embKernel_params_list[i];
+ target->rtos->rtos_specific_params = (void *) &embKernel_params_list[i];
return 0;
}
#define MAX_THREADS 200
/* specific task */
struct linux_os {
- char *name;
+ const char *name;
uint32_t init_task_addr;
int thread_count;
int threadid_count;
static int linux_os_smp_init(struct target *target);
static int linux_os_clean(struct target *target);
#define INIT_TASK 0
-static char *linux_symbol_list[] = {
+static const char * const linux_symbol_list[] = {
"init_task",
NULL
};
return target->rtos->gdb_thread_packet(connection, packet, packet_size);
}
-static char *next_symbol(struct rtos *os, char *cur_symbol, uint64_t cur_addr)
+static const char *next_symbol(struct rtos *os, char *cur_symbol, uint64_t cur_addr)
{
symbol_table_elem_t *s;
int rtos_detected = 0;
uint64_t addr = 0;
size_t reply_len;
- char reply[GDB_BUFFER_SIZE], cur_sym[GDB_BUFFER_SIZE / 2] = "", *next_sym;
+ char reply[GDB_BUFFER_SIZE], cur_sym[GDB_BUFFER_SIZE / 2] = "";
+ const char *next_sym;
struct target *target = get_target_from_connection(connection);
struct rtos *os = target->rtos;
* Table should be terminated by an element with NULL in symbol_name
*/
typedef struct symbol_table_elem_struct {
- char *symbol_name;
+ const char *symbol_name;
symbol_address_t address;
} symbol_table_elem_t;
};
struct rtos_type {
- char *name;
+ const char *name;
int (*detect_rtos)(struct target *target);
int (*create)(struct target *target);
int (*smp_init)(struct target *target);