source: rtems/cpukit/score/src/threadcreateidle.c @ 8a323b09

Last change on this file since 8a323b09 was 8a323b09, checked in by Joel Sherrill <joel.sherrill@…>, on 09/08/03 at 21:07:18

2003-09-08 Derick Hammond <derick@…>

PR 484/rtems

  • src/threadcreateidle.c: Idle task name was initialized incorrectly.
  • Property mode set to 100644
File size: 2.2 KB
RevLine 
[05df0a8]1/*
2 *  Thread Handler
3 *
4 *
[08311cc3]5 *  COPYRIGHT (c) 1989-1999.
[05df0a8]6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in found in the file LICENSE in this distribution or at
[a6eef8b]10 *  http://www.rtems.com/license/LICENSE.
[05df0a8]11 *
12 *  $Id$
13 */
14
15#include <rtems/system.h>
16#include <rtems/score/apiext.h>
17#include <rtems/score/context.h>
18#include <rtems/score/interr.h>
19#include <rtems/score/isr.h>
20#include <rtems/score/object.h>
21#include <rtems/score/priority.h>
22#include <rtems/score/states.h>
23#include <rtems/score/sysstate.h>
24#include <rtems/score/thread.h>
25#include <rtems/score/threadq.h>
26#include <rtems/score/userext.h>
27#include <rtems/score/wkspace.h>
28
29/*PAGE
30 *
31 *  _Thread_Create_idle
32 */
33
[8a323b09]34/* 'I','D','L','E' */
35const Objects_Name _Thread_Idle_name = (Objects_Name) 0x49444C45;
[05df0a8]36
37void _Thread_Create_idle( void )
38{
39  void       *idle;
40  unsigned32  idle_task_stack_size;
41
42  /*
43   *  The entire workspace is zeroed during its initialization.  Thus, all
44   *  fields not explicitly assigned were explicitly zeroed by
45   *  _Workspace_Initialization.
46   */
47 
48  _Thread_Idle = _Thread_Internal_allocate();
49 
50  /*
51   *  Initialize the IDLE task.
52   */
53 
54#if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
55  idle = (void *) _CPU_Thread_Idle_body;
56#else
57  idle = (void *) _Thread_Idle_body;
58#endif
59 
60  if ( _CPU_Table.idle_task )
61    idle = _CPU_Table.idle_task;
62 
63  idle_task_stack_size =  _CPU_Table.idle_task_stack_size;
64  if ( idle_task_stack_size < STACK_MINIMUM_SIZE )
65    idle_task_stack_size = STACK_MINIMUM_SIZE;
66 
67  _Thread_Initialize(
68    &_Thread_Internal_information,
69    _Thread_Idle,
70    NULL,        /* allocate the stack */
71    idle_task_stack_size,
72    CPU_IDLE_TASK_IS_FP,
73    PRIORITY_MAXIMUM,
74    TRUE,        /* preemptable */
75    THREAD_CPU_BUDGET_ALGORITHM_NONE,
76    NULL,        /* no budget algorithm callout */
77    0,           /* all interrupts enabled */
78    _Thread_Idle_name
79  );
80 
81  /*
82   *  WARNING!!! This is necessary to "kick" start the system and
83   *             MUST be done before _Thread_Start is invoked.
84   */
85 
86  _Thread_Heir      =
87  _Thread_Executing = _Thread_Idle;
88 
89  _Thread_Start(
90    _Thread_Idle,
91    THREAD_START_NUMERIC,
92    idle,
93    NULL,
94    0
95  );
96 
97}
Note: See TracBrowser for help on using the repository browser.