21 #define EMBKERNEL_MAX_THREAD_NAME_STR_SIZE (64)
27 struct rtos_reg **reg_list,
int *num_regs);
35 .get_thread_reg_list =
53 "Rtos::sListSuspended",
54 "Rtos::sMaxPriorities",
55 "Rtos::sCurrentTaskCount",
117 LOG_WARNING(
"Could not find target \"%s\" in embKernel compatibility "
137 int64_t name_ptr = 0;
139 (uint8_t *) &name_ptr);
154 int64_t priority = 0;
156 (uint8_t *) &priority);
162 (
unsigned int) priority);
165 state_str, (
unsigned int) priority);
168 LOG_OUTPUT(
"Getting task details: iterable=0x%08X, task=0x%08X, name=%s\n", (
unsigned int)iterable,
191 LOG_ERROR(
"Don't have the thread list head");
203 LOG_ERROR(
"Error reading current thread in embKernel thread list");
207 int64_t max_used_priority = 0;
209 (uint8_t *) &max_used_priority);
213 int thread_list_size = 0;
215 param->thread_count_width, (uint8_t *) &thread_list_size);
218 LOG_ERROR(
"Could not read embKernel thread count from target");
225 LOG_ERROR(
"Error allocating memory for %d threads", thread_list_size);
231 for (
int pri = 0; pri < max_used_priority; pri++) {
233 int64_t iterable = 0;
236 (uint8_t *) &iterable);
239 for (; iterable && thread_idx < thread_list_size; thread_idx++) {
246 (uint8_t *) &iterable);
252 int64_t iterable = 0;
254 (uint8_t *) &iterable);
257 for (; iterable && thread_idx < thread_list_size; thread_idx++) {
264 (uint8_t *) &iterable);
272 (uint8_t *) &iterable);
275 for (; iterable && thread_idx < thread_list_size; thread_idx++) {
282 (uint8_t *) &iterable);
289 LOG_OUTPUT(
"Found %u tasks\n", (
unsigned int)thread_idx);
294 struct rtos_reg **reg_list,
int *num_regs)
298 int64_t stack_ptr = 0;
313 (uint8_t *) &stack_ptr);
315 LOG_ERROR(
"Error reading stack frame from embKernel thread");
static struct aice_port_param_s param
static int embkernel_create(struct target *target)
static bool embkernel_detect_rtos(struct target *target)
struct rtos_type embkernel_rtos
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
@ SYMBOL_ID_S_MAX_PRIORITIES
@ SYMBOL_ID_S_CURRENT_TASK
@ SYMBOL_ID_S_CURRENT_TASK_COUNT
@ SYMBOL_ID_S_LIST_SUSPENDED
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.
const char * name
Name of this type of target.
struct target_type * type
int target_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
static const char * target_name(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.