diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-12-11 15:44:16 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2014-12-11 15:44:16 +0000 |
commit | e023f0058dcb36075f3a51072593aeff334eff3c (patch) | |
tree | d0484b57493dc0dae439056adae615ff5369a5a8 /os/rt/src | |
parent | 055fea386e4994a35b758b94f948f9de1c8ba091 (diff) | |
download | ChibiOS-e023f0058dcb36075f3a51072593aeff334eff3c.tar.gz ChibiOS-e023f0058dcb36075f3a51072593aeff334eff3c.tar.bz2 ChibiOS-e023f0058dcb36075f3a51072593aeff334eff3c.zip |
Incorporated main and idle threads data areas into the ch_system structure, moved around some definitions in order to allow this.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7572 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/src')
-rw-r--r-- | os/rt/src/chsys.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/os/rt/src/chsys.c b/os/rt/src/chsys.c index 2a60e6d69..db25fc9d7 100644 --- a/os/rt/src/chsys.c +++ b/os/rt/src/chsys.c @@ -48,13 +48,6 @@ /* Module local variables. */
/*===========================================================================*/
-#if !CH_CFG_NO_IDLE_THREAD || defined(__DOXYGEN__)
-/**
- * @brief Idle thread working area.
- */
-static THD_WORKING_AREA(_idle_thread_wa, PORT_IDLE_THREAD_STACK_SIZE);
-#endif /* CH_CFG_NO_IDLE_THREAD */
-
/*===========================================================================*/
/* Module local functions. */
/*===========================================================================*/
@@ -68,7 +61,7 @@ static THD_WORKING_AREA(_idle_thread_wa, PORT_IDLE_THREAD_STACK_SIZE); * that this thread is executed only if there are no other ready
* threads in the system.
*
- * @param[in] p the thread parameter, unused in this scenario
+ * @param[in] p the thread parameter, unused in this scenario
*/
static void _idle_thread(void *p) {
@@ -89,16 +82,13 @@ static void _idle_thread(void *p) { * @brief ChibiOS/RT initialization.
* @details After executing this function the current instructions stream
* becomes the main thread.
- * @pre Interrupts must be still disabled when @p chSysInit() is invoked
- * and are internally enabled.
- * @post The main thread is created with priority @p NORMALPRIO.
- * @note This function has special, architecture-dependent, requirements,
- * see the notes into the various port reference manuals.
+ * @pre Interrupts must disabled before invoking this function.
+ * @post The main thread is created with priority @p NORMALPRIO and
+ * interrupts are enabled.
*
* @special
*/
void chSysInit(void) {
- static thread_t mainthread;
#if CH_DBG_ENABLE_STACK_CHECK
extern stkalign_t __main_thread_stack_base__;
#endif
@@ -124,10 +114,10 @@ void chSysInit(void) { #if !CH_CFG_NO_IDLE_THREAD
/* Now this instructions flow becomes the main thread.*/
- setcurrp(_thread_init(&mainthread, NORMALPRIO));
+ setcurrp(_thread_init(&ch.mainthread, NORMALPRIO));
#else
- /* Now this instructions flow becomes the main thread.*/
- setcurrp(_thread_init(&mainthread, IDLEPRIO));
+ /* Now this instructions flow becomes the idle thread.*/
+ setcurrp(_thread_init(&ch.mainthread, IDLEPRIO));
#endif
currp->p_state = CH_STATE_CURRENT;
@@ -146,7 +136,7 @@ void chSysInit(void) { /* This thread has the lowest priority in the system, its role is just to
serve interrupts in its context while keeping the lowest energy saving
mode compatible with the system status.*/
- chThdCreateStatic(_idle_thread_wa, sizeof(_idle_thread_wa), IDLEPRIO,
+ chThdCreateStatic(ch.idle_thread_wa, sizeof(ch.idle_thread_wa), IDLEPRIO,
(tfunc_t)_idle_thread, NULL);
#endif
}
|