From 9d83f58ab8208b49a4e27d4ff077cf526f902477 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 12 Aug 2013 10:32:32 +0200 Subject: smp: Replace Scheduler_simple_smp_Control Replace Scheduler_simple_smp_Control with Scheduler_SMP_Control. Rename _Scheduler_simple_smp_Instance() to _Scheduler_SMP_Instance(). --- cpukit/score/src/schedulersimplesmp.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'cpukit/score/src/schedulersimplesmp.c') diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c index e26151025c..090572302e 100644 --- a/cpukit/score/src/schedulersimplesmp.c +++ b/cpukit/score/src/schedulersimplesmp.c @@ -20,19 +20,15 @@ #include #include +#include #include -static Scheduler_simple_smp_Control *_Scheduler_simple_smp_Instance( void ) -{ - return _Scheduler.information; -} - void _Scheduler_simple_smp_Initialize( void ) { - Scheduler_simple_smp_Control *self = + Scheduler_SMP_Control *self = _Workspace_Allocate_or_fatal_error( sizeof( *self ) ); - _Chain_Initialize_empty( &self->ready ); + _Chain_Initialize_empty( &self->ready[ 0 ] ); _Chain_Initialize_empty( &self->scheduled ); _Scheduler.information = self; @@ -112,7 +108,7 @@ static void _Scheduler_simple_smp_Enqueue_ordered( Chain_Node_order order ) { - Scheduler_simple_smp_Control *self = _Scheduler_simple_smp_Instance(); + Scheduler_SMP_Control *self = _Scheduler_SMP_Instance(); /* * The scheduled chain has exactly processor count nodes after @@ -127,11 +123,11 @@ static void _Scheduler_simple_smp_Enqueue_ordered( _Scheduler_simple_smp_Insert( &self->scheduled, thread, order ); _Scheduler_simple_smp_Move_from_scheduled_to_ready( - &self->ready, + &self->ready[ 0 ], lowest_scheduled ); } else { - _Scheduler_simple_smp_Insert( &self->ready, thread, order ); + _Scheduler_simple_smp_Insert( &self->ready[ 0 ], thread, order ); } } @@ -153,13 +149,13 @@ void _Scheduler_simple_smp_Enqueue_priority_fifo( Thread_Control *thread ) void _Scheduler_simple_smp_Extract( Thread_Control *thread ) { - Scheduler_simple_smp_Control *self = _Scheduler_simple_smp_Instance(); + Scheduler_SMP_Control *self = _Scheduler_SMP_Instance(); _Chain_Extract_unprotected( &thread->Object.Node ); if ( thread->is_scheduled ) { Thread_Control *highest_ready = - (Thread_Control *) _Chain_First( &self->ready ); + (Thread_Control *) _Chain_First( &self->ready[ 0 ] ); _Scheduler_simple_smp_Allocate_processor( highest_ready, thread ); @@ -192,7 +188,7 @@ void _Scheduler_simple_smp_Start_idle( Per_CPU_Control *cpu ) { - Scheduler_simple_smp_Control *self = _Scheduler_simple_smp_Instance(); + Scheduler_SMP_Control *self = _Scheduler_SMP_Instance(); thread->is_scheduled = true; thread->cpu = cpu; -- cgit v1.2.3