From c17f03701a8d102888ce06752c3b53fc9bd2ddac Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 3 Oct 2012 13:52:13 +0000 Subject: [PATCH] Added GC persistence to the ch_debug object (ex ch_root). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4732 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chregistry.h | 3 ++- os/kernel/src/chregistry.c | 4 ++-- os/kernel/src/chsys.c | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/os/kernel/include/chregistry.h b/os/kernel/include/chregistry.h index dc9fe4225..0669dc43f 100644 --- a/os/kernel/include/chregistry.h +++ b/os/kernel/include/chregistry.h @@ -55,7 +55,7 @@ typedef struct { uint8_t cf_off_preempt; /**< @brief Offset of @p p_preempt field. */ uint8_t cf_off_time; /**< @brief Offset of @p p_time field. */ -} chroot_t; +} chdebug_t; /** * @name Macro Functions @@ -116,6 +116,7 @@ typedef struct { #ifdef __cplusplus extern "C" { #endif + extern volatile 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 971133457..976e3a51a 100644 --- a/os/kernel/src/chregistry.c +++ b/os/kernel/src/chregistry.c @@ -56,9 +56,9 @@ /* * OS signature in ROM plus debug-related information. */ -ROMCONST chroot_t ch_root = { +volatile ROMCONST chdebug_t ch_debug = { "CHRT", - (uint8_t)sizeof (chroot_t), + (uint8_t)sizeof (chdebug_t), (uint8_t)0, (uint16_t)((CH_KERNEL_MAJOR << 11) | (CH_KERNEL_MINOR << 6) | diff --git a/os/kernel/src/chsys.c b/os/kernel/src/chsys.c index 9a7be60ee..10987f56d 100644 --- a/os/kernel/src/chsys.c +++ b/os/kernel/src/chsys.c @@ -83,6 +83,9 @@ void chSysInit(void) { port_init(); _scheduler_init(); _vt_init(); +#if CH_USE_REGISTRY + (void)&ch_debug; +#endif #if CH_USE_MEMCORE _core_init(); #endif