2 * uC/OS-III does not provide a fixed layout for OS_TCB, which makes it
3 * impossible to determine the appropriate offsets within the structure
4 * unaided. A priori knowledge of offsets based on os_dbg.c is tied to a
5 * specific release and thusly, brittle. The constants defined below
6 * provide the necessary information OpenOCD needs to provide support in
7 * the most robust manner possible.
9 * This file should be linked along with the project to enable RTOS
10 * support for uC/OS-III.
15 #if OS_CFG_DBG_EN == 0
16 #error "OS_CFG_DBG_EN is required to enable RTOS support for OpenOCD"
19 #define OFFSET_OF(type, member) ((CPU_SIZE_T)&(((type *)0)->member))
22 #define USED __attribute__((used))
27 const CPU_SIZE_T USED openocd_OS_TCB_StkPtr_offset = OFFSET_OF(OS_TCB, StkPtr);
28 const CPU_SIZE_T USED openocd_OS_TCB_NamePtr_offset = OFFSET_OF(OS_TCB, NamePtr);
29 const CPU_SIZE_T USED openocd_OS_TCB_TaskState_offset = OFFSET_OF(OS_TCB, TaskState);
30 const CPU_SIZE_T USED openocd_OS_TCB_Prio_offset = OFFSET_OF(OS_TCB, Prio);
31 const CPU_SIZE_T USED openocd_OS_TCB_DbgPrevPtr_offset = OFFSET_OF(OS_TCB, DbgPrevPtr);
32 const CPU_SIZE_T USED openocd_OS_TCB_DbgNextPtr_offset = OFFSET_OF(OS_TCB, DbgNextPtr);