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 (symbol_table_elem_t *symbol_list[])
 
static int mqx_get_thread_reg_list (struct rtos *rtos, int64_t thread_id, char **hex_reg_list)
 
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

#define MQX_KERNEL_OFFSET_ACTIVE_TASK   (0x001C)

Definition at line 37 of file mqx.c.

Referenced by mqx_is_scheduler_running(), and mqx_update_threads().

#define MQX_KERNEL_OFFSET_CAPABILITY   (0x0000)

Definition at line 38 of file mqx.c.

Referenced by mqx_is_scheduler_running().

#define MQX_KERNEL_OFFSET_SYSTEM_TASK   (0x0050)

Definition at line 36 of file mqx.c.

Referenced by mqx_is_scheduler_running().

#define MQX_KERNEL_OFFSET_TDLIST   (0x0108)

Definition at line 35 of file mqx.c.

Referenced by mqx_get_thread_reg_list(), and mqx_update_threads().

#define MQX_QUEUE_OFFSET_SIZE   (0x0008)

Definition at line 39 of file mqx.c.

Referenced by mqx_get_thread_reg_list(), and mqx_update_threads().

#define MQX_TASK_OFFSET_ERROR_CODE   (0x005C)

Definition at line 47 of file mqx.c.

Referenced by mqx_update_threads().

#define MQX_TASK_OFFSET_ID   (0x000c)

Definition at line 41 of file mqx.c.

Referenced by mqx_get_thread_reg_list(), and mqx_update_threads().

#define MQX_TASK_OFFSET_NEXT   (0x0000)

Definition at line 45 of file mqx.c.

Referenced by mqx_get_thread_reg_list(), and mqx_update_threads().

#define MQX_TASK_OFFSET_STACK   (0x0014)

Definition at line 43 of file mqx.c.

Referenced by mqx_get_thread_reg_list().

#define MQX_TASK_OFFSET_STATE   (0x0008)

Definition at line 40 of file mqx.c.

Referenced by mqx_update_threads().

#define MQX_TASK_OFFSET_TDLIST   (0x006C)

Definition at line 44 of file mqx.c.

Referenced by mqx_get_thread_reg_list(), and mqx_update_threads().

#define MQX_TASK_OFFSET_TEMPLATE   (0x0068)

Definition at line 42 of file mqx.c.

Referenced by mqx_update_threads().

#define MQX_TASK_STATE_MASK   (0xFFF)

Definition at line 48 of file mqx.c.

Referenced by mqx_update_threads().

#define MQX_TASK_TEMPLATE_OFFSET_NAME   (0x0010)

Definition at line 46 of file mqx.c.

Referenced by mqx_update_threads().

#define MQX_THREAD_NAME_LENGTH   (255)

Definition at line 34 of file mqx.c.

Referenced by mqx_update_threads().

Enumeration Type Documentation

enum mqx_arch
Enumerator
mqx_arch_cortexm 

Definition at line 56 of file mqx.c.

Enumerator
mqx_VAL_mqx_kernel_data 
mqx_VAL_MQX_init_struct 

Definition at line 51 of file mqx.c.

Function Documentation

static int mqx_create ( struct target target)
static
static bool mqx_detect_rtos ( struct target target)
static
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
static int mqx_get_symbol ( struct rtos rtos,
enum mqx_symbols  symbol,
void *  result 
)
static
static int mqx_get_symbol_list_to_lookup ( symbol_table_elem_t symbol_list[])
static

Definition at line 543 of file mqx.c.

References ARRAY_SIZE, ERROR_FAIL, ERROR_OK, mqx_symbol_list, and NULL.

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

Definition at line 131 of file mqx.c.

References ERROR_OK, LOG_ERROR, LOG_WARNING, mqx_valid_address_check(), target::rtos, and target_read_buffer().

Referenced by mqx_get_member().

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

Definition at line 103 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

const struct mqx_params mqx_params_list[]
static
Initial value:
= {
}
const struct rtos_register_stacking rtos_mqx_arm_v7m_stacking

Definition at line 96 of file mqx.c.

Referenced by mqx_create().

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 bool mqx_detect_rtos(struct target *target)
Definition: mqx.c:249
static int mqx_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, char **hex_reg_list)
Definition: mqx.c:456
static int mqx_create(struct target *target)
Definition: mqx.c:265
static int mqx_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
Definition: mqx.c:543
static int mqx_update_threads(struct rtos *rtos)
Definition: mqx.c:285

Definition at line 554 of file mqx.c.

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 72 of file mqx.c.

Referenced by mqx_update_threads().

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

Definition at line 90 of file mqx.c.

Referenced by mqx_get_symbol_list_to_lookup().