OpenOCD
ChibiOS.c
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2012 by Matthias Blaicher *
3  * Matthias Blaicher - matthias@blaicher.com *
4  * *
5  * Copyright (C) 2011 by Broadcom Corporation *
6  * Evan Hunter - ehunter@broadcom.com *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
20  ***************************************************************************/
21 
22 #ifdef HAVE_CONFIG_H
23 #include "config.h"
24 #endif
25 
26 #include <helper/time_support.h>
27 #include <jtag/jtag.h>
28 #include "target/target.h"
29 #include "target/target_type.h"
30 #include "target/armv7m.h"
31 #include "target/cortex_m.h"
32 #include "rtos.h"
33 #include "helper/log.h"
34 #include "helper/types.h"
35 #include "rtos_chibios_stackings.h"
36 
43  char ch_identifier[4];
44  uint8_t ch_zero;
45  uint8_t ch_size;
46  uint16_t ch_version;
47  uint8_t ch_ptrsize;
48  uint8_t ch_timesize;
49  uint8_t ch_threadsize;
50  uint8_t cf_off_prio;
51  uint8_t cf_off_ctx;
52  uint8_t cf_off_newer;
53  uint8_t cf_off_older;
54  uint8_t cf_off_name;
55  uint8_t cf_off_stklimit;
57  uint8_t cf_off_state;
58  uint8_t cf_off_flags;
59  uint8_t cf_off_refs;
60  uint8_t cf_off_preempt;
62  uint8_t cf_off_time;
63 };
64 
65 #define GET_CH_KERNEL_MAJOR(codedVersion) ((codedVersion >> 11) & 0x1f)
66 #define GET_CH_KERNEL_MINOR(codedVersion) ((codedVersion >> 6) & 0x1f)
67 #define GET_CH_KERNEL_PATCH(codedVersion) ((codedVersion >> 0) & 0x3f)
68 
72 static const char * const ChibiOS_thread_states[] = {
73  "READY", "CURRENT", "SUSPENDED", "WTSEM", "WTMTX", "WTCOND", "SLEEPING",
74  "WTEXIT", "WTOREVT", "WTANDEVT", "SNDMSGQ", "SNDMSG", "WTMSG", "WTQUEUE",
75  "FINAL"
76 };
77 
78 #define CHIBIOS_NUM_STATES (sizeof(ChibiOS_thread_states)/sizeof(char *))
79 
80 /* Maximum ChibiOS thread name. There is no real limit set by ChibiOS but 64
81  * chars ought to be enough.
82  */
83 #define CHIBIOS_THREAD_NAME_STR_SIZE (64)
84 
86  const char *target_name;
87 
90 };
91 
93  {
94  "cortex_m", /* target_name */
95  0,
96  NULL, /* stacking_info */
97  },
98  {
99  "hla_target", /* target_name */
100  0,
101  NULL, /* stacking_info */
102  }
103 };
104 #define CHIBIOS_NUM_PARAMS ((int)(sizeof(ChibiOS_params_list)/sizeof(struct ChibiOS_params)))
105 
106 static int ChibiOS_detect_rtos(struct target *target);
107 static int ChibiOS_create(struct target *target);
108 static int ChibiOS_update_threads(struct rtos *rtos);
109 static int ChibiOS_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, char **hex_reg_list);
110 static int ChibiOS_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[]);
111 
113  .name = "ChibiOS",
114 
115  .detect_rtos = ChibiOS_detect_rtos,
116  .create = ChibiOS_create,
117  .update_threads = ChibiOS_update_threads,
118  .get_thread_reg_list = ChibiOS_get_thread_reg_list,
119  .get_symbol_list_to_lookup = ChibiOS_get_symbol_list_to_lookup,
120 };
121 
122 
123 /* In ChibiOS/RT 3.0 the rlist structure has become part of a system
124  * data structure ch. We declare both symbols as optional and later
125  * use whatever is available.
126  */
127 
132 };
133 
135  { "rlist", 0, true}, /* Thread ready list */
136  { "ch", 0, true}, /* System data structure */
137  { "ch_debug", 0, false}, /* Memory Signature containing offsets of fields in rlist */
138  { NULL, 0, false}
139 };
140 
141 /* Offset of the rlist structure within the system data structure (ch) */
142 #define CH_RLIST_OFFSET 0x00
143 
145 {
146  int retval;
147  struct ChibiOS_params *param;
148  struct ChibiOS_chdebug *signature;
149 
150  param = (struct ChibiOS_params *) rtos->rtos_specific_params;
151 
152  /* Free existing memory description.*/
153  if (param->signature) {
154  free(param->signature);
155  param->signature = 0;
156  }
157 
158  signature = malloc(sizeof(*signature));
159  if (!signature) {
160  LOG_ERROR("Could not allocate space for ChibiOS/RT memory signature");
161  return -1;
162  }
163 
164  retval = target_read_buffer(rtos->target,
166  sizeof(*signature),
167  (uint8_t *) signature);
168  if (retval != ERROR_OK) {
169  LOG_ERROR("Could not read ChibiOS/RT memory signature from target");
170  goto errfree;
171  }
172 
173  if (strncmp(signature->ch_identifier, "main", 4) != 0) {
174  LOG_ERROR("Memory signature identifier does not contain magic bytes.");
175  goto errfree;
176  }
177 
178  if (signature->ch_size < sizeof(*signature)) {
179  LOG_ERROR("ChibiOS/RT memory signature claims to be smaller "
180  "than expected");
181  goto errfree;
182  }
183 
184  if (signature->ch_size > sizeof(*signature)) {
185  LOG_WARNING("ChibiOS/RT memory signature claims to be bigger than"
186  " expected. Assuming compatibility...");
187  }
188 
189  /* Convert endianness of version field */
190  const uint8_t *versionTarget = (const uint8_t *)
191  &signature->ch_version;
192  signature->ch_version = rtos->target->endianness == TARGET_LITTLE_ENDIAN ?
193  le_to_h_u32(versionTarget) : be_to_h_u32(versionTarget);
194 
195  const uint16_t ch_version = signature->ch_version;
196  LOG_INFO("Successfully loaded memory map of ChibiOS/RT target "
197  "running version %i.%i.%i", GET_CH_KERNEL_MAJOR(ch_version),
198  GET_CH_KERNEL_MINOR(ch_version), GET_CH_KERNEL_PATCH(ch_version));
199 
200  /* Currently, we have the inherent assumption that all address pointers
201  * are 32 bit wide. */
202  if (signature->ch_ptrsize != sizeof(uint32_t)) {
203  LOG_ERROR("ChibiOS/RT target memory signature claims an address"
204  "width unequal to 32 bits!");
205  free(signature);
206  return -1;
207  }
208 
209  param->signature = signature;
210  return 0;
211 
212 errfree:
213  /* Error reading the ChibiOS memory structure */
214  free(signature);
215  param->signature = 0;
216  return -1;
217 }
218 
219 
220 static int ChibiOS_update_stacking(struct rtos *rtos)
221 {
222  /* Sometimes the stacking can not be determined only by looking at the
223  * target name but only a runtime.
224  *
225  * For example, this is the case for Cortex-M4 targets and ChibiOS which
226  * only stack the FPU registers if it is enabled during ChibiOS build.
227  *
228  * Terminating which stacking is used is target depending.
229  *
230  * Assumptions:
231  * - Once ChibiOS is actually initialized, the stacking is fixed.
232  * - During startup code, the FPU might not be initialized and the
233  * detection might fail.
234  * - Since no threads are running during startup, the problem is solved
235  * by delaying stacking detection until there are more threads
236  * available than the current execution. In which case
237  * ChibiOS_get_thread_reg_list is called.
238  */
239  int retval;
240 
241  if (!rtos->rtos_specific_params)
242  return -1;
243 
244  struct ChibiOS_params *param;
245  param = (struct ChibiOS_params *) rtos->rtos_specific_params;
246 
247  /* Check for armv7m with *enabled* FPU, i.e. a Cortex-M4 */
248  struct armv7m_common *armv7m_target = target_to_armv7m(rtos->target);
249  if (is_armv7m(armv7m_target)) {
250  if (armv7m_target->fp_feature == FPv4_SP) {
251  /* Found ARM v7m target which includes a FPU */
252  uint32_t cpacr;
253 
254  retval = target_read_u32(rtos->target, FPU_CPACR, &cpacr);
255  if (retval != ERROR_OK) {
256  LOG_ERROR("Could not read CPACR register to check FPU state");
257  return -1;
258  }
259 
260  /* Check if CP10 and CP11 are set to full access.
261  * In ChibiOS this is done in ResetHandler() in crt0.c */
262  if (cpacr & 0x00F00000) {
263  LOG_DEBUG("Enabled FPU detected.");
265  return 0;
266  }
267  }
268 
269  /* Found ARM v7m target with no or disabled FPU */
271  return 0;
272  }
273 
274  return -1;
275 }
276 
277 static int ChibiOS_update_threads(struct rtos *rtos)
278 {
279  int retval;
280  const struct ChibiOS_params *param;
281  int tasks_found = 0;
282  int rtos_valid = -1;
283 
284  if (!rtos->rtos_specific_params)
285  return -1;
286 
287  if (!rtos->symbols) {
288  LOG_ERROR("No symbols for ChibiOS");
289  return -3;
290  }
291 
292  param = (const struct ChibiOS_params *) rtos->rtos_specific_params;
293  /* Update the memory signature saved in the target memory */
294  if (!param->signature) {
295  retval = ChibiOS_update_memory_signature(rtos);
296  if (retval != ERROR_OK) {
297  LOG_ERROR("Reading the memory signature of ChibiOS/RT failed");
298  return retval;
299  }
300  }
301 
302  /* wipe out previous thread details if any */
303  rtos_free_threadlist(rtos);
304 
305  /* ChibiOS does not save the current thread count. We have to first
306  * parse the double linked thread list to check for errors and the number of
307  * threads. */
308  const uint32_t rlist = rtos->symbols[ChibiOS_VAL_rlist].address ?
310  rtos->symbols[ChibiOS_VAL_ch].address + CH_RLIST_OFFSET /* ChibiOS3 */;
311  const struct ChibiOS_chdebug *signature = param->signature;
312  uint32_t current;
313  uint32_t previous;
314  uint32_t older;
315 
316  current = rlist;
317  previous = rlist;
318  while (1) {
319  retval = target_read_u32(rtos->target,
320  current + signature->cf_off_newer, &current);
321  if (retval != ERROR_OK) {
322  LOG_ERROR("Could not read next ChibiOS thread");
323  return retval;
324  }
325  /* Could be NULL if the kernel is not initialized yet or if the
326  * registry is corrupted. */
327  if (current == 0) {
328  LOG_ERROR("ChibiOS registry integrity check failed, NULL pointer");
329 
330  rtos_valid = 0;
331  break;
332  }
333  /* Fetch previous thread in the list as a integrity check. */
334  retval = target_read_u32(rtos->target,
335  current + signature->cf_off_older, &older);
336  if ((retval != ERROR_OK) || (older == 0) || (older != previous)) {
337  LOG_ERROR("ChibiOS registry integrity check failed, "
338  "double linked list violation");
339  rtos_valid = 0;
340  break;
341  }
342  /* Check for full iteration of the linked list. */
343  if (current == rlist)
344  break;
345  tasks_found++;
346  previous = current;
347  }
348  if (!rtos_valid) {
349  /* No RTOS, there is always at least the current execution, though */
350  LOG_INFO("Only showing current execution because of a broken "
351  "ChibiOS thread registry.");
352 
353  const char tmp_thread_name[] = "Current Execution";
354  const char tmp_thread_extra_info[] = "No RTOS thread";
355 
356  rtos->thread_details = malloc(
357  sizeof(struct thread_detail));
358  rtos->thread_details->threadid = 1;
359  rtos->thread_details->exists = true;
360 
361  rtos->thread_details->extra_info_str = malloc(
362  sizeof(tmp_thread_extra_info));
363  strcpy(rtos->thread_details->extra_info_str, tmp_thread_extra_info);
364 
365  rtos->thread_details->thread_name_str = malloc(
366  sizeof(tmp_thread_name));
367  strcpy(rtos->thread_details->thread_name_str, tmp_thread_name);
368 
369  rtos->current_thread = 1;
370  rtos->thread_count = 1;
371  return ERROR_OK;
372  }
373 
374  /* create space for new thread details */
375  rtos->thread_details = malloc(
376  sizeof(struct thread_detail) * tasks_found);
377  if (!rtos->thread_details) {
378  LOG_ERROR("Could not allocate space for thread details");
379  return -1;
380  }
381 
382  rtos->thread_count = tasks_found;
383  /* Loop through linked list. */
384  struct thread_detail *curr_thrd_details = rtos->thread_details;
385  while (curr_thrd_details < rtos->thread_details + tasks_found) {
386  uint32_t name_ptr = 0;
387  char tmp_str[CHIBIOS_THREAD_NAME_STR_SIZE];
388 
389  retval = target_read_u32(rtos->target,
390  current + signature->cf_off_newer, &current);
391  if (retval != ERROR_OK) {
392  LOG_ERROR("Could not read next ChibiOS thread");
393  return -6;
394  }
395 
396  /* Check for full iteration of the linked list. */
397  if (current == rlist)
398  break;
399 
400  /* Save the thread pointer */
401  curr_thrd_details->threadid = current;
402 
403  /* read the name pointer */
404  retval = target_read_u32(rtos->target,
405  current + signature->cf_off_name, &name_ptr);
406  if (retval != ERROR_OK) {
407  LOG_ERROR("Could not read ChibiOS thread name pointer from target");
408  return retval;
409  }
410 
411  /* Read the thread name */
412  retval = target_read_buffer(rtos->target, name_ptr,
414  (uint8_t *)&tmp_str);
415  if (retval != ERROR_OK) {
416  LOG_ERROR("Error reading thread name from ChibiOS target");
417  return retval;
418  }
419  tmp_str[CHIBIOS_THREAD_NAME_STR_SIZE - 1] = '\x00';
420 
421  if (tmp_str[0] == '\x00')
422  strcpy(tmp_str, "No Name");
423 
424  curr_thrd_details->thread_name_str = malloc(
425  strlen(tmp_str) + 1);
426  strcpy(curr_thrd_details->thread_name_str, tmp_str);
427 
428  /* State info */
429  uint8_t threadState;
430  const char *state_desc;
431 
432  retval = target_read_u8(rtos->target,
433  current + signature->cf_off_state, &threadState);
434  if (retval != ERROR_OK) {
435  LOG_ERROR("Error reading thread state from ChibiOS target");
436  return retval;
437  }
438 
439 
440  if (threadState < CHIBIOS_NUM_STATES)
441  state_desc = ChibiOS_thread_states[threadState];
442  else
443  state_desc = "Unknown";
444 
445  curr_thrd_details->extra_info_str = malloc(strlen(
446  state_desc)+8);
447  sprintf(curr_thrd_details->extra_info_str, "State: %s", state_desc);
448 
449  curr_thrd_details->exists = true;
450 
451  curr_thrd_details++;
452  }
453 
454  uint32_t current_thrd;
455  /* NOTE: By design, cf_off_name equals readylist_current_offset */
456  retval = target_read_u32(rtos->target,
457  rlist + signature->cf_off_name,
458  &current_thrd);
459  if (retval != ERROR_OK) {
460  LOG_ERROR("Could not read current Thread from ChibiOS target");
461  return retval;
462  }
463  rtos->current_thread = current_thrd;
464 
465  return 0;
466 }
467 
468 static int ChibiOS_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, char **hex_reg_list)
469 {
470  int retval;
471  const struct ChibiOS_params *param;
472  uint32_t stack_ptr = 0;
473 
474  *hex_reg_list = NULL;
475  if ((rtos == NULL) || (thread_id == 0) ||
476  (rtos->rtos_specific_params == NULL))
477  return -1;
478 
479  param = (const struct ChibiOS_params *) rtos->rtos_specific_params;
480 
481  if (!param->signature)
482  return -1;
483 
484  /* Update stacking if it can only be determined from runtime information */
485  if ((param->stacking_info == 0) &&
486  (ChibiOS_update_stacking(rtos) != ERROR_OK)) {
487  LOG_ERROR("Failed to determine exact stacking for the target type %s", rtos->target->type->name);
488  return -1;
489  }
490 
491  /* Read the stack pointer */
492  retval = target_read_u32(rtos->target,
493  thread_id + param->signature->cf_off_ctx, &stack_ptr);
494  if (retval != ERROR_OK) {
495  LOG_ERROR("Error reading stack frame from ChibiOS thread");
496  return retval;
497  }
498 
499  return rtos_generic_stack_read(rtos->target, param->stacking_info, stack_ptr, hex_reg_list);
500 }
501 
503 {
504  *symbol_list = malloc(sizeof(ChibiOS_symbol_list));
505 
506  if (*symbol_list == NULL)
507  return ERROR_FAIL;
508 
509  memcpy(*symbol_list, ChibiOS_symbol_list, sizeof(ChibiOS_symbol_list));
510  return 0;
511 }
512 
513 static int ChibiOS_detect_rtos(struct target *target)
514 {
515  if ((target->rtos->symbols != NULL) &&
516  ((target->rtos->symbols[ChibiOS_VAL_rlist].address != 0) ||
517  (target->rtos->symbols[ChibiOS_VAL_ch].address != 0))) {
518 
519  if (target->rtos->symbols[ChibiOS_VAL_ch_debug].address == 0) {
520  LOG_INFO("It looks like the target may be running ChibiOS "
521  "without ch_debug.");
522  return 0;
523  }
524 
525  /* looks like ChibiOS with memory map enabled.*/
526  return 1;
527  }
528 
529  return 0;
530 }
531 
532 static int ChibiOS_create(struct target *target)
533 {
534  int i = 0;
535  while ((i < CHIBIOS_NUM_PARAMS) &&
536  (0 != strcmp(ChibiOS_params_list[i].target_name, target->type->name))) {
537  i++;
538  }
539  if (i >= CHIBIOS_NUM_PARAMS) {
540  LOG_WARNING("Could not find target \"%s\" in ChibiOS compatibility "
541  "list", target->type->name);
542  return -1;
543  }
544 
545  target->rtos->rtos_specific_params = (void *) &ChibiOS_params_list[i];
546  return 0;
547 }
char * thread_name_str
Definition: rtos.h:42
static struct armv7m_common * target_to_armv7m(struct target *target)
Definition: armv7m.h:172
#define FPU_CPACR
Definition: cortex_m.h:66
uint8_t cf_off_name
Offset of p_name field.
Definition: ChibiOS.c:54
bool exists
Definition: rtos.h:41
threadid_t threadid
Definition: rtos.h:40
int target_read_buffer(struct target *target, uint32_t address, uint32_t size, uint8_t *buffer)
#define LOG_DEBUG(expr...)
Definition: log.h:105
Definition: rtos.h:46
uint8_t cf_off_refs
Offset of p_refs field.
Definition: ChibiOS.c:59
uint8_t cf_off_prio
Offset of p_prio field.
Definition: ChibiOS.c:50
int thread_count
Definition: rtos.h:55
#define CHIBIOS_NUM_PARAMS
Definition: ChibiOS.c:104
const char * name
Name of this type of target.
Definition: target_type.h:42
static int ChibiOS_update_memory_signature(struct rtos *rtos)
Definition: ChibiOS.c:144
const char * target_name
Definition: ChibiOS.c:86
struct target * target
Definition: rtos.h:50
#define LOG_INFO(expr...)
Definition: log.h:113
#define ERROR_FAIL
Definition: log.h:140
symbol_address_t address
Definition: rtos.h:35
ChibiOS_symbol_values
Definition: ChibiOS.c:128
static uint32_t le_to_h_u32(const uint8_t *buf)
Definition: types.h:124
uint8_t ch_size
Size of this structure.
Definition: ChibiOS.c:45
static uint32_t be_to_h_u32(const uint8_t *buf)
Definition: types.h:151
static int ChibiOS_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, char **hex_reg_list)
Definition: ChibiOS.c:468
static int ChibiOS_update_stacking(struct rtos *rtos)
Definition: ChibiOS.c:220
static int ChibiOS_update_threads(struct rtos *rtos)
Definition: ChibiOS.c:277
#define CH_RLIST_OFFSET
Definition: ChibiOS.c:142
const struct rtos_register_stacking * stacking_info
Definition: ChibiOS.c:89
uint8_t cf_off_time
Offset of p_time field.
Definition: ChibiOS.c:62
const char * name
Definition: rtos.h:61
Definition: rtos.h:60
uint8_t ch_timesize
Size of a systime_t.
Definition: ChibiOS.c:48
char ch_identifier[4]
Always set to "main".
Definition: ChibiOS.c:43
void rtos_free_threadlist(struct rtos *rtos)
Definition: rtos.c:550
uint8_t cf_off_newer
Offset of p_newer field.
Definition: ChibiOS.c:52
static bool is_armv7m(struct armv7m_common *armv7m)
Definition: armv7m.h:177
#define GET_CH_KERNEL_MAJOR(codedVersion)
Definition: ChibiOS.c:65
enum target_endianness endianness
Definition: target.h:166
static symbol_table_elem_t ChibiOS_symbol_list[]
Definition: ChibiOS.c:134
int target_read_u32(struct target *target, uint32_t address, uint32_t *value)
Table should be terminated by an element with NULL in symbol_name.
Definition: rtos.h:33
threadid_t current_thread
Definition: rtos.h:53
#define LOG_ERROR(expr...)
Definition: log.h:119
static const char * target_name(struct target *target)
Returns the instance-specific name of the specified target.
Definition: target.h:218
uint16_t ch_version
Encoded ChibiOS/RT version.
Definition: ChibiOS.c:46
int target_read_u8(struct target *target, uint32_t address, uint8_t *value)
static int ChibiOS_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
Definition: ChibiOS.c:502
symbol_table_elem_t * symbols
Definition: rtos.h:49
static struct ChibiOS_params ChibiOS_params_list[]
Definition: ChibiOS.c:92
int rtos_generic_stack_read(struct target *target, const struct rtos_register_stacking *stacking, int64_t stack_ptr, char **hex_reg_list)
Definition: rtos.c:456
static int ChibiOS_detect_rtos(struct target *target)
Definition: ChibiOS.c:513
#define GET_CH_KERNEL_PATCH(codedVersion)
Definition: ChibiOS.c:67
ChibiOS/RT memory signature record.
Definition: ChibiOS.c:42
uint8_t cf_off_stklimit
Offset of p_stklimit field.
Definition: ChibiOS.c:55
struct ChibiOS_chdebug * signature
Definition: ChibiOS.c:88
uint8_t cf_off_ctx
Offset of p_ctx field.
Definition: ChibiOS.c:51
#define CHIBIOS_THREAD_NAME_STR_SIZE
Definition: ChibiOS.c:83
static const char *const ChibiOS_thread_states[]
ChibiOS thread states.
Definition: ChibiOS.c:72
struct target_type * type
Definition: target.h:127
void * rtos_specific_params
Definition: rtos.h:57
#define GET_CH_KERNEL_MINOR(codedVersion)
Definition: ChibiOS.c:66
uint8_t cf_off_preempt
Offset of p_preempt field.
Definition: ChibiOS.c:60
char * extra_info_str
Definition: rtos.h:43
const struct rtos_register_stacking rtos_chibios_arm_v7m_stacking_w_fpu
static struct aice_port_param_s param
#define ERROR_OK
Definition: log.h:134
uint8_t ch_zero
Must be zero.
Definition: ChibiOS.c:44
The JTAG interface can be implemented with a software or hardware fifo.
static int ChibiOS_create(struct target *target)
Definition: ChibiOS.c:532
struct thread_detail * thread_details
Definition: rtos.h:54
const struct rtos_register_stacking rtos_chibios_arm_v7m_stacking
uint8_t ch_ptrsize
Size of a pointer.
Definition: ChibiOS.c:47
#define NULL
Definition: usb.h:27
uint8_t cf_off_state
Offset of p_state field.
Definition: ChibiOS.c:57
uint8_t cf_off_flags
Offset of p_flags field.
Definition: ChibiOS.c:58
uint8_t ch_threadsize
Size of a Thread struct.
Definition: ChibiOS.c:49
#define CHIBIOS_NUM_STATES
Definition: ChibiOS.c:78
uint8_t cf_off_older
Offset of p_older field.
Definition: ChibiOS.c:53
#define LOG_WARNING(expr...)
Definition: log.h:116
struct rtos * rtos
Definition: target.h:188
Definition: target.h:126
struct rtos_type ChibiOS_rtos
Definition: ChibiOS.c:112