20 #define EMBKERNEL_MAX_THREAD_NAME_STR_SIZE (64)
26 struct rtos_reg **reg_list,
int *num_regs);
34 .get_thread_reg_list =
52 "Rtos::sListSuspended",
53 "Rtos::sMaxPriorities",
54 "Rtos::sCurrentTaskCount",
116 LOG_WARNING(
"Could not find target \"%s\" in embKernel compatibility "
136 int64_t name_ptr = 0;
138 (uint8_t *) &name_ptr);
153 int64_t priority = 0;
155 (uint8_t *) &priority);
161 (
unsigned int) priority);
164 state_str, (
unsigned int) priority);
167 LOG_OUTPUT(
"Getting task details: iterable=0x%08X, task=0x%08X, name=%s\n", (
unsigned int)iterable,
190 LOG_ERROR(
"Don't have the thread list head");
202 LOG_ERROR(
"Error reading current thread in embKernel thread list");
206 int64_t max_used_priority = 0;
208 (uint8_t *) &max_used_priority);
212 int thread_list_size = 0;
217 LOG_ERROR(
"Could not read embKernel thread count from target");
224 LOG_ERROR(
"Error allocating memory for %d threads", thread_list_size);
230 for (
int pri = 0; pri < max_used_priority; pri++) {
232 int64_t iterable = 0;
235 (uint8_t *) &iterable);
238 for (; iterable && thread_idx < thread_list_size; thread_idx++) {
245 (uint8_t *) &iterable);
251 int64_t iterable = 0;
253 (uint8_t *) &iterable);
256 for (; iterable && thread_idx < thread_list_size; thread_idx++) {
263 (uint8_t *) &iterable);
271 (uint8_t *) &iterable);
274 for (; iterable && thread_idx < thread_list_size; thread_idx++) {
281 (uint8_t *) &iterable);
288 LOG_OUTPUT(
"Found %u tasks\n", (
unsigned int)thread_idx);
293 struct rtos_reg **reg_list,
int *num_regs)
297 int64_t stack_ptr = 0;
312 (uint8_t *) &stack_ptr);
314 LOG_ERROR(
"Error reading stack frame from embKernel thread");
const struct rtos_type embkernel_rtos
@ SYMBOL_ID_S_MAX_PRIORITIES
@ SYMBOL_ID_S_CURRENT_TASK
@ SYMBOL_ID_S_CURRENT_TASK_COUNT
@ SYMBOL_ID_S_LIST_SUSPENDED
static int embkernel_create(struct target *target)
static bool embkernel_detect_rtos(struct target *target)
static int embkernel_get_tasks_details(struct rtos *rtos, int64_t iterable, const struct embkernel_params *param, struct thread_detail *details, const char *state_str)
static int embkernel_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
static int embkernel_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, struct rtos_reg **reg_list, int *num_regs)
static const struct embkernel_params embkernel_params_list[]
static const char *const embkernel_symbol_list[]
static int embkernel_update_threads(struct rtos *rtos)
#define EMBKERNEL_MAX_THREAD_NAME_STR_SIZE
The JTAG interface can be implemented with a software or hardware fifo.
#define LOG_OUTPUT(expr ...)
#define LOG_WARNING(expr ...)
#define LOG_ERROR(expr ...)
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)
void rtos_free_threadlist(struct rtos *rtos)
const struct rtos_register_stacking rtos_embkernel_cortex_m_stacking
const unsigned char thread_name_offset
const unsigned char iterable_next_offset
const struct rtos_register_stacking * stacking_info
const unsigned char thread_count_width
const unsigned char thread_stack_offset
const unsigned char rtos_list_size
const unsigned char pointer_width
const unsigned char iterable_task_owner_offset
const unsigned char thread_priority_width
const unsigned char thread_priority_offset
struct thread_detail * thread_details
struct symbol_table_elem * symbols
void * rtos_specific_params
threadid_t current_thread
Table should be terminated by an element with NULL in symbol_name.
int target_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
const char * target_type_name(const struct target *target)
Get the target type name.
static const char * target_name(const struct target *target)
Returns the instance-specific name of the specified target.
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.