1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

core: add comments to symbols used by OpenOCD

OpenOCD makes assumptions about those symbol names / enum entries,
so add a note about it as a comment.
This commit is contained in:
Benjamin Valentin 2020-07-27 13:48:59 +02:00
parent 42eb044ec6
commit 4d34cee72f
2 changed files with 17 additions and 12 deletions

View File

@ -97,6 +97,8 @@ typedef struct _thread thread_t;
/**
* @name Thread states supported by RIOT
*
* Keep in sync with OpenOCD src/rtos/riot.c
* @{
*/
typedef enum {

View File

@ -40,18 +40,6 @@
#include <inttypes.h>
#endif
volatile int sched_num_threads = 0;
volatile unsigned int sched_context_switch_request;
volatile thread_t *sched_threads[KERNEL_PID_LAST + 1];
volatile thread_t *sched_active_thread;
volatile kernel_pid_t sched_active_pid = KERNEL_PID_UNDEF;
clist_node_t sched_runqueues[SCHED_PRIO_LEVELS];
static uint32_t runqueue_bitcache = 0;
/* Needed by OpenOCD to read sched_threads */
#if defined(__APPLE__) && defined(__MACH__)
#define FORCE_USED_SECTION __attribute__((used)) __attribute__((section( \
@ -61,6 +49,14 @@ static uint32_t runqueue_bitcache = 0;
".openocd")))
#endif
/**
* @brief Symbols also used by OpenOCD, keep in sync with src/rtos/riot.c
* @{
*/
volatile kernel_pid_t sched_active_pid = KERNEL_PID_UNDEF;
volatile thread_t *sched_threads[KERNEL_PID_LAST + 1];
volatile int sched_num_threads = 0;
FORCE_USED_SECTION
const uint8_t max_threads = ARRAY_SIZE(sched_threads);
@ -70,6 +66,13 @@ const uint8_t max_threads = ARRAY_SIZE(sched_threads);
FORCE_USED_SECTION
const uint8_t _tcb_name_offset = offsetof(thread_t, name);
#endif
/** @} */
volatile thread_t *sched_active_thread;
volatile unsigned int sched_context_switch_request;
clist_node_t sched_runqueues[SCHED_PRIO_LEVELS];
static uint32_t runqueue_bitcache = 0;
#ifdef MODULE_SCHED_CB
static void (*sched_cb) (kernel_pid_t active_thread,