From 1ccb64e18f1e4c1f51c12b9dc31a881e2829b2b6 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 6 Jun 2013 15:28:41 +0200 Subject: scheduler: Add start idle thread operation Add and use _Scheduler_Start_idle(). --- cpukit/score/include/rtems/score/scheduler.h | 17 +++++++++++++++++ cpukit/score/include/rtems/score/schedulercbs.h | 3 ++- cpukit/score/include/rtems/score/scheduleredf.h | 3 ++- cpukit/score/include/rtems/score/schedulerpriority.h | 3 ++- cpukit/score/include/rtems/score/schedulersimple.h | 3 ++- cpukit/score/include/rtems/score/thread.h | 6 +++++- 6 files changed, 30 insertions(+), 5 deletions(-) (limited to 'cpukit/score/include') diff --git a/cpukit/score/include/rtems/score/scheduler.h b/cpukit/score/include/rtems/score/scheduler.h index 5c35a36de1..9e08b23e4f 100644 --- a/cpukit/score/include/rtems/score/scheduler.h +++ b/cpukit/score/include/rtems/score/scheduler.h @@ -89,6 +89,12 @@ typedef struct { /** perform scheduler update actions required at each clock tick */ void ( *tick )(void); + /** + * @brief Starts the idle thread for a particular processor. + * + * @see _Scheduler_Start_idle(). + */ + void ( *start_idle )( Thread_Control *thread, Per_CPU_Control *processor ); } Scheduler_Operations; /** @@ -139,6 +145,17 @@ extern Scheduler_Control _Scheduler; */ void _Scheduler_Handler_initialization( void ); +/** + * @brief Unblocks the thread. + * + * @param[in/out] thread An idle thread. + * @param[in] processor This parameter is unused. + */ +void _Scheduler_default_Start_idle( + Thread_Control *thread, + Per_CPU_Control *processor +); + #ifndef __RTEMS_APPLICATION__ #include #endif diff --git a/cpukit/score/include/rtems/score/schedulercbs.h b/cpukit/score/include/rtems/score/schedulercbs.h index 53452e044a..41f8ab0b57 100644 --- a/cpukit/score/include/rtems/score/schedulercbs.h +++ b/cpukit/score/include/rtems/score/schedulercbs.h @@ -60,7 +60,8 @@ extern "C" { _Scheduler_EDF_Extract, /* extract entry point */ \ _Scheduler_EDF_Priority_compare, /* compares two priorities */ \ _Scheduler_CBS_Release_job, /* new period of task */ \ - _Scheduler_priority_Tick /* tick entry point */ \ + _Scheduler_priority_Tick, /* tick entry point */ \ + _Scheduler_default_Start_idle /* start idle entry point */ \ } /* Return values for CBS server. */ diff --git a/cpukit/score/include/rtems/score/scheduleredf.h b/cpukit/score/include/rtems/score/scheduleredf.h index 24f9a1ac32..e84b3f5909 100644 --- a/cpukit/score/include/rtems/score/scheduleredf.h +++ b/cpukit/score/include/rtems/score/scheduleredf.h @@ -53,7 +53,8 @@ extern "C" { _Scheduler_EDF_Extract, /* extract entry point */ \ _Scheduler_EDF_Priority_compare, /* compares two priorities */ \ _Scheduler_EDF_Release_job, /* new period of task */ \ - _Scheduler_priority_Tick /* tick entry point */ \ + _Scheduler_priority_Tick, /* tick entry point */ \ + _Scheduler_default_Start_idle /* start idle entry point */ \ } /** diff --git a/cpukit/score/include/rtems/score/schedulerpriority.h b/cpukit/score/include/rtems/score/schedulerpriority.h index f97bb7f075..81c3582e76 100644 --- a/cpukit/score/include/rtems/score/schedulerpriority.h +++ b/cpukit/score/include/rtems/score/schedulerpriority.h @@ -52,7 +52,8 @@ extern "C" { _Scheduler_priority_Extract, /* extract entry point */ \ _Scheduler_priority_Priority_compare, /* compares two priorities */ \ _Scheduler_priority_Release_job, /* new period of task */ \ - _Scheduler_priority_Tick /* tick entry point */ \ + _Scheduler_priority_Tick, /* tick entry point */ \ + _Scheduler_default_Start_idle /* start idle entry point */ \ } /** diff --git a/cpukit/score/include/rtems/score/schedulersimple.h b/cpukit/score/include/rtems/score/schedulersimple.h index df52a586be..6682074b7c 100644 --- a/cpukit/score/include/rtems/score/schedulersimple.h +++ b/cpukit/score/include/rtems/score/schedulersimple.h @@ -50,7 +50,8 @@ extern "C" { _Scheduler_simple_Extract, /* extract entry point */ \ _Scheduler_priority_Priority_compare, /* compares two priorities */ \ _Scheduler_priority_Release_job, /* new period of task */ \ - _Scheduler_priority_Tick /* tick entry point */ \ + _Scheduler_priority_Tick, /* tick entry point */ \ + _Scheduler_default_Start_idle /* start idle entry point */ \ } /** diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 3cddb5a3e9..60583a77c0 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -571,13 +571,17 @@ bool _Thread_Initialize( * @param entry_point * @param pointer_argument * @param numeric_argument + * @param[in/out] processor The processor if used to start an idle thread + * during system initialization. Must be set to @c NULL to start a normal + * thread. */ bool _Thread_Start( Thread_Control *the_thread, Thread_Start_types the_prototype, void *entry_point, void *pointer_argument, - Thread_Entry_numeric_type numeric_argument + Thread_Entry_numeric_type numeric_argument, + Per_CPU_Control *processor ); /** -- cgit v1.2.3