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

Go to the source code of this file.

Data Structures

struct  mqx_params
 
struct  mqx_state
 

Macros

#define MQX_KERNEL_OFFSET_ACTIVE_TASK   (0x001C)
 
#define MQX_KERNEL_OFFSET_CAPABILITY   (0x0000)
 
#define MQX_KERNEL_OFFSET_SYSTEM_TASK   (0x0050)
 
#define MQX_KERNEL_OFFSET_TDLIST   (0x0108)
 
#define MQX_QUEUE_OFFSET_SIZE   (0x0008)
 
#define MQX_TASK_OFFSET_ERROR_CODE   (0x005C)
 
#define MQX_TASK_OFFSET_ID   (0x000c)
 
#define MQX_TASK_OFFSET_NEXT   (0x0000)
 
#define MQX_TASK_OFFSET_STACK   (0x0014)
 
#define MQX_TASK_OFFSET_STATE   (0x0008)
 
#define MQX_TASK_OFFSET_TDLIST   (0x006C)
 
#define MQX_TASK_OFFSET_TEMPLATE   (0x0068)
 
#define MQX_TASK_STATE_MASK   (0xFFF)
 
#define MQX_TASK_TEMPLATE_OFFSET_NAME   (0x0010)
 
#define MQX_THREAD_NAME_LENGTH   (255)
 

Enumerations

enum  mqx_arch { mqx_arch_cortexm }
 
enum  mqx_symbols { MQX_VAL_MQX_KERNEL_DATA , MQX_VAL_MQX_INIT_STRUCT }
 

Functions

static int mqx_create (struct target *target)
 
static bool mqx_detect_rtos (struct target *target)
 
static int mqx_get_member (struct rtos *rtos, const uint32_t base_address, int32_t member_offset, int32_t member_width, const char *member_name, void *result)
 
static int mqx_get_symbol (struct rtos *rtos, enum mqx_symbols symbol, void *result)
 
static int mqx_get_symbol_list_to_lookup (struct symbol_table_elem *symbol_list[])
 
static int mqx_get_thread_reg_list (struct rtos *rtos, int64_t thread_id, struct rtos_reg **reg_list, int *num_regs)
 
static int mqx_is_scheduler_running (struct rtos *rtos)
 
static int mqx_target_read_buffer (struct target *target, uint32_t address, uint32_t size, uint8_t *buffer)
 
static int mqx_update_threads (struct rtos *rtos)
 
static int mqx_valid_address_check (struct rtos *rtos, uint32_t address)
 

Variables

static const struct mqx_params mqx_params_list []
 
struct rtos_type mqx_rtos
 
static const struct mqx_state mqx_states []
 
static const char *const mqx_symbol_list []
 

Macro Definition Documentation

◆ MQX_KERNEL_OFFSET_ACTIVE_TASK

#define MQX_KERNEL_OFFSET_ACTIVE_TASK   (0x001C)

Definition at line 26 of file mqx.c.

◆ MQX_KERNEL_OFFSET_CAPABILITY

#define MQX_KERNEL_OFFSET_CAPABILITY   (0x0000)

Definition at line 27 of file mqx.c.

◆ MQX_KERNEL_OFFSET_SYSTEM_TASK

#define MQX_KERNEL_OFFSET_SYSTEM_TASK   (0x0050)

Definition at line 25 of file mqx.c.

◆ MQX_KERNEL_OFFSET_TDLIST

#define MQX_KERNEL_OFFSET_TDLIST   (0x0108)

Definition at line 24 of file mqx.c.

◆ MQX_QUEUE_OFFSET_SIZE

#define MQX_QUEUE_OFFSET_SIZE   (0x0008)

Definition at line 28 of file mqx.c.

◆ MQX_TASK_OFFSET_ERROR_CODE

#define MQX_TASK_OFFSET_ERROR_CODE   (0x005C)

Definition at line 36 of file mqx.c.

◆ MQX_TASK_OFFSET_ID

#define MQX_TASK_OFFSET_ID   (0x000c)

Definition at line 30 of file mqx.c.

◆ MQX_TASK_OFFSET_NEXT

#define MQX_TASK_OFFSET_NEXT   (0x0000)

Definition at line 34 of file mqx.c.

◆ MQX_TASK_OFFSET_STACK

#define MQX_TASK_OFFSET_STACK   (0x0014)

Definition at line 32 of file mqx.c.

◆ MQX_TASK_OFFSET_STATE

#define MQX_TASK_OFFSET_STATE   (0x0008)

Definition at line 29 of file mqx.c.

◆ MQX_TASK_OFFSET_TDLIST

#define MQX_TASK_OFFSET_TDLIST   (0x006C)

Definition at line 33 of file mqx.c.

◆ MQX_TASK_OFFSET_TEMPLATE

#define MQX_TASK_OFFSET_TEMPLATE   (0x0068)

Definition at line 31 of file mqx.c.

