forked from Imagelibrary/rtems
2008-07-23 Joel Sherrill <joel.sherrill@oarcorp.com>
* sapi/include/confdefs.h, score/src/threadcreateidle.c: Idle thread body is now completely configured via the Configuration table.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2008-07-23 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
|
* sapi/include/confdefs.h, score/src/threadcreateidle.c: Idle thread
|
||||||
|
body is now completely configured via the Configuration table.
|
||||||
|
|
||||||
2008-07-18 Joel Sherrill <joel.sherrill@oarcorp.com>
|
2008-07-18 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
PR 1291/cpukit
|
PR 1291/cpukit
|
||||||
|
|||||||
@@ -235,10 +235,12 @@ extern rtems_configuration_table Configuration;
|
|||||||
* the application may override and provide its own.
|
* the application may override and provide its own.
|
||||||
*/
|
*/
|
||||||
#ifndef CONFIGURE_IDLE_TASK_BODY
|
#ifndef CONFIGURE_IDLE_TASK_BODY
|
||||||
#ifdef BSP_IDLE_TASK_BODY
|
#if defined(BSP_IDLE_TASK_BODY)
|
||||||
#define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY
|
#define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY
|
||||||
|
#elif (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
|
||||||
|
#define CONFIGURE_IDLE_TASK_BODY _CPU_Thread_Idle_body
|
||||||
#else
|
#else
|
||||||
#define CONFIGURE_IDLE_TASK_BODY NULL
|
#define CONFIGURE_IDLE_TASK_BODY _Thread_Idle_body
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -36,37 +36,19 @@
|
|||||||
* _Thread_Create_idle
|
* _Thread_Create_idle
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const char *_Thread_Idle_name = "IDLE";
|
|
||||||
|
|
||||||
void _Thread_Create_idle( void )
|
void _Thread_Create_idle( void )
|
||||||
{
|
{
|
||||||
void *idle;
|
Objects_Name name;
|
||||||
uint32_t idle_task_stack_size;
|
|
||||||
|
name.name_p = "IDLE";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The entire workspace is zeroed during its initialization. Thus, all
|
* The entire workspace is zeroed during its initialization. Thus, all
|
||||||
* fields not explicitly assigned were explicitly zeroed by
|
* fields not explicitly assigned were explicitly zeroed by
|
||||||
* _Workspace_Initialization.
|
* _Workspace_Initialization.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
_Thread_Idle = _Thread_Internal_allocate();
|
_Thread_Idle = _Thread_Internal_allocate();
|
||||||
|
|
||||||
/*
|
|
||||||
* Initialize the IDLE task.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
|
|
||||||
idle = (void *) _CPU_Thread_Idle_body;
|
|
||||||
#else
|
|
||||||
idle = (void *) _Thread_Idle_body;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ( _Configuration_Table->idle_task )
|
|
||||||
idle = _Configuration_Table->idle_task;
|
|
||||||
|
|
||||||
idle_task_stack_size =
|
|
||||||
_Stack_Ensure_minimum( _Configuration_Table->idle_task_stack_size );
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is only called during initialization and we better be sure
|
* This is only called during initialization and we better be sure
|
||||||
* that when _Thread_Initialize unnests dispatch that we do not
|
* that when _Thread_Initialize unnests dispatch that we do not
|
||||||
@@ -78,14 +60,14 @@ void _Thread_Create_idle( void )
|
|||||||
&_Thread_Internal_information,
|
&_Thread_Internal_information,
|
||||||
_Thread_Idle,
|
_Thread_Idle,
|
||||||
NULL, /* allocate the stack */
|
NULL, /* allocate the stack */
|
||||||
idle_task_stack_size,
|
_Stack_Ensure_minimum( _Configuration_Table->idle_task_stack_size ),
|
||||||
CPU_IDLE_TASK_IS_FP,
|
CPU_IDLE_TASK_IS_FP,
|
||||||
PRIORITY_MAXIMUM,
|
PRIORITY_MAXIMUM,
|
||||||
TRUE, /* preemptable */
|
TRUE, /* preemptable */
|
||||||
THREAD_CPU_BUDGET_ALGORITHM_NONE,
|
THREAD_CPU_BUDGET_ALGORITHM_NONE,
|
||||||
NULL, /* no budget algorithm callout */
|
NULL, /* no budget algorithm callout */
|
||||||
0, /* all interrupts enabled */
|
0, /* all interrupts enabled */
|
||||||
(Objects_Name) _Thread_Idle_name
|
name
|
||||||
);
|
);
|
||||||
|
|
||||||
_Thread_Unnest_dispatch();
|
_Thread_Unnest_dispatch();
|
||||||
@@ -94,14 +76,13 @@ void _Thread_Create_idle( void )
|
|||||||
* WARNING!!! This is necessary to "kick" start the system and
|
* WARNING!!! This is necessary to "kick" start the system and
|
||||||
* MUST be done before _Thread_Start is invoked.
|
* MUST be done before _Thread_Start is invoked.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
_Thread_Heir =
|
_Thread_Heir =
|
||||||
_Thread_Executing = _Thread_Idle;
|
_Thread_Executing = _Thread_Idle;
|
||||||
|
|
||||||
_Thread_Start(
|
_Thread_Start(
|
||||||
_Thread_Idle,
|
_Thread_Idle,
|
||||||
THREAD_START_NUMERIC,
|
THREAD_START_NUMERIC,
|
||||||
idle,
|
_Configuration_Table->idle_task,
|
||||||
NULL,
|
NULL,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user