From 6d1ecacaf4a001fea2af72ec3682ace59f45adb8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 3 Oct 2012 19:35:13 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4733 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chregistry.h | 6 +++--- os/kernel/src/chregistry.c | 6 +++--- os/kernel/src/chsys.c | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/os/kernel/include/chregistry.h b/os/kernel/include/chregistry.h index 0669dc43f..a39d37841 100644 --- a/os/kernel/include/chregistry.h +++ b/os/kernel/include/chregistry.h @@ -35,9 +35,9 @@ * @brief ChibiOS/RT memory signature record. */ typedef struct { - char ch_identifier[4]; /**< @brief Always set to "CHRT". */ + char ch_identifier[4]; /**< @brief Always set to "main". */ + uint8_t ch_zero; /**< @brief Must be zero. */ uint8_t ch_size; /**< @brief Size of this structure. */ - uint8_t ch_reserved5; /**< @brief Reserved field. */ uint16_t ch_version; /**< @brief Encoded ChibiOS/RT version. */ uint8_t ch_ptrsize; /**< @brief Size of a pointer. */ uint8_t ch_timesize; /**< @brief Size of a @p systime_t. */ @@ -116,7 +116,7 @@ typedef struct { #ifdef __cplusplus extern "C" { #endif - extern volatile ROMCONST chdebug_t ch_debug; + extern ROMCONST chdebug_t ch_debug; Thread *chRegFirstThread(void); Thread *chRegNextThread(Thread *tp); #ifdef __cplusplus diff --git a/os/kernel/src/chregistry.c b/os/kernel/src/chregistry.c index 976e3a51a..8b9f40f85 100644 --- a/os/kernel/src/chregistry.c +++ b/os/kernel/src/chregistry.c @@ -56,10 +56,10 @@ /* * OS signature in ROM plus debug-related information. */ -volatile ROMCONST chdebug_t ch_debug = { - "CHRT", - (uint8_t)sizeof (chdebug_t), +ROMCONST chdebug_t ch_debug = { + "main", (uint8_t)0, + (uint8_t)sizeof (chdebug_t), (uint16_t)((CH_KERNEL_MAJOR << 11) | (CH_KERNEL_MINOR << 6) | (CH_KERNEL_PATCH) << 0), diff --git a/os/kernel/src/chsys.c b/os/kernel/src/chsys.c index 10987f56d..1946a8263 100644 --- a/os/kernel/src/chsys.c +++ b/os/kernel/src/chsys.c @@ -83,9 +83,6 @@ void chSysInit(void) { port_init(); _scheduler_init(); _vt_init(); -#if CH_USE_REGISTRY - (void)&ch_debug; -#endif #if CH_USE_MEMCORE _core_init(); #endif @@ -106,7 +103,11 @@ void chSysInit(void) { #endif chSysEnable(); +#if CH_USE_REGISTRY + chRegSetThreadName((const char *)&ch_debug); +#else chRegSetThreadName("main"); +#endif #if !CH_NO_IDLE_THREAD /* This thread has the lowest priority in the system, its role is just to