OpenOCD
chibios.c File Reference
Include dependency graph for chibios.c:

Go to the source code of this file.

Data Structures

struct  chibios_chdebug
 ChibiOS/RT memory signature record. More...
 
struct  chibios_params
 

Macros

#define CH_RLIST_OFFSET   0x00
 
#define CHIBIOS_NUM_STATES   ARRAY_SIZE(chibios_thread_states)
 
#define CHIBIOS_THREAD_NAME_STR_SIZE   (64)
 
#define GET_CH_KERNEL_MAJOR(coded_version)   ((coded_version >> 11) & 0x1f)
 
#define GET_CH_KERNEL_MINOR(coded_version)   ((coded_version >> 6) & 0x1f)
 
#define GET_CH_KERNEL_PATCH(coded_version)   ((coded_version >> 0) & 0x3f)
 

Enumerations

enum  chibios_symbol_values { CHIBIOS_VAL_RLIST = 0 , CHIBIOS_VAL_CH = 1 , CHIBIOS_VAL_CH_DEBUG = 2 }
 

Functions

static int chibios_create (struct target *target)
 
static bool chibios_detect_rtos (struct target *target)
 
static int chibios_get_symbol_list_to_lookup (struct symbol_table_elem *symbol_list[])
 
static int chibios_get_thread_reg_list (struct rtos *rtos, int64_t thread_id, struct rtos_reg **reg_list, int *num_regs)
 
static int chibios_update_memory_signature (struct rtos *rtos)
 
static int chibios_update_stacking (struct rtos *rtos)
 
static int chibios_update_threads (struct rtos *rtos)
 

Variables

static struct chibios_params chibios_params_list []
 
const struct rtos_type chibios_rtos
 
static struct symbol_table_elem chibios_symbol_list []
 
static const char *const chibios_thread_states []
 ChibiOS thread states. More...
 

Macro Definition Documentation

◆ CH_RLIST_OFFSET

#define CH_RLIST_OFFSET   0x00

Definition at line 130 of file chibios.c.

◆ CHIBIOS_NUM_STATES

#define CHIBIOS_NUM_STATES   ARRAY_SIZE(chibios_thread_states)

Definition at line 66 of file chibios.c.

◆ CHIBIOS_THREAD_NAME_STR_SIZE

#define CHIBIOS_THREAD_NAME_STR_SIZE   (64)

Definition at line 71 of file chibios.c.

◆ GET_CH_KERNEL_MAJOR

#define GET_CH_KERNEL_MAJOR (   coded_version)    ((coded_version >> 11) & 0x1f)

Definition at line 54 of file chibios.c.

◆ GET_CH_KERNEL_MINOR

#define GET_CH_KERNEL_MINOR (   coded_version)    ((coded_version >> 6) & 0x1f)

Definition at line 55 of file chibios.c.

◆ GET_CH_KERNEL_PATCH

#define GET_CH_KERNEL_PATCH (   coded_version)    ((coded_version >> 0) & 0x3f)

Definition at line 56 of file chibios.c.

Enumeration Type Documentation

◆ chibios_symbol_values

Enumerator
CHIBIOS_VAL_RLIST 
CHIBIOS_VAL_CH 
CHIBIOS_VAL_CH_DEBUG 

Definition at line 116 of file chibios.c.

Function Documentation

◆ chibios_create()

static int chibios_create ( struct target target)
static

◆ chibios_detect_rtos()

static bool chibios_detect_rtos ( struct target target)
static

◆ chibios_get_symbol_list_to_lookup()

static int chibios_get_symbol_list_to_lookup ( struct symbol_table_elem symbol_list[])
static

Definition at line 488 of file chibios.c.

References chibios_symbol_list, and ERROR_FAIL.

◆ chibios_get_thread_reg_list()

static int chibios_get_thread_reg_list ( struct rtos rtos,
int64_t  thread_id,
struct rtos_reg **  reg_list,
int *  num_regs 
)
static

◆ chibios_update_memory_signature()

◆ chibios_update_stacking()

◆ chibios_update_threads()

Variable Documentation

◆ chibios_params_list

struct chibios_params chibios_params_list[]
static
Initial value:
= {
{
"cortex_m",
NULL,
},
{
"hla_target",
NULL,
}
}
#define NULL
Definition: usb.h:16

Definition at line 61 of file chibios.c.

Referenced by chibios_create().

◆ chibios_rtos

const struct rtos_type chibios_rtos
Initial value:
= {
.name = "chibios",
.detect_rtos = chibios_detect_rtos,
.create = chibios_create,
.update_threads = chibios_update_threads,
.get_thread_reg_list = chibios_get_thread_reg_list,
.get_symbol_list_to_lookup = chibios_get_symbol_list_to_lookup,
}
static int chibios_create(struct target *target)
Definition: chibios.c:518
static int chibios_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
Definition: chibios.c:488
static int chibios_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, struct rtos_reg **reg_list, int *num_regs)
Definition: chibios.c:454
static int chibios_update_threads(struct rtos *rtos)
Definition: chibios.c:263
static bool chibios_detect_rtos(struct target *target)
Definition: chibios.c:499

Definition at line 98 of file chibios.c.

◆ chibios_symbol_list

struct symbol_table_elem chibios_symbol_list[]
static
Initial value:
= {
{ "rlist", 0, true},
{ "ch", 0, true},
{ "ch_debug", 0, false},
{ NULL, 0, false}
}

Definition at line 98 of file chibios.c.

Referenced by chibios_get_symbol_list_to_lookup().

◆ chibios_thread_states

const char* const chibios_thread_states[]
static
Initial value:
= { "READY", "CURRENT",
"WTSTART", "SUSPENDED", "QUEUED", "WTSEM", "WTMTX", "WTCOND", "SLEEPING",
"WTEXIT", "WTOREVT", "WTANDEVT", "SNDMSGQ", "SNDMSG", "WTMSG", "FINAL"
}

ChibiOS thread states.

Definition at line 61 of file chibios.c.

Referenced by chibios_update_threads().