Ignore:
Timestamp:
01/08/16 11:11:03 (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
599d71f
Parents:
ccd5434
git-author:
Sebastian Huber <sebastian.huber@…> (01/08/16 11:11:03)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/11/16 07:47:24)
Message:

score: Simplify _Thread_Start()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/threadcreateidle.c

    rccd5434 r1506658c  
    2222#include <rtems/score/schedulerimpl.h>
    2323#include <rtems/score/stackimpl.h>
     24#include <rtems/score/userextimpl.h>
    2425#include <rtems/config.h>
    2526
    2627static void _Thread_Create_idle_for_cpu( Per_CPU_Control *cpu )
    2728{
    28   Thread_Entry_information entry = {
    29     .adaptor = _Thread_Entry_adaptor_idle,
    30     .Kinds = {
    31       .Idle = {
    32         .entry = rtems_configuration_get_idle_task()
    33       }
    34     }
    35   };
    36   Objects_Name    name;
    37   Thread_Control *idle;
     29  Objects_Name             name;
     30  Thread_Control          *idle;
     31  const Scheduler_Control *scheduler;
    3832
    3933  name.name_u32 = _Objects_Build_name( 'I', 'D', 'L', 'E' );
     
    6862  cpu->executing = idle;
    6963
    70   _Thread_Start( idle, &entry, cpu );
     64  idle->Start.Entry.adaptor = _Thread_Entry_adaptor_idle;
     65  idle->Start.Entry.Kinds.Idle.entry = rtems_configuration_get_idle_task();
     66
     67  _Thread_Load_environment( idle );
     68
     69  scheduler = _Scheduler_Get_by_CPU( cpu );
     70
     71#if defined(RTEMS_SMP)
     72  if (scheduler == NULL) {
     73    return;
     74  }
     75#endif
     76
     77  idle->current_state = STATES_READY;
     78  _Scheduler_Start_idle( scheduler, idle, cpu );
     79  _User_extensions_Thread_start( idle );
    7180}
    7281
Note: See TracChangeset for help on using the changeset viewer.