From 494c2e300215c4bc539d243d6a5d060e0e2f2ef2 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 1 Apr 2014 11:48:59 +0200 Subject: 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. --- testsuites/tmtests/tm26/task1.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'testsuites/tmtests/tm26/task1.c') diff --git a/testsuites/tmtests/tm26/task1.c b/testsuites/tmtests/tm26/task1.c index f6cdddfa8b..925c2f501b 100644 --- a/testsuites/tmtests/tm26/task1.c +++ b/testsuites/tmtests/tm26/task1.c @@ -19,6 +19,7 @@ #include #include +#include #include #if defined( RTEMS_SMP ) && defined( RTEMS_DEBUG ) @@ -370,7 +371,7 @@ rtems_task Middle_task( rtems_task_argument argument ) { - Chain_Control *ready_queues; + Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance(); thread_dispatch_no_fp_time = benchmark_timer_read(); @@ -378,9 +379,8 @@ rtems_task Middle_task( Middle_tcb = _Thread_Get_executing(); - ready_queues = (Chain_Control *) _Scheduler.information; set_thread_executing( - (Thread_Control *) _Chain_First(&ready_queues[LOW_PRIORITY]) + (Thread_Control *) _Chain_First(&scheduler->Ready[LOW_PRIORITY]) ); /* do not force context switch */ @@ -403,10 +403,8 @@ rtems_task Low_task( rtems_task_argument argument ) { - Thread_Control *executing; - Chain_Control *ready_queues; - - ready_queues = (Chain_Control *) _Scheduler.information; + Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance(); + Thread_Control *executing; context_switch_no_fp_time = benchmark_timer_read(); @@ -424,7 +422,7 @@ rtems_task Low_task( context_switch_another_task_time = benchmark_timer_read(); set_thread_executing( - (Thread_Control *) _Chain_First(&ready_queues[FP1_PRIORITY]) + (Thread_Control *) _Chain_First(&scheduler->Ready[FP1_PRIORITY]) ); /* do not force context switch */ @@ -447,17 +445,16 @@ rtems_task Floating_point_task_1( rtems_task_argument argument ) { - Chain_Control *ready_queues; - Thread_Control *executing; + Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance(); + Thread_Control *executing; FP_DECLARE; context_switch_restore_1st_fp_time = benchmark_timer_read(); executing = _Thread_Get_executing(); - ready_queues = (Chain_Control *) _Scheduler.information; set_thread_executing( - (Thread_Control *) _Chain_First(&ready_queues[FP2_PRIORITY]) + (Thread_Control *) _Chain_First(&scheduler->Ready[FP2_PRIORITY]) ); /* do not force context switch */ @@ -483,9 +480,8 @@ rtems_task Floating_point_task_1( executing = _Thread_Get_executing(); - ready_queues = (Chain_Control *) _Scheduler.information; set_thread_executing( - (Thread_Control *) _Chain_First(&ready_queues[FP2_PRIORITY]) + (Thread_Control *) _Chain_First(&scheduler->Ready[FP2_PRIORITY]) ); benchmark_timer_initialize(); @@ -504,17 +500,16 @@ rtems_task Floating_point_task_2( rtems_task_argument argument ) { - Chain_Control *ready_queues; - Thread_Control *executing; + Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance(); + Thread_Control *executing; FP_DECLARE; context_switch_save_restore_idle_time = benchmark_timer_read(); executing = _Thread_Get_executing(); - ready_queues = (Chain_Control *) _Scheduler.information; set_thread_executing( - (Thread_Control *) _Chain_First(&ready_queues[FP1_PRIORITY]) + (Thread_Control *) _Chain_First(&scheduler->Ready[FP1_PRIORITY]) ); FP_LOAD( 1.0 ); -- cgit v1.2.3