diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-28 06:54:50 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-09-08 09:55:28 +0200 |
commit | b20b736382280fb522d176273645a7e955a97a60 (patch) | |
tree | beb78ee50ef8b6a9257ecf5f8d276af35db11c5a /testsuites | |
parent | score: Add scheduler node implementation header (diff) | |
download | rtems-b20b736382280fb522d176273645a7e955a97a60.tar.bz2 |
score: Introduce _Thread_Get_priority()
Avoid direct access to thread internal data fields.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/smptests/smpscheduler03/init.c | 2 | ||||
-rw-r--r-- | testsuites/sptests/sp34/changepri.c | 6 | ||||
-rw-r--r-- | testsuites/sptests/sp35/priinv.c | 18 |
3 files changed, 15 insertions, 11 deletions
diff --git a/testsuites/smptests/smpscheduler03/init.c b/testsuites/smptests/smpscheduler03/init.c index b7a76a994c..c114eb90be 100644 --- a/testsuites/smptests/smpscheduler03/init.c +++ b/testsuites/smptests/smpscheduler03/init.c @@ -46,7 +46,7 @@ static bool change_priority_filter( void *arg ) { - return thread->current_priority != *new_priority; + return _Thread_Get_priority( thread ) != *new_priority; } static void change_priority( diff --git a/testsuites/sptests/sp34/changepri.c b/testsuites/sptests/sp34/changepri.c index f32f6ec3c6..5000f693d3 100644 --- a/testsuites/sptests/sp34/changepri.c +++ b/testsuites/sptests/sp34/changepri.c @@ -29,6 +29,8 @@ #include <stdio.h> #include "tmacros.h" +#include <rtems/score/threadimpl.h> + const char rtems_test_name[] = "SP 34"; rtems_task BlockingTasks(rtems_task_argument arg); @@ -44,7 +46,7 @@ const char *CallerName(void) Thread_Control *executing = _Thread_Get_executing(); #if defined(TEST_PRINT_TASK_ID) sprintf( buffer, "0x%08x -- %d", - rtems_task_self(), executing->current_priority ); + rtems_task_self(), _Thread_Get_priority( executing ) ); #else volatile union { uint32_t u; @@ -58,7 +60,7 @@ const char *CallerName(void) #endif sprintf( buffer, "%c%c%c%c -- %" PRIdPriority_Control, TempName.c[0], TempName.c[1], TempName.c[2], TempName.c[3], - executing->current_priority + _Thread_Get_priority( executing ) ); #endif return buffer; diff --git a/testsuites/sptests/sp35/priinv.c b/testsuites/sptests/sp35/priinv.c index c7eb336e0d..b191bf3c86 100644 --- a/testsuites/sptests/sp35/priinv.c +++ b/testsuites/sptests/sp35/priinv.c @@ -58,6 +58,8 @@ #include <stdio.h> #include "tmacros.h" +#include <rtems/score/threadimpl.h> + const char rtems_test_name[] = "SP 35"; #if defined(TEST_EXIT_AFTER_ITERATIONS) @@ -86,7 +88,7 @@ const char *CallerName(void) Thread_Control *executing = _Thread_Get_executing(); #if defined(TEST_PRINT_TASK_ID) sprintf( buffer, "0x%08x -- %d", - rtems_task_self(), executing->current_priority ); + rtems_task_self(), _Thread_Get_priority( executing ) ); #else volatile union { uint32_t u; @@ -100,7 +102,7 @@ const char *CallerName(void) #endif sprintf( buffer, "%c%c%c%c -- %" PRIdPriority_Control, TempName.c[0], TempName.c[1], TempName.c[2], TempName.c[3], - executing->current_priority + _Thread_Get_priority( executing ) ); #endif return buffer; @@ -255,7 +257,7 @@ void AccessLocalHw(void) #if defined(TEST_PRINT_STATISTICS) /* Store information about the current situation */ - EnterPrio = _Thread_Executing->current_priority; + EnterPrio = _Thread_Get_priority( _Thread_Executing ); EnterCnt = _Thread_Executing->resource_count; #endif @@ -275,7 +277,7 @@ void AccessLocalHw(void) #if defined(TEST_PRINT_STATISTICS) /* Store information about the current situation */ - AccessPrio = _Thread_Executing->current_priority; + AccessPrio = _Thread_Get_priority( _Thread_Executing ); AccessCnt = _Thread_Executing->resource_count; #endif @@ -284,7 +286,7 @@ void AccessLocalHw(void) #if defined(TEST_PRINT_STATISTICS) /* Store information about the current situation */ - LeavePrio = _Thread_Executing->current_priority; + LeavePrio = _Thread_Get_priority( _Thread_Executing ); LeaveCnt = _Thread_Executing->resource_count; printf( @@ -321,7 +323,7 @@ void AccessRemoteHw(void) #if defined(TEST_PRINT_STATISTICS) /* Store information about the current situation */ - EnterPrio = _Thread_Executing->current_priority; + EnterPrio = _Thread_Get_priority( _Thread_Executing ); EnterCnt = _Thread_Executing->resource_count; #endif @@ -340,7 +342,7 @@ void AccessRemoteHw(void) #if defined(TEST_PRINT_STATISTICS) /* Store information about the current situation */ - AccessPrio = _Thread_Executing->current_priority; + AccessPrio = _Thread_Get_priority( _Thread_Executing ); AccessCnt = _Thread_Executing->resource_count; #endif @@ -349,7 +351,7 @@ void AccessRemoteHw(void) #if defined(TEST_PRINT_STATISTICS) /* Store information about the current situation */ - LeavePrio = _Thread_Executing->current_priority; + LeavePrio = _Thread_Get_priority( _Thread_Executing ); LeaveCnt = _Thread_Executing->resource_count; printf( |