Changeset 1506658c in rtems


Ignore:
Timestamp:
Jan 8, 2016, 11:11:03 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
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()

Location:
cpukit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/pthreadcreate.c

    rccd5434 r1506658c  
    229229   *  POSIX threads are allocated and started in one operation.
    230230   */
    231   status = _Thread_Start( the_thread, &entry, NULL );
     231  status = _Thread_Start( the_thread, &entry );
    232232
    233233  #if defined(RTEMS_DEBUG)
  • cpukit/rtems/src/taskstart.c

    rccd5434 r1506658c  
    6565
    6666    case OBJECTS_LOCAL:
    67       successfully_started = _Thread_Start( the_thread, &entry, NULL );
     67      successfully_started = _Thread_Start( the_thread, &entry );
    6868
    6969      _Objects_Put( &the_thread->Object );
  • cpukit/score/include/rtems/score/threadimpl.h

    rccd5434 r1506658c  
    188188 *  @param the_thread The thread to be started.
    189189 *  @param entry The thread entry information.
    190  *  @param[in,out] cpu The processor if used to start an idle thread
    191  *  during system initialization.  Must be set to @c NULL to start a normal
    192  *  thread.
    193190 */
    194191bool _Thread_Start(
    195192  Thread_Control                 *the_thread,
    196   const Thread_Entry_information *entry,
    197   Per_CPU_Control                *cpu
     193  const Thread_Entry_information *entry
    198194);
    199195
  • 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
  • cpukit/score/src/threadstart.c

    rccd5434 r1506658c  
    2222#include <rtems/score/threadimpl.h>
    2323#include <rtems/score/isrlevel.h>
    24 #include <rtems/score/schedulerimpl.h>
    2524#include <rtems/score/userextimpl.h>
    2625
    2726bool _Thread_Start(
    2827  Thread_Control                 *the_thread,
    29   const Thread_Entry_information *entry,
    30   Per_CPU_Control                *cpu
     28  const Thread_Entry_information *entry
    3129)
    3230{
     
    3432    the_thread->Start.Entry = *entry;
    3533    _Thread_Load_environment( the_thread );
    36 
    37     if ( cpu == NULL ) {
    38       _Thread_Ready( the_thread );
    39     } else {
    40       const Scheduler_Control *scheduler = _Scheduler_Get_by_CPU( cpu );
    41 
    42       if ( scheduler != NULL ) {
    43         the_thread->current_state = STATES_READY;
    44         _Scheduler_Start_idle( scheduler, the_thread, cpu );
    45       }
    46     }
    47 
     34    _Thread_Ready( the_thread );
    4835    _User_extensions_Thread_start( the_thread );
    4936
Note: See TracChangeset for help on using the changeset viewer.