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

Go to the source code of this file.

Functions

static struct symbol_table_elemfind_symbol (const struct rtos *os, const char *symbol)
 
int gdb_thread_packet (struct connection *connection, char const *packet, int packet_size)
 
static struct symbol_table_elemnext_symbol (struct rtos *os, char *cur_symbol, uint64_t cur_addr)
 
static int os_alloc (struct target *target, struct rtos_type *ostype)
 
static int os_alloc_create (struct target *target, struct rtos_type *ostype)
 
static void os_free (struct target *target)
 
int rtos_create (struct jim_getopt_info *goi, struct target *target)
 
void rtos_destroy (struct target *target)
 
void rtos_free_threadlist (struct rtos *rtos)
 
int rtos_generic_stack_read (struct target *target, const struct rtos_register_stacking *stacking, int64_t stack_ptr, struct rtos_reg **reg_list, int *num_regs)
 
int rtos_get_gdb_reg (struct connection *connection, int reg_num)
 Look through all registers to find this register. More...
 
int rtos_get_gdb_reg_list (struct connection *connection)
 Return a list of general registers. More...
 
static int rtos_put_gdb_reg_list (struct connection *connection, struct rtos_reg *reg_list, int num_regs)
 
int rtos_qsymbol (struct connection *connection, char const *packet, int packet_size)
 
