From d51331c78ad8c4c5ad4769d6271cb0e06c11beb1 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 22 Aug 2012 15:11:04 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4614 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/src/chsys.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'os/kernel/src/chsys.c') diff --git a/os/kernel/src/chsys.c b/os/kernel/src/chsys.c index e433a8e42..5bc86807b 100644 --- a/os/kernel/src/chsys.c +++ b/os/kernel/src/chsys.c @@ -36,9 +36,16 @@ #include "ch.h" #if !CH_NO_IDLE_THREAD || defined(__DOXYGEN__) -/* Idle thread working area.*/ +/** + * @brief Idle thread working area. + */ WORKING_AREA(_idle_thread_wa, PORT_IDLE_THREAD_STACK_SIZE); +/** + * @brief Main thread structure. + */ +Thread _mainthread; + /** * @brief This function implements the idle thread infinite loop. * @details The function puts the processor in the lowest power mode capable @@ -73,7 +80,6 @@ void _idle_thread(void *p) { * @special */ void chSysInit(void) { - static Thread mainthread; #if CH_DBG_ENABLE_STACK_CHECK extern stkalign_t __main_thread_stack_base__; #endif @@ -92,7 +98,7 @@ void chSysInit(void) { #endif /* Now this instructions flow becomes the main thread.*/ - setcurrp(_thread_init(&mainthread, NORMALPRIO)); + setcurrp(_thread_init(&_mainthread, NORMALPRIO)); currp->p_state = THD_STATE_CURRENT; #if CH_DBG_ENABLE_STACK_CHECK /* This is a special case because the main thread Thread structure is not -- cgit v1.2.3