5a37bd4c52b4ef72594a3cd6e39908afd846ba18
[openocd.git] / contrib / rtos-helpers / uCOS-III-openocd.c
1 /*
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.
8 *
9 * This file should be linked along with the project to enable RTOS
10 * support for uC/OS-III.
11 */
12
13 #include <os.h>
14
15 #if OS_CFG_DBG_EN == 0
16 #error "OS_CFG_DBG_EN is required to enable RTOS support for OpenOCD"
17 #endif
18
19 #define OFFSET_OF(type, member) ((CPU_SIZE_T)&(((type *)0)->member))
20
21 #ifdef __GNUC__
22 #define USED __attribute__((used))
23 #else
24 #define USED
25 #endif
26
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);

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)