int rtos_read_buffer (struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
 
int rtos_set_reg (struct connection *connection, int reg_num, uint8_t *reg_value)
 
int rtos_smp_init (struct target *target)
 
static int rtos_target_for_threadid (struct connection *connection, int64_t threadid, struct target **t)
 
int rtos_thread_packet (struct connection *connection, const char *packet, int packet_size)
 
static int rtos_try_next (struct target *target)
 
int rtos_update_threads (struct target *target)
 
int rtos_write_buffer (struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer)
 

Variables

struct rtos_type chibios_rtos
 
struct rtos_type chromium_ec_rtos
 
struct rtos_type ecos_rtos
 
struct rtos_type embkernel_rtos
 
struct rtos_type freertos_rtos
 
struct rtos_type hwthread_rtos
 
struct rtos_type linux_rtos
 
struct rtos_type mqx_rtos
 
struct rtos_type nuttx_rtos
 
struct rtos_type riot_rtos
 
static struct rtos_typertos_types []
 
struct rtos_type threadx_rtos
 
struct rtos_type ucos_iii_rtos
 
struct rtos_type zephyr_rtos
 

Function Documentation

◆ find_symbol()

static struct symbol_table_elem* find_symbol ( const struct rtos os,
const char *  symbol 
)
static

Definition at line 173 of file rtos.c.

References NULL, symbol_table_elem::symbol_name, and rtos::symbols.

Referenced by next_symbol(), and rtos_qsymbol().

◆ gdb_thread_packet()

int gdb_thread_packet ( struct connection connection,
char const *  packet,
int  packet_size 
)

◆ next_symbol()

static struct symbol_table_elem* next_symbol ( struct rtos os,
char *  cur_symbol,
uint64_t  cur_addr 
)
static

◆ os_alloc()

◆ os_alloc_create()

static int os_alloc_create ( struct target target,
struct rtos_type ostype 
)
static

Definition at line 101 of file rtos.c.

References rtos_type::create, os_alloc(), os_free(), target::rtos, and rtos::type.

Referenced by rtos_create().

◆ os_free()

static void os_free ( struct target target)
static

Definition at line 91 of file rtos.c.

References NULL, target::rtos, and rtos::symbols.

Referenced by os_alloc_create(), rtos_create(), and rtos_destroy().

◆ rtos_create()

◆ rtos_destroy()

void rtos_destroy ( struct target target)

Definition at line 159 of file rtos.c.

References os_free().

Referenced by target_create(), and target_destroy().

◆ rtos_free_threadlist()

◆ rtos_generic_stack_read()

◆ rtos_get_gdb_reg()

int rtos_get_gdb_reg ( struct connection connection,
int  reg_num 
)

◆ rtos_get_gdb_reg_list()

int rtos_get_gdb_reg_list ( struct connection connection)

◆ rtos_put_gdb_reg_list()

static int rtos_put_gdb_reg_list ( struct connection connection,
struct rtos_reg reg_list,
int  num_regs 
)
static

Definition at line 494 of file rtos.c.

References count, DIV_ROUND_UP, ERROR_OK, gdb_put_packet(), hexify(), and size.

Referenced by rtos_get_gdb_reg(), and rtos_get_gdb_reg_list().

◆ rtos_qsymbol()

◆ rtos_read_buffer()

int rtos_read_buffer ( struct target target,
target_addr_t  address,
uint32_t  size,
uint8_t *  buffer 
)

Definition at line 725 of file rtos.c.

References buffer, ERROR_NOT_IMPLEMENTED, rtos_type::read_buffer, target::rtos, size, and rtos::type.

Referenced by gdb_read_memory_packet().

◆ rtos_set_reg()

int rtos_set_reg ( struct connection connection,
int  reg_num,
uint8_t *  reg_value 
)

◆ rtos_smp_init()

int rtos_smp_init ( struct target target)

Definition at line 55 of file rtos.c.

References ERROR_TARGET_INIT_FAILED, target::rtos, rtos_type::smp_init, and rtos::type.

Referenced by jim_target_smp().

◆ rtos_target_for_threadid()

static int rtos_target_for_threadid ( struct connection connection,
int64_t  threadid,
struct target **  t 
)
static

Definition at line 62 of file rtos.c.

References ERROR_OK, and get_target_from_connection().

Referenced by os_alloc().

◆ rtos_thread_packet()

◆ rtos_try_next()

static int rtos_try_next ( struct target target)
static

Definition at line 678 of file rtos.c.

References NULL, target::rtos, rtos_types, rtos::symbols, type, and rtos::type.

Referenced by rtos_qsymbol().

◆ rtos_update_threads()

int rtos_update_threads ( struct target target)

◆ rtos_write_buffer()

int rtos_write_buffer ( struct target target,
target_addr_t  address,
uint32_t  size,
const uint8_t *  buffer 
)

Variable Documentation

◆ chibios_rtos

struct rtos_type chibios_rtos
extern

Definition at line 98 of file chibios.c.

◆ chromium_ec_rtos

struct rtos_type chromium_ec_rtos
extern

Definition at line 367 of file chromium-ec.c.

◆ ecos_rtos

struct rtos_type ecos_rtos
extern

Definition at line 70 of file eCos.c.

◆ embkernel_rtos

struct rtos_type embkernel_rtos
extern

Definition at line 28 of file embKernel.c.

◆ freertos_rtos

struct rtos_type freertos_rtos
extern

Definition at line 95 of file FreeRTOS.c.

◆ hwthread_rtos

struct rtos_type hwthread_rtos
extern

Definition at line 37 of file hwthread.c.

◆ linux_rtos

struct rtos_type linux_rtos
extern

Definition at line 248 of file linux.c.

◆ mqx_rtos

struct rtos_type mqx_rtos
extern

Definition at line 490 of file mqx.c.

◆ nuttx_rtos

struct rtos_type nuttx_rtos
extern

Definition at line 370 of file nuttx.c.

◆ riot_rtos

struct rtos_type riot_rtos
extern

Definition at line 73 of file riot.c.

◆ rtos_types

struct rtos_type* rtos_types[]
static
Initial value:
= {
}
struct rtos_type ucos_iii_rtos
Definition: uCOS-III.c:514
struct rtos_type chromium_ec_rtos
Definition: chromium-ec.c:384
struct rtos_type riot_rtos
Definition: riot.c:98
struct rtos_type freertos_rtos
Definition: FreeRTOS.c:97
struct rtos_type hwthread_rtos
Definition: hwthread.c:42
struct rtos_type threadx_rtos
Definition: ThreadX.c:194
struct rtos_type nuttx_rtos
Definition: nuttx.c:383
struct rtos_type embkernel_rtos
Definition: embKernel.c:30
struct rtos_type chibios_rtos
Definition: chibios.c:100
struct rtos_type mqx_rtos
Definition: mqx.c:501
struct rtos_type zephyr_rtos
Definition: zephyr.c:788
struct rtos_type ecos_rtos
Definition: eCos.c:76
struct rtos_type linux_rtos
Definition: linux.c:250
#define NULL
Definition: usb.h:16

Definition at line 33 of file rtos.c.

Referenced by rtos_create(), and rtos_try_next().

◆ threadx_rtos

struct rtos_type threadx_rtos
extern

Definition at line 187 of file ThreadX.c.

◆ ucos_iii_rtos

struct rtos_type ucos_iii_rtos
extern

Definition at line 500 of file uCOS-III.c.

◆ zephyr_rtos

struct rtos_type zephyr_rtos
extern

Definition at line 776 of file zephyr.c.