Changeset 1ccb64e1 in rtems


Ignore:
Timestamp:
Jun 6, 2013, 1:28:41 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
6eba7c85
Parents:
477259c
git-author:
Sebastian Huber <sebastian.huber@…> (06/06/13 13:28:41)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/14/13 14:26:07)
Message:

scheduler: Add start idle thread operation

Add and use _Scheduler_Start_idle().

Location:
cpukit
Files:
1 added
12 edited

Legend:

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

    r477259c r1ccb64e1  
    204204    start_routine,
    205205    arg,
    206     0                     /* unused */
     206    0,                    /* unused */
     207    NULL
    207208  );
    208209
  • cpukit/rtems/src/taskstart.c

    r477259c r1ccb64e1  
    5959  register Thread_Control *the_thread;
    6060  Objects_Locations        location;
     61  bool                     successfully_started;
    6162
    6263  if ( entry_point == NULL )
     
    6768
    6869    case OBJECTS_LOCAL:
    69       if ( _Thread_Start(
    70              the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) {
    71         _Objects_Put( &the_thread->Object );
     70      successfully_started = _Thread_Start(
     71        the_thread,
     72        THREAD_START_NUMERIC,
     73        entry_point,
     74        NULL,
     75        argument,
     76        NULL
     77      );
     78
     79      _Objects_Put( &the_thread->Object );
     80
     81      if ( successfully_started ) {
    7282        return RTEMS_SUCCESSFUL;
     83      } else {
     84        return RTEMS_INCORRECT_STATE;
    7385      }
    74       _Objects_Put( &the_thread->Object );
    75       return RTEMS_INCORRECT_STATE;
    7686
    7787#if defined(RTEMS_MULTIPROCESSING)
  • cpukit/score/Makefile.am

    r477259c r1ccb64e1  
    198198## SCHEDULER_C_FILES
    199199libscore_a_SOURCES += src/scheduler.c
     200libscore_a_SOURCES += src/schedulerdefaultstartidle.c
    200201
    201202## SCHEDULERPRIORITY_C_FILES
  • cpukit/score/include/rtems/score/scheduler.h

    r477259c r1ccb64e1  
    9090  void ( *tick )(void);
    9191
     92  /**
     93   * @brief Starts the idle thread for a particular processor.
     94   *
     95   * @see _Scheduler_Start_idle().
     96   */
     97  void ( *start_idle )( Thread_Control *thread, Per_CPU_Control *processor );
    9298} Scheduler_Operations;
    9399
     
    140146void _Scheduler_Handler_initialization( void );
    141147
     148/**
     149 * @brief Unblocks the thread.
     150 *
     151 * @param[in/out] thread An idle thread.
     152 * @param[in] processor This parameter is unused.
     153 */
     154void _Scheduler_default_Start_idle(
     155  Thread_Control  *thread,
     156  Per_CPU_Control *processor
     157);
     158
    142159#ifndef __RTEMS_APPLICATION__
    143160#include <rtems/score/scheduler.inl>
  • cpukit/score/include/rtems/score/schedulercbs.h

    r477259c r1ccb64e1  
    6161    _Scheduler_EDF_Priority_compare, /* compares two priorities */ \
    6262    _Scheduler_CBS_Release_job,      /* new period of task */ \
    63     _Scheduler_priority_Tick         /* tick entry point */ \
     63    _Scheduler_priority_Tick,        /* tick entry point */ \
     64    _Scheduler_default_Start_idle    /* start idle entry point */ \
    6465  }
    6566
  • cpukit/score/include/rtems/score/scheduleredf.h

    r477259c r1ccb64e1  
    5454    _Scheduler_EDF_Priority_compare, /* compares two priorities */ \
    5555    _Scheduler_EDF_Release_job,      /* new period of task */ \
    56     _Scheduler_priority_Tick         /* tick entry point */ \
     56    _Scheduler_priority_Tick,        /* tick entry point */ \
     57    _Scheduler_default_Start_idle    /* start idle entry point */ \
    5758  }
    5859
  • cpukit/score/include/rtems/score/schedulerpriority.h

    r477259c r1ccb64e1  
    5353    _Scheduler_priority_Priority_compare, /* compares two priorities */ \
    5454    _Scheduler_priority_Release_job,      /* new period of task */ \
    55     _Scheduler_priority_Tick              /* tick entry point */ \
     55    _Scheduler_priority_Tick,             /* tick entry point */ \
     56    _Scheduler_default_Start_idle         /* start idle entry point */ \
    5657  }
    5758
  • cpukit/score/include/rtems/score/schedulersimple.h

    r477259c r1ccb64e1  
    5151    _Scheduler_priority_Priority_compare, /* compares two priorities */ \
    5252    _Scheduler_priority_Release_job,      /* new period of task */ \
    53     _Scheduler_priority_Tick              /* tick entry point */ \
     53    _Scheduler_priority_Tick,             /* tick entry point */ \
     54    _Scheduler_default_Start_idle         /* start idle entry point */ \
    5455  }
    5556
  • cpukit/score/include/rtems/score/thread.h

    r477259c r1ccb64e1  
    572572 *  @param pointer_argument
    573573 *  @param numeric_argument
     574 *  @param[in/out] processor The processor if used to start an idle thread
     575 *  during system initialization.  Must be set to @c NULL to start a normal
     576 *  thread.
    574577 */
    575578bool _Thread_Start(
     
    578581  void                      *entry_point,
    579582  void                      *pointer_argument,
    580   Thread_Entry_numeric_type  numeric_argument
     583  Thread_Entry_numeric_type  numeric_argument,
     584  Per_CPU_Control           *processor
    581585);
    582586
  • cpukit/score/inline/rtems/score/scheduler.inl

    r477259c r1ccb64e1  
    209209}
    210210
     211/**
     212 * @brief Starts the idle thread for a particular processor.
     213 *
     214 * @param[in/out] thread The idle thread for the processor.
     215 * @parma[in/out] processor The processor for the idle thread.
     216 *
     217 * @see _Thread_Create_idle().
     218 */
     219RTEMS_INLINE_ROUTINE void _Scheduler_Start_idle(
     220  Thread_Control *thread,
     221  Per_CPU_Control *processor
     222)
     223{
     224  ( *_Scheduler.Operations.start_idle )( thread, processor );
     225}
     226
    211227/** @} */
    212228
  • cpukit/score/src/threadcreateidle.c

    r477259c r1ccb64e1  
    7474    rtems_configuration_get_idle_task(),
    7575    NULL,
    76     0
     76    0,
     77    per_cpu
    7778  );
    7879}
  • cpukit/score/src/threadstart.c

    r477259c r1ccb64e1  
    3939  void                      *entry_point,
    4040  void                      *pointer_argument,
    41   Thread_Entry_numeric_type  numeric_argument
     41  Thread_Entry_numeric_type  numeric_argument,
     42  Per_CPU_Control           *processor
    4243)
    4344{
     
    5253    _Thread_Load_environment( the_thread );
    5354
    54     _Thread_Ready( the_thread );
     55    if ( processor == NULL ) {
     56      _Thread_Ready( the_thread );
     57    } else {
     58      the_thread->current_state = STATES_READY;
     59      _Scheduler_Start_idle( the_thread, processor );
     60    }
    5561
    5662    _User_extensions_Thread_start( the_thread );
Note: See TracChangeset for help on using the changeset viewer.