◆ MQX_TASK_STATE_MASK

#define MQX_TASK_STATE_MASK   (0xFFF)

Definition at line 37 of file mqx.c.

◆ MQX_TASK_TEMPLATE_OFFSET_NAME

#define MQX_TASK_TEMPLATE_OFFSET_NAME   (0x0010)

Definition at line 35 of file mqx.c.

◆ MQX_THREAD_NAME_LENGTH

#define MQX_THREAD_NAME_LENGTH   (255)

Definition at line 23 of file mqx.c.

Enumeration Type Documentation

◆ mqx_arch

enum mqx_arch
Enumerator
mqx_arch_cortexm 

Definition at line 45 of file mqx.c.

◆ mqx_symbols

Enumerator
MQX_VAL_MQX_KERNEL_DATA 
MQX_VAL_MQX_INIT_STRUCT 

Definition at line 40 of file mqx.c.

Function Documentation

◆ mqx_create()

static int mqx_create ( struct target target)
static

◆ mqx_detect_rtos()

static bool mqx_detect_rtos ( struct target target)
static

◆ mqx_get_member()

static int mqx_get_member ( struct rtos rtos,
const uint32_t  base_address,
int32_t  member_offset,
int32_t  member_width,
const char *  member_name,
void *  result 
)
static

◆ mqx_get_symbol()

static int mqx_get_symbol ( struct rtos rtos,
enum mqx_symbols  symbol,
void *  result 
)
static

◆ mqx_get_symbol_list_to_lookup()

static int mqx_get_symbol_list_to_lookup ( struct symbol_table_elem symbol_list[])
static

Definition at line 490 of file mqx.c.

References ARRAY_SIZE, ERROR_FAIL, ERROR_OK, and mqx_symbol_list.

◆ mqx_get_thread_reg_list()

◆ mqx_is_scheduler_running()

◆ mqx_target_read_buffer()

static int mqx_target_read_buffer ( struct target target,
uint32_t  address,
uint32_t  size,
uint8_t *  buffer 
)
static

◆ mqx_update_threads()

◆ mqx_valid_address_check()

static int mqx_valid_address_check ( struct rtos rtos,
uint32_t  address 
)
static

Definition at line 92 of file mqx.c.

References ERROR_FAIL, ERROR_OK, LOG_ERROR, mqx_arch_cortexm, and rtos::rtos_specific_params.

Referenced by mqx_target_read_buffer().

Variable Documentation

◆ mqx_params_list

const struct mqx_params mqx_params_list[]
static
Initial value:
= {
}
@ mqx_arch_cortexm
Definition: mqx.c:46
const struct rtos_register_stacking rtos_mqx_arm_v7m_stacking

Definition at line 79 of file mqx.c.

Referenced by mqx_create().

◆ mqx_rtos

struct rtos_type mqx_rtos
Initial value:
= {
.name = "mqx",
.detect_rtos = mqx_detect_rtos,
.create = mqx_create,
.update_threads = mqx_update_threads,
.get_thread_reg_list = mqx_get_thread_reg_list,
.get_symbol_list_to_lookup = mqx_get_symbol_list_to_lookup,
}
static int mqx_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, struct rtos_reg **reg_list, int *num_regs)
Definition: mqx.c:413
static int mqx_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
Definition: mqx.c:490
static int mqx_update_threads(struct rtos *rtos)
Definition: mqx.c:265
static int mqx_create(struct target *target)
Definition: mqx.c:246
static bool mqx_detect_rtos(struct target *target)
Definition: mqx.c:230

Definition at line 490 of file mqx.c.

◆ mqx_states

const struct mqx_state mqx_states[]
static
Initial value:
= {
{ 0x0002, "READY" },
{ 0x0003, "BLOCKED" },
{ 0x0005, "RCV_SPECIFIC_BLOCKED" },
{ 0x0007, "RCV_ANY_BLOCKED" },
{ 0x0009, "DYING" },
{ 0x000B, "UNHANDLED_INT_BLOCKED" },
{ 0x000D, "SEND_BLOCKED" },
{ 0x000F, "BREAKPOINT_BLOCKED" },
{ 0x0211, "IO_BLOCKED" },
{ 0x0021, "SEM_BLOCKED" },
{ 0x0223, "MUTEX_BLOCKED" },
{ 0x0025, "EVENT_BLOCKED" },
{ 0x0229, "TASK_QUEUE_BLOCKED" },
{ 0x042B, "LWSEM_BLOCKED" },
{ 0x042D, "LWEVENT_BLOCKED" },
}

Definition at line 1 of file mqx.c.

Referenced by mqx_update_threads().

◆ mqx_symbol_list

const char* const mqx_symbol_list[]
static
Initial value:
= {
"_mqx_kernel_data",
"MQX_init_struct",
}
#define NULL
Definition: usb.h:16

Definition at line 79 of file mqx.c.

Referenced by mqx_get_symbol_list_to_lookup().