diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-10-31 13:08:33 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-11-10 09:22:09 +0100 |
commit | 05ca53ddf6bc8333c2f3ad861c5415467c3262d2 (patch) | |
tree | 9b011af47a8304527c77ba8992418e473f540ecf /cpukit/score/src/schedulerstrongapa.c | |
parent | score: Add and use Thread_Control::is_idle (diff) | |
download | rtems-05ca53ddf6bc8333c2f3ad861c5415467c3262d2.tar.bz2 |
rtems: Add scheduler processor add/remove
Update #2797.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/schedulerstrongapa.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/cpukit/score/src/schedulerstrongapa.c b/cpukit/score/src/schedulerstrongapa.c index eaa352e793..07d27e97b2 100644 --- a/cpukit/score/src/schedulerstrongapa.c +++ b/cpukit/score/src/schedulerstrongapa.c @@ -200,6 +200,14 @@ void _Scheduler_strong_APA_Node_initialize( ); } +static bool _Scheduler_strong_APA_Has_ready( Scheduler_Context *context ) +{ + Scheduler_strong_APA_Context *self = + _Scheduler_strong_APA_Get_self( context ); + + return !_Priority_bit_map_Is_empty( &self->Bit_map ); +} + static Scheduler_Node *_Scheduler_strong_APA_Get_highest_ready( Scheduler_Context *context, Scheduler_Node *node @@ -438,6 +446,36 @@ void _Scheduler_strong_APA_Withdraw_node( ); } +void _Scheduler_strong_APA_Add_processor( + const Scheduler_Control *scheduler, + Thread_Control *idle +) +{ + Scheduler_Context *context = _Scheduler_Get_context( scheduler ); + + _Scheduler_SMP_Add_processor( + context, + idle, + _Scheduler_strong_APA_Has_ready, + _Scheduler_strong_APA_Enqueue_scheduled_fifo + ); +} + +Thread_Control *_Scheduler_strong_APA_Remove_processor( + const Scheduler_Control *scheduler, + Per_CPU_Control *cpu +) +{ + Scheduler_Context *context = _Scheduler_Get_context( scheduler ); + + return _Scheduler_SMP_Remove_processor( + context, + cpu, + _Scheduler_strong_APA_Extract_from_ready, + _Scheduler_strong_APA_Enqueue_fifo + ); +} + bool _Scheduler_strong_APA_Yield( const Scheduler_Control *scheduler, Thread_Control *the_thread, |