mirror of
git://git.code.sf.net/p/openocd/code
synced 2025-07-18 15:20:06 +10:00
With the old checkpatch we cannot use the correct format for the SPDX tags in the file .c, in fact the C99 comments are not allowed and we had to use the block comment. With the new checkpatch, let's switch to the correct SPDX format. Change created automatically through the command: sed -i \ 's,^/\* *\(SPDX-License-Identifier: .*[^ ]\) *\*/$,// \1,' \ $(find src/ contrib/ -name \*.c) Change-Id: I6da16506baa7af718947562505dd49606d124171 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7153 Tested-by: jenkins
35 lines
1.3 KiB
C
35 lines
1.3 KiB
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
/*
|
|
* uC/OS-III does not provide a fixed layout for OS_TCB, which makes it
|
|
* impossible to determine the appropriate offsets within the structure
|
|
* unaided. A priori knowledge of offsets based on os_dbg.c is tied to a
|
|
* specific release and thusly, brittle. The constants defined below
|
|
* provide the necessary information OpenOCD needs to provide support in
|
|
* the most robust manner possible.
|
|
*
|
|
* This file should be linked along with the project to enable RTOS
|
|
* support for uC/OS-III.
|
|
*/
|
|
|
|
#include <os.h>
|
|
|
|
#if OS_CFG_DBG_EN == 0
|
|
#error "OS_CFG_DBG_EN is required to enable RTOS support for OpenOCD"
|
|
#endif
|
|
|
|
#define OFFSET_OF(type, member) ((CPU_SIZE_T)&(((type *)0)->member))
|
|
|
|
#ifdef __GNUC__
|
|
#define USED __attribute__((used))
|
|
#else
|
|
#define USED
|
|
#endif
|
|
|
|
const CPU_SIZE_T USED openocd_OS_TCB_StkPtr_offset = OFFSET_OF(OS_TCB, StkPtr);
|
|
const CPU_SIZE_T USED openocd_OS_TCB_NamePtr_offset = OFFSET_OF(OS_TCB, NamePtr);
|
|
const CPU_SIZE_T USED openocd_OS_TCB_TaskState_offset = OFFSET_OF(OS_TCB, TaskState);
|
|
const CPU_SIZE_T USED openocd_OS_TCB_Prio_offset = OFFSET_OF(OS_TCB, Prio);
|
|
const CPU_SIZE_T USED openocd_OS_TCB_DbgPrevPtr_offset = OFFSET_OF(OS_TCB, DbgPrevPtr);
|
|
const CPU_SIZE_T USED openocd_OS_TCB_DbgNextPtr_offset = OFFSET_OF(OS_TCB, DbgNextPtr);
|