From cf204e72ea5fd6e4be8b3295cb148fde5fdd47d2 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 16 Feb 2016 10:07:00 +0000 Subject: Tree reorganization. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8900 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/src/chregistry.c | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) (limited to 'os/rt/src/chregistry.c') diff --git a/os/rt/src/chregistry.c b/os/rt/src/chregistry.c index aacadf22c..07185d331 100644 --- a/os/rt/src/chregistry.c +++ b/os/rt/src/chregistry.c @@ -87,30 +87,26 @@ ROMCONST chdebug_t ch_debug = { (uint8_t)sizeof (void *), (uint8_t)sizeof (systime_t), (uint8_t)sizeof (thread_t), - (uint8_t)_offsetof(thread_t, p_prio), - (uint8_t)_offsetof(thread_t, p_ctx), - (uint8_t)_offsetof(thread_t, p_newer), - (uint8_t)_offsetof(thread_t, p_older), - (uint8_t)_offsetof(thread_t, p_name), + (uint8_t)_offsetof(thread_t, prio), + (uint8_t)_offsetof(thread_t, ctx), + (uint8_t)_offsetof(thread_t, newer), + (uint8_t)_offsetof(thread_t, older), + (uint8_t)_offsetof(thread_t, name), #if CH_DBG_ENABLE_STACK_CHECK == TRUE - (uint8_t)_offsetof(thread_t, p_stklimit), -#else - (uint8_t)0, -#endif - (uint8_t)_offsetof(thread_t, p_state), - (uint8_t)_offsetof(thread_t, p_flags), -#if CH_CFG_USE_DYNAMIC == TRUE - (uint8_t)_offsetof(thread_t, p_refs), + (uint8_t)_offsetof(thread_t, stklimit), #else (uint8_t)0, #endif + (uint8_t)_offsetof(thread_t, state), + (uint8_t)0, /* Flags no more part of the structure. */ + (uint8_t)0, /* Refs no more part of the structure. */ #if CH_CFG_TIME_QUANTUM > 0 - (uint8_t)_offsetof(thread_t, p_preempt), + (uint8_t)_offsetof(thread_t, preempt), #else (uint8_t)0, #endif #if CH_DBG_THREADS_PROFILING == TRUE - (uint8_t)_offsetof(thread_t, p_time) + (uint8_t)_offsetof(thread_t, time) #else (uint8_t)0 #endif @@ -132,10 +128,7 @@ thread_t *chRegFirstThread(void) { thread_t *tp; chSysLock(); - tp = ch.rlist.r_newer; -#if CH_CFG_USE_DYNAMIC == TRUE - tp->p_refs++; -#endif + tp = ch.rlist.newer; chSysUnlock(); return tp; @@ -156,22 +149,13 @@ thread_t *chRegNextThread(thread_t *tp) { thread_t *ntp; chSysLock(); - ntp = tp->p_newer; + ntp = tp->newer; /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/ if (ntp == (thread_t *)&ch.rlist) { /*lint -restore*/ ntp = NULL; } -#if CH_CFG_USE_DYNAMIC == TRUE - else { - chDbgAssert(ntp->p_refs < (trefs_t)255, "too many references"); - ntp->p_refs++; - } -#endif chSysUnlock(); -#if CH_CFG_USE_DYNAMIC == TRUE - chThdRelease(tp); -#endif return ntp; } -- cgit v1.2.3