summaryrefslogtreecommitdiffstats
path: root/testsuites/tmtests
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-04-01 11:48:59 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-04-03 11:13:26 +0200
commit494c2e300215c4bc539d243d6a5d060e0e2f2ef2 (patch)
tree8ba7c54667cad8331430bf719b4a1bd94ed3ac8b /testsuites/tmtests
parentscore: Rename Priority_bit_map_Control (diff)
downloadrtems-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 'testsuites/tmtests')
-rw-r--r--testsuites/tmtests/tm26/task1.c31
-rw-r--r--testsuites/tmtests/tm27/task1.c11
2 files changed, 18 insertions, 24 deletions
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 <tmacros.h>
#include <timesys.h>
+#include <rtems/score/schedulerpriorityimpl.h>
#include <rtems/rtems/semimpl.h>
#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 );
diff --git a/testsuites/tmtests/tm27/task1.c b/testsuites/tmtests/tm27/task1.c
index 0062a7302f..d7ebfbe224 100644
--- a/testsuites/tmtests/tm27/task1.c
+++ b/testsuites/tmtests/tm27/task1.c
@@ -20,6 +20,7 @@
#define CONFIGURE_INIT
#include "system.h"
+#include <rtems/score/schedulerpriorityimpl.h>
#include <bsp.h>
#define _RTEMS_TMTEST27
@@ -101,10 +102,10 @@ rtems_task Task_1(
rtems_task_argument argument
)
{
+ Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance();
#if defined(RTEMS_SMP)
rtems_interrupt_level level;
#endif
- Chain_Control *ready_queues;
Install_tm27_vector( Isr_handler );
@@ -185,9 +186,8 @@ rtems_task Task_1(
_ISR_Disable_without_giant(level);
#endif
- ready_queues = (Chain_Control *) _Scheduler.information;
_Thread_Executing =
- (Thread_Control *) _Chain_First(&ready_queues[LOW_PRIORITY]);
+ (Thread_Control *) _Chain_First(&scheduler->Ready[LOW_PRIORITY]);
_Thread_Dispatch_necessary = 1;
@@ -219,10 +219,10 @@ rtems_task Task_2(
rtems_task_argument argument
)
{
+ Scheduler_priority_Control *scheduler = _Scheduler_priority_Instance();
#if defined(RTEMS_SMP)
rtems_interrupt_level level;
#endif
- Chain_Control *ready_queues;
#if (MUST_WAIT_FOR_INTERRUPT == 1)
while ( Interrupt_occurred == 0 );
@@ -255,9 +255,8 @@ rtems_task Task_2(
rtems_interrupt_disable(level);
#endif
- ready_queues = (Chain_Control *) _Scheduler.information;
_Thread_Executing =
- (Thread_Control *) _Chain_First(&ready_queues[LOW_PRIORITY]);
+ (Thread_Control *) _Chain_First(&scheduler->Ready[LOW_PRIORITY]);
_Thread_Dispatch_necessary = 1;