diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-01 11:48:59 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-04-03 11:13:26 +0200 |
commit | 494c2e300215c4bc539d243d6a5d060e0e2f2ef2 (patch) | |
tree | 8ba7c54667cad8331430bf719b4a1bd94ed3ac8b /cpukit/score/include/rtems/score/schedulersmpimpl.h | |
parent | score: Rename Priority_bit_map_Control (diff) | |
download | rtems-494c2e300215c4bc539d243d6a5d060e0e2f2ef2.tar.bz2 |
score: Move priority bit map to scheduler instance
Delete global variables _Priority_Major_bit_map and _Priority_Bit_map.
This makes it possible to use multiple priority scheduler instances for
example with clustered/partitioned scheduling on SMP.
Diffstat (limited to 'cpukit/score/include/rtems/score/schedulersmpimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/schedulersmpimpl.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/cpukit/score/include/rtems/score/schedulersmpimpl.h b/cpukit/score/include/rtems/score/schedulersmpimpl.h index d977b3f319..df2a85b6f6 100644 --- a/cpukit/score/include/rtems/score/schedulersmpimpl.h +++ b/cpukit/score/include/rtems/score/schedulersmpimpl.h @@ -7,7 +7,7 @@ */ /* - * Copyright (c) 2013 embedded brains GmbH. All rights reserved. + * Copyright (c) 2013-2014 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Dornierstr. 4 @@ -57,9 +57,11 @@ typedef void ( *Scheduler_SMP_Move )( Thread_Control *thread_to_move ); -static inline Scheduler_SMP_Control *_Scheduler_SMP_Instance( void ) +static inline void _Scheduler_SMP_Initialize( + Scheduler_SMP_Control *self +) { - return _Scheduler.information; + _Chain_Initialize_empty( &self->Scheduled ); } static inline void _Scheduler_SMP_Allocate_processor( @@ -109,7 +111,7 @@ static inline Thread_Control *_Scheduler_SMP_Get_lowest_scheduled( ) { Thread_Control *lowest_ready = NULL; - Chain_Control *scheduled = &self->scheduled; + Chain_Control *scheduled = &self->Scheduled; if ( !_Chain_Is_empty( scheduled ) ) { lowest_ready = (Thread_Control *) _Chain_Last( scheduled ); @@ -244,7 +246,7 @@ static inline void _Scheduler_SMP_Insert_scheduled_lifo( ) { _Chain_Insert_ordered_unprotected( - &self->scheduled, + &self->Scheduled, &thread->Object.Node, _Scheduler_simple_Insert_priority_lifo_order ); @@ -256,12 +258,23 @@ static inline void _Scheduler_SMP_Insert_scheduled_fifo( ) { _Chain_Insert_ordered_unprotected( - &self->scheduled, + &self->Scheduled, &thread->Object.Node, _Scheduler_simple_Insert_priority_fifo_order ); } +static inline void _Scheduler_SMP_Start_idle( + Scheduler_SMP_Control *self, + Thread_Control *thread, + Per_CPU_Control *cpu +) +{ + thread->is_scheduled = true; + _Thread_Set_CPU( thread, cpu ); + _Chain_Append_unprotected( &self->Scheduled, &thread->Object.Node ); +} + /** @} */ #ifdef __cplusplus |