OpenOCD
ThreadX.c
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 /***************************************************************************
4  * Copyright (C) 2011 by Broadcom Corporation *
5  * Evan Hunter - ehunter@broadcom.com *
6  ***************************************************************************/
7 
8 #ifdef HAVE_CONFIG_H
9 #include "config.h"
10 #endif
11 
12 #include <helper/time_support.h>
13 #include <jtag/jtag.h>
14 #include "target/target.h"
15 #include "rtos.h"
16 #include "helper/log.h"
17 #include "helper/types.h"
19 
20 static const struct rtos_register_stacking *get_stacking_info(const struct rtos *rtos, int64_t stack_ptr);
21 static const struct rtos_register_stacking *get_stacking_info_arm926ejs(const struct rtos *rtos, int64_t stack_ptr);
22 
23 static int is_thread_id_valid(const struct rtos *rtos, int64_t thread_id);
24 static int is_thread_id_valid_arm926ejs(const struct rtos *rtos, int64_t thread_id);
25 
26 static bool threadx_detect_rtos(struct target *target);
27 static int threadx_create(struct target *target);
28 static int threadx_update_threads(struct rtos *rtos);
29 static int threadx_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, struct rtos_reg **reg_list, int *num_regs);
30 static int threadx_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[]);
31 
32 
33 
35  int value;
36  const char *desc;
37 };
38 
39 static const struct threadx_thread_state threadx_thread_states[] = {
40  { 0, "Ready" },
41  { 1, "Completed" },
42  { 2, "Terminated" },
43  { 3, "Suspended" },
44  { 4, "Sleeping" },
45  { 5, "Waiting - Queue" },
46  { 6, "Waiting - Semaphore" },
47  { 7, "Waiting - Event flag" },
48  { 8, "Waiting - Memory" },
49  { 9, "Waiting - Memory" },
50  { 10, "Waiting - I/O" },
51  { 11, "Waiting - Filesystem" },
52  { 12, "Waiting - Network" },
53  { 13, "Waiting - Mutex" },
54 };
55 
56 #define THREADX_NUM_STATES ARRAY_SIZE(threadx_thread_states)
57 
58 #define ARM926EJS_REGISTERS_SIZE_SOLICITED (11 * 4)
60  { 0, -1, 32 }, /* r0 */
61  { 1, -1, 32 }, /* r1 */
62  { 2, -1, 32 }, /* r2 */
63  { 3, -1, 32 }, /* r3 */
64  { 4, 0x08, 32 }, /* r4 */
65  { 5, 0x0C, 32 }, /* r5 */
66  { 6, 0x10, 32 }, /* r6 */
67  { 7, 0x14, 32 }, /* r7 */
68  { 8, 0x18, 32 }, /* r8 */
69  { 9, 0x1C, 32 }, /* r9 */
70  { 10, 0x20, 32 }, /* r10 */
71  { 11, 0x24, 32 }, /* r11 */
72  { 12, -1, 32 }, /* r12 */
73  { 13, -2, 32 }, /* sp (r13) */
74  { 14, 0x28, 32 }, /* lr (r14) */
75  { 15, -1, 32 }, /* pc (r15) */
76  /*{ 16, -1, 32 },*/ /* lr (r14) */
77  /*{ 17, 0x28, 32 },*/ /* pc (r15) */
78  { 16, 0x04, 32 }, /* xPSR */
79 };
80 #define ARM926EJS_REGISTERS_SIZE_INTERRUPT (17 * 4)
82  { 0, 0x08, 32 }, /* r0 */
83  { 1, 0x0C, 32 }, /* r1 */
84  { 2, 0x10, 32 }, /* r2 */
85  { 3, 0x14, 32 }, /* r3 */
86  { 4, 0x18, 32 }, /* r4 */
87  { 5, 0x1C, 32 }, /* r5 */
88  { 6, 0x20, 32 }, /* r6 */
89  { 7, 0x24, 32 }, /* r7 */
90  { 8, 0x28, 32 }, /* r8 */
91  { 9, 0x2C, 32 }, /* r9 */
92  { 10, 0x30, 32 }, /* r10 */
93  { 11, 0x34, 32 }, /* r11 */
94  { 12, 0x38, 32 }, /* r12 */
95  { 13, -2, 32 }, /* sp (r13) */
96  { 14, 0x3C, 32 }, /* lr (r14) */
97  { 15, 0x40, 32 }, /* pc (r15) */
98  { 16, 0x04, 32 }, /* xPSR */
99 };
100 
102 {
104  .stack_growth_direction = -1,
105  .num_output_registers = 17,
107 },
108 {
109  .stack_registers_size = ARM926EJS_REGISTERS_SIZE_INTERRUPT,
110  .stack_growth_direction = -1,
111  .num_output_registers = 17,
113 },
114 };
115 
117  const char *target_name;
118  unsigned char pointer_width;
119  unsigned char thread_stack_offset;
120  unsigned char thread_name_offset;
121  unsigned char thread_state_offset;
122  unsigned char thread_next_offset;
125  const struct rtos_register_stacking* (*fn_get_stacking_info)(const struct rtos *rtos, int64_t stack_ptr);
126  int (*fn_is_thread_id_valid)(const struct rtos *rtos, int64_t thread_id);
127 };
128 
129 static const struct threadx_params threadx_params_list[] = {
130  {
131  "cortex_m", /* target_name */
132  4, /* pointer_width; */
133  8, /* thread_stack_offset; */
134  40, /* thread_name_offset; */
135  48, /* thread_state_offset; */
136  136, /* thread_next_offset */
137  &rtos_standard_cortex_m3_stacking, /* stacking_info */
138  1, /* stacking_info_nb */
139  NULL, /* fn_get_stacking_info */
140  NULL, /* fn_is_thread_id_valid */
141  },
142  {
143  "cortex_r4", /* target_name */
144  4, /* pointer_width; */
145  8, /* thread_stack_offset; */
146  40, /* thread_name_offset; */
147  48, /* thread_state_offset; */
148  136, /* thread_next_offset */
149  &rtos_standard_cortex_r4_stacking, /* stacking_info */
150  1, /* stacking_info_nb */
151  NULL, /* fn_get_stacking_info */
152  NULL, /* fn_is_thread_id_valid */
153  },
154  {
155  "arm926ejs", /* target_name */
156  4, /* pointer_width; */
157  8, /* thread_stack_offset; */
158  40, /* thread_name_offset; */
159  48, /* thread_state_offset; */
160  136, /* thread_next_offset */
161  rtos_threadx_arm926ejs_stacking, /* stacking_info */
162  2, /* stacking_info_nb */
163  get_stacking_info_arm926ejs, /* fn_get_stacking_info */
164  is_thread_id_valid_arm926ejs, /* fn_is_thread_id_valid */
165  },
166  {
167  "hla_target", /* target_name */
168  4, /* pointer_width; */
169  8, /* thread_stack_offset; */
170  40, /* thread_name_offset; */
171  48, /* thread_state_offset; */
172  136, /* thread_next_offset */
173  &rtos_standard_cortex_m3_stacking, /* stacking_info */
174  1, /* stacking_info_nb */
175  NULL, /* fn_get_stacking_info */
176  NULL, /* fn_is_thread_id_valid */
177  },
178 };
179 
184 };
185 
186 static const char * const threadx_symbol_list[] = {
187  "_tx_thread_current_ptr",
188  "_tx_thread_created_ptr",
189  "_tx_thread_created_count",
190  NULL
191 };
192 
193 const struct rtos_type threadx_rtos = {
194  .name = "ThreadX",
195 
196  .detect_rtos = threadx_detect_rtos,
197  .create = threadx_create,
198  .update_threads = threadx_update_threads,
199  .get_thread_reg_list = threadx_get_thread_reg_list,
200  .get_symbol_list_to_lookup = threadx_get_symbol_list_to_lookup,
201 };
202 
203 static const struct rtos_register_stacking *get_stacking_info(const struct rtos *rtos, int64_t stack_ptr)
204 {
205  const struct threadx_params *param = (const struct threadx_params *) rtos->rtos_specific_params;
206 
207  if (param->fn_get_stacking_info)
208  return param->fn_get_stacking_info(rtos, stack_ptr);
209 
210  return param->stacking_info + 0;
211 }
212 
213 static int is_thread_id_valid(const struct rtos *rtos, int64_t thread_id)
214 {
215  const struct threadx_params *param;
216 
218  return 0; /* invalid */
219 
220  param = (const struct threadx_params *) rtos->rtos_specific_params;
221 
222  if (param->fn_is_thread_id_valid)
223  return param->fn_is_thread_id_valid(rtos, thread_id);
224 
225  return (thread_id != 0);
226 }
227 
228 static const struct rtos_register_stacking *get_stacking_info_arm926ejs(const struct rtos *rtos, int64_t stack_ptr)
229 {
230  const struct threadx_params *param = (const struct threadx_params *) rtos->rtos_specific_params;
231  int retval;
232  uint32_t flag;
233 
234  retval = target_read_buffer(rtos->target,
235  stack_ptr,
236  sizeof(flag),
237  (uint8_t *)&flag);
238  if (retval != ERROR_OK) {
239  LOG_ERROR("Error reading stack data from ThreadX thread: stack_ptr=0x%" PRIx64, stack_ptr);
240  return NULL;
241  }
242 
243  if (flag == 0) {
244  LOG_DEBUG(" solicited stack");
245  return param->stacking_info + 0;
246  } else {
247  LOG_DEBUG(" interrupt stack: %" PRIu32, flag);
248  return param->stacking_info + 1;
249  }
250 }
251 
252 static int is_thread_id_valid_arm926ejs(const struct rtos *rtos, int64_t thread_id)
253 {
254  return (thread_id != 0 && thread_id != 1);
255 }
256 
257 static int threadx_update_threads(struct rtos *rtos)
258 {
259  int retval;
260  int tasks_found = 0;
261  int thread_list_size = 0;
262  const struct threadx_params *param;
263 
264  if (!rtos)
265  return -1;
266 
268  return -3;
269 
270  param = (const struct threadx_params *) rtos->rtos_specific_params;
271 
272  if (!rtos->symbols) {
273  LOG_ERROR("No symbols for ThreadX");
274  return -4;
275  }
276 
278  LOG_ERROR("Don't have the number of threads in ThreadX");
279  return -2;
280  }
281 
282  /* read the number of threads */
283  retval = target_read_buffer(rtos->target,
285  4,
286  (uint8_t *)&thread_list_size);
287 
288  if (retval != ERROR_OK) {
289  LOG_ERROR("Could not read ThreadX thread count from target");
290  return retval;
291  }
292 
293  /* wipe out previous thread details if any */
295 
296  /* read the current thread id */
297  retval = target_read_buffer(rtos->target,
299  4,
300  (uint8_t *)&rtos->current_thread);
301 
302  if (retval != ERROR_OK) {
303  LOG_ERROR("Could not read ThreadX current thread from target");
304  return retval;
305  }
306 
307  if ((thread_list_size == 0) || (rtos->current_thread == 0)) {
308  /* Either : No RTOS threads - there is always at least the current execution though */
309  /* OR : No current thread - all threads suspended - show the current execution
310  * of idling */
311  char tmp_str[] = "Current Execution";
312  thread_list_size++;
313  tasks_found++;
314  rtos->thread_details = malloc(
315  sizeof(struct thread_detail) * thread_list_size);
317  rtos->thread_details->exists = true;
319  rtos->thread_details->thread_name_str = malloc(sizeof(tmp_str));
320  strcpy(rtos->thread_details->thread_name_str, tmp_str);
321 
322  /* If we just invented thread 1 to represent the current execution, we
323  * need to make sure the RTOS object also claims it's the current thread
324  * so that threadx_get_thread_reg_list() doesn't attempt to read a
325  * thread control block at 0x00000001. */
326  rtos->current_thread = 1;
327 
328  if (thread_list_size == 0) {
329  rtos->thread_count = 1;
330  return ERROR_OK;
331  }
332  } else {
333  /* create space for new thread details */
334  rtos->thread_details = malloc(
335  sizeof(struct thread_detail) * thread_list_size);
336  }
337 
338  /* Read the pointer to the first thread */
339  int64_t thread_ptr = 0;
340  retval = target_read_buffer(rtos->target,
342  param->pointer_width,
343  (uint8_t *)&thread_ptr);
344  if (retval != ERROR_OK) {
345  LOG_ERROR("Could not read ThreadX thread location from target");
346  return retval;
347  }
348 
349  /* loop over all threads */
350  int64_t prev_thread_ptr = 0;
351  while ((thread_ptr != prev_thread_ptr) && (tasks_found < thread_list_size)) {
352 
353  #define THREADX_THREAD_NAME_STR_SIZE (200)
354  char tmp_str[THREADX_THREAD_NAME_STR_SIZE];
355  unsigned int i = 0;
356  int64_t name_ptr = 0;
357 
358  /* Save the thread pointer */
359  rtos->thread_details[tasks_found].threadid = thread_ptr;
360 
361  /* read the name pointer */
362  retval = target_read_buffer(rtos->target,
363  thread_ptr + param->thread_name_offset,
364  param->pointer_width,
365  (uint8_t *)&name_ptr);
366  if (retval != ERROR_OK) {
367  LOG_ERROR("Could not read ThreadX thread name pointer from target");
368  return retval;
369  }
370 
371  /* Read the thread name */
372  tmp_str[0] = '\x00';
373 
374  /* Check if thread has a valid name */
375  if (name_ptr != 0) {
376  retval =
378  name_ptr,
380  (uint8_t *)&tmp_str);
381  if (retval != ERROR_OK) {
382  LOG_ERROR("Error reading thread name from ThreadX target");
383  return retval;
384  }
385  tmp_str[THREADX_THREAD_NAME_STR_SIZE - 1] = '\x00';
386  }
387 
388  if (tmp_str[0] == '\x00')
389  strcpy(tmp_str, "No Name");
390 
391  rtos->thread_details[tasks_found].thread_name_str =
392  malloc(strlen(tmp_str)+1);
393  strcpy(rtos->thread_details[tasks_found].thread_name_str, tmp_str);
394 
395  /* Read the thread status */
396  int64_t thread_status = 0;
397  retval = target_read_buffer(rtos->target,
398  thread_ptr + param->thread_state_offset,
399  4,
400  (uint8_t *)&thread_status);
401  if (retval != ERROR_OK) {
402  LOG_ERROR("Error reading thread state from ThreadX target");
403  return retval;
404  }
405 
406  for (i = 0; (i < THREADX_NUM_STATES) &&
407  (threadx_thread_states[i].value != thread_status); i++) {
408  /* empty */
409  }
410 
411  const char *state_desc;
412  if (i < THREADX_NUM_STATES)
413  state_desc = threadx_thread_states[i].desc;
414  else
415  state_desc = "Unknown state";
416 
417  rtos->thread_details[tasks_found].extra_info_str = malloc(strlen(
418  state_desc)+8);
419  sprintf(rtos->thread_details[tasks_found].extra_info_str, "State: %s", state_desc);
420 
421  rtos->thread_details[tasks_found].exists = true;
422 
423  tasks_found++;
424  prev_thread_ptr = thread_ptr;
425 
426  /* Get the location of the next thread structure. */
427  thread_ptr = 0;
428  retval = target_read_buffer(rtos->target,
429  prev_thread_ptr + param->thread_next_offset,
430  param->pointer_width,
431  (uint8_t *) &thread_ptr);
432  if (retval != ERROR_OK) {
433  LOG_ERROR("Error reading next thread pointer in ThreadX thread list");
434  return retval;
435  }
436  }
437 
438  rtos->thread_count = tasks_found;
439 
440  return 0;
441 }
442 
443 static int threadx_get_thread_reg_list(struct rtos *rtos, int64_t thread_id,
444  struct rtos_reg **reg_list, int *num_regs)
445 {
446  int retval;
447  const struct threadx_params *param;
448 
449  if (!rtos)
450  return -1;
451 
452  if (!is_thread_id_valid(rtos, thread_id))
453  return -2;
454 
456  return -3;
457 
458  param = (const struct threadx_params *) rtos->rtos_specific_params;
459 
460  /* Read the stack pointer */
461  int64_t stack_ptr = 0;
462  retval = target_read_buffer(rtos->target,
463  thread_id + param->thread_stack_offset,
464  param->pointer_width,
465  (uint8_t *)&stack_ptr);
466  if (retval != ERROR_OK) {
467  LOG_ERROR("Error reading stack frame from ThreadX thread");
468  return retval;
469  }
470 
471  LOG_INFO("thread: 0x%" PRIx64 ", stack_ptr=0x%" PRIx64, (uint64_t)thread_id, (uint64_t)stack_ptr);
472 
473  if (stack_ptr == 0) {
474  LOG_ERROR("null stack pointer in thread");
475  return -5;
476  }
477 
478  const struct rtos_register_stacking *stacking_info =
479  get_stacking_info(rtos, stack_ptr);
480 
481  if (!stacking_info) {
482  LOG_ERROR("Unknown stacking info for thread id=0x%" PRIx64, (uint64_t)thread_id);
483  return -6;
484  }
485 
486  return rtos_generic_stack_read(rtos->target, stacking_info, stack_ptr, reg_list, num_regs);
487 }
488 
489 static int threadx_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
490 {
491  unsigned int i;
492  *symbol_list = calloc(
494 
495  for (i = 0; i < ARRAY_SIZE(threadx_symbol_list); i++)
496  (*symbol_list)[i].symbol_name = threadx_symbol_list[i];
497 
498  return 0;
499 }
500 
501 static bool threadx_detect_rtos(struct target *target)
502 {
503  if ((target->rtos->symbols) &&
505  /* looks like ThreadX */
506  return true;
507  }
508  return false;
509 }
510 
511 #if 0
512 
513 static int threadx_set_current_thread(struct rtos *rtos, threadid_t thread_id)
514 {
515  return 0;
516 }
517 
518 static int threadx_get_thread_detail(struct rtos *rtos,
519  threadid_t thread_id,
520  struct thread_detail *detail)
521 {
522  unsigned int i = 0;
523  int retval;
524 
525 #define THREADX_THREAD_NAME_STR_SIZE (200)
526  char tmp_str[THREADX_THREAD_NAME_STR_SIZE];
527 
528  const struct threadx_params *param;
529 
530  if (!rtos)
531  return -1;
532 
533  if (thread_id == 0)
534  return -2;
535 
537  return -3;
538 
539  param = (const struct threadx_params *) rtos->rtos_specific_params;
540 
541  if (!rtos->symbols) {
542  LOG_ERROR("No symbols for ThreadX");
543  return -3;
544  }
545 
546  detail->threadid = thread_id;
547 
548  int64_t name_ptr = 0;
549  /* read the name pointer */
550  retval = target_read_buffer(rtos->target,
551  thread_id + param->thread_name_offset,
552  param->pointer_width,
553  (uint8_t *)&name_ptr);
554  if (retval != ERROR_OK) {
555  LOG_ERROR("Could not read ThreadX thread name pointer from target");
556  return retval;
557  }
558 
559  /* Read the thread name */
560  retval = target_read_buffer(rtos->target,
561  name_ptr,
563  (uint8_t *)&tmp_str);
564  if (retval != ERROR_OK) {
565  LOG_ERROR("Error reading thread name from ThreadX target");
566  return retval;
567  }
568  tmp_str[THREADX_THREAD_NAME_STR_SIZE-1] = '\x00';
569 
570  if (tmp_str[0] == '\x00')
571  strcpy(tmp_str, "No Name");
572 
573  detail->thread_name_str = malloc(strlen(tmp_str)+1);
574 
575  /* Read the thread status */
576  int64_t thread_status = 0;
577  retval =
579  thread_id + param->thread_state_offset,
580  4,
581  (uint8_t *)&thread_status);
582  if (retval != ERROR_OK) {
583  LOG_ERROR("Error reading thread state from ThreadX target");
584  return retval;
585  }
586 
587  for (i = 0; (i < THREADX_NUM_STATES) &&
588  (threadx_thread_states[i].value != thread_status); i++) {
589  /* empty */
590  }
591 
592  char *state_desc;
593  if (i < THREADX_NUM_STATES)
594  state_desc = threadx_thread_states[i].desc;
595  else
596  state_desc = "Unknown state";
597 
598  detail->extra_info_str = malloc(strlen(state_desc)+1);
599 
600  detail->exists = true;
601 
602  return 0;
603 }
604 
605 #endif
606 
607 static int threadx_create(struct target *target)
608 {
609  for (unsigned int i = 0; i < ARRAY_SIZE(threadx_params_list); i++)
610  if (strcmp(threadx_params_list[i].target_name, target_type_name(target)) == 0) {
612  target->rtos->current_thread = 0;
614  return 0;
615  }
616 
617  LOG_ERROR("Could not find target in ThreadX compatibility list");
618  return -1;
619 }
static const struct rtos_register_stacking * get_stacking_info(const struct rtos *rtos, int64_t stack_ptr)
Definition: ThreadX.c:203
static const struct threadx_params threadx_params_list[]
Definition: ThreadX.c:129
#define ARM926EJS_REGISTERS_SIZE_SOLICITED
Definition: ThreadX.c:58
#define THREADX_THREAD_NAME_STR_SIZE
static int threadx_create(struct target *target)
Definition: ThreadX.c:607
static const struct rtos_register_stacking * get_stacking_info_arm926ejs(const struct rtos *rtos, int64_t stack_ptr)
Definition: ThreadX.c:228
static const char *const threadx_symbol_list[]
Definition: ThreadX.c:186
#define ARM926EJS_REGISTERS_SIZE_INTERRUPT
Definition: ThreadX.c:80
const struct rtos_type threadx_rtos
Definition: ThreadX.c:193
static bool threadx_detect_rtos(struct target *target)
Definition: ThreadX.c:501
static const struct rtos_register_stacking rtos_threadx_arm926ejs_stacking[]
Definition: ThreadX.c:101
static const struct stack_register_offset rtos_threadx_arm926ejs_stack_offsets_solicited[]
Definition: ThreadX.c:59
static int threadx_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, struct rtos_reg **reg_list, int *num_regs)
Definition: ThreadX.c:443
static int threadx_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
Definition: ThreadX.c:489
static int is_thread_id_valid_arm926ejs(const struct rtos *rtos, int64_t thread_id)
Definition: ThreadX.c:252
static int threadx_update_threads(struct rtos *rtos)
Definition: ThreadX.c:257
threadx_symbol_values
Definition: ThreadX.c:180
@ THREADX_VAL_TX_THREAD_CREATED_PTR
Definition: ThreadX.c:182
@ THREADX_VAL_TX_THREAD_CURRENT_PTR
Definition: ThreadX.c:181
@ THREADX_VAL_TX_THREAD_CREATED_COUNT
Definition: ThreadX.c:183
static const struct threadx_thread_state threadx_thread_states[]
Definition: ThreadX.c:39
static const struct stack_register_offset rtos_threadx_arm926ejs_stack_offsets_interrupt[]
Definition: ThreadX.c:81
#define THREADX_NUM_STATES
Definition: ThreadX.c:56
static int is_thread_id_valid(const struct rtos *rtos, int64_t thread_id)
Definition: ThreadX.c:213
The JTAG interface can be implemented with a software or hardware fifo.
#define LOG_ERROR(expr ...)
Definition: log.h:132
#define LOG_INFO(expr ...)
Definition: log.h:126
#define LOG_DEBUG(expr ...)
Definition: log.h:109
#define ERROR_OK
Definition: log.h:164
int flag
Definition: mips64.c:29
static const struct rtos_register_stacking * stacking_info
Definition: riot.c:72
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)
Definition: rtos.c:602
void rtos_free_threadlist(struct rtos *rtos)
Definition: rtos.c:695
int64_t threadid_t
Definition: rtos.h:15
const struct rtos_register_stacking rtos_standard_cortex_m3_stacking
const struct rtos_register_stacking rtos_standard_cortex_r4_stacking
Definition: rtos.h:53
unsigned char stack_registers_size
Definition: rtos.h:92
Definition: rtos.h:59
const char * name
Definition: rtos.h:60
Definition: rtos.h:36
int thread_count
Definition: rtos.h:47
struct thread_detail * thread_details
Definition: rtos.h:46
struct symbol_table_elem * symbols
Definition: rtos.h:39
struct target * target
Definition: rtos.h:40
void * rtos_specific_params
Definition: rtos.h:50
threadid_t current_thread
Definition: rtos.h:45
Table should be terminated by an element with NULL in symbol_name.
Definition: rtos.h:23
symbol_address_t address
Definition: rtos.h:25
Definition: target.h:116
struct rtos * rtos
Definition: target.h:183
char * extra_info_str
Definition: rtos.h:33
char * thread_name_str
Definition: rtos.h:32
bool exists
Definition: rtos.h:31
threadid_t threadid
Definition: rtos.h:30
unsigned char thread_state_offset
Definition: ThreadX.c:121
unsigned char pointer_width
Definition: ThreadX.c:118
const struct rtos_register_stacking *(* fn_get_stacking_info)(const struct rtos *rtos, int64_t stack_ptr)
Definition: ThreadX.c:125
size_t stacking_info_nb
Definition: ThreadX.c:124
const struct rtos_register_stacking * stacking_info
Definition: ThreadX.c:123
unsigned char thread_next_offset
Definition: ThreadX.c:122
const char * target_name
Definition: ThreadX.c:117
int(* fn_is_thread_id_valid)(const struct rtos *rtos, int64_t thread_id)
Definition: ThreadX.c:126
unsigned char thread_stack_offset
Definition: ThreadX.c:119
unsigned char thread_name_offset
Definition: ThreadX.c:120
const char * desc
Definition: ThreadX.c:36
int target_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
Definition: target.c:2407
const char * target_type_name(const struct target *target)
Get the target type name.
Definition: target.c:736
static const char * target_name(const struct target *target)
Returns the instance-specific name of the specified target.
Definition: target.h:233
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.
Definition: types.h:57
#define NULL
Definition: usb.h:16