summaryrefslogtreecommitdiffstats
path: root/cpukit/posix
diff options
context:
space:
mode:
authorGedare Bloom <gedare@rtems.org>2017-12-21 11:49:30 -0500
committerGedare Bloom <gedare@rtems.org>2018-03-23 11:33:59 -0400
commit78b867e26dac3266763f275c1f438da912f33a6e (patch)
tree6a6bcac4a0a7f3fa6fd9ab7a9c499ca00ff69f2c /cpukit/posix
parentsptests: Add spmutex01 to build (diff)
downloadrtems-78b867e26dac3266763f275c1f438da912f33a6e.tar.bz2
score: replace current and real priority with priority node
Encapsulate the current_priority and real_priority fields of the thread control block with a Thread_Priority_node struct. Propagate modifications throughout the tree where the two fields are directly accessed. Updates #3359.
Diffstat (limited to 'cpukit/posix')
-rw-r--r--cpukit/posix/src/killinfo.c12
-rw-r--r--cpukit/posix/src/pthread.c14
-rw-r--r--cpukit/posix/src/pthreadgetschedparam.c2
-rw-r--r--cpukit/posix/src/pthreadsetschedparam.c4
4 files changed, 16 insertions, 16 deletions
diff --git a/cpukit/posix/src/killinfo.c b/cpukit/posix/src/killinfo.c
index 7ab9beb78a..013334ce79 100644
--- a/cpukit/posix/src/killinfo.c
+++ b/cpukit/posix/src/killinfo.c
@@ -214,7 +214,7 @@ int killinfo(
printk("\n 0x%08x/0x%08x %d/%d 0x%08x 1",
the_thread->Object.id,
((interested) ? interested->Object.id : 0),
- the_thread->current_priority, interested_priority,
+ the_thread->Priority_node.current_priority, interested_priority,
the_thread->current_state
);
#endif
@@ -223,7 +223,7 @@ int killinfo(
* If this thread is of lower priority than the interested thread,
* go on to the next thread.
*/
- if ( the_thread->current_priority > interested_priority )
+ if ( the_thread->Priority_node.current_priority > interested_priority )
continue;
DEBUG_STEP("2");
@@ -250,9 +250,9 @@ int killinfo(
* so we never have to worry about deferencing a NULL
* interested thread.
*/
- if ( the_thread->current_priority < interested_priority ) {
+ if ( the_thread->Priority_node.current_priority < interested_priority ) {
interested = the_thread;
- interested_priority = the_thread->current_priority;
+ interested_priority = the_thread->Priority_node.current_priority;
continue;
}
DEBUG_STEP("4");
@@ -270,7 +270,7 @@ int killinfo(
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
interested = the_thread;
- interested_priority = the_thread->current_priority;
+ interested_priority = the_thread->Priority_node.current_priority;
continue;
}
@@ -281,7 +281,7 @@ int killinfo(
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
DEBUG_STEP("8");
interested = the_thread;
- interested_priority = the_thread->current_priority;
+ interested_priority = the_thread->Priority_node.current_priority;
continue;
}
}
diff --git a/cpukit/posix/src/pthread.c b/cpukit/posix/src/pthread.c
index e335ec0e63..0383e9cdbb 100644
--- a/cpukit/posix/src/pthread.c
+++ b/cpukit/posix/src/pthread.c
@@ -84,20 +84,20 @@ void _POSIX_Threads_Sporadic_budget_TSR(
the_thread->cpu_time_budget = ticks;
new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority );
- the_thread->real_priority = new_priority;
+ the_thread->Priority_node.real_priority = new_priority;
/*
* If holding a resource, then do not change it.
*/
#if 0
printk( "TSR %d %d %d\n", the_thread->resource_count,
- the_thread->current_priority, new_priority );
+ the_thread->Priority_node.current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
/*
* If this would make them less important, then do not change it.
*/
- if ( the_thread->current_priority > new_priority ) {
+ if ( the_thread->Priority_node.current_priority > new_priority ) {
_Thread_Change_priority( the_thread, new_priority, true );
#if 0
printk( "raise priority\n" );
@@ -130,14 +130,14 @@ void _POSIX_Threads_Sporadic_budget_callout(
the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */
new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority);
- the_thread->real_priority = new_priority;
+ the_thread->Priority_node.real_priority = new_priority;
/*
* If holding a resource, then do not change it.
*/
#if 0
printk( "callout %d %d %d\n", the_thread->resource_count,
- the_thread->current_priority, new_priority );
+ the_thread->Priority_node.current_priority, new_priority );
#endif
if ( the_thread->resource_count == 0 ) {
/*
@@ -145,7 +145,7 @@ void _POSIX_Threads_Sporadic_budget_callout(
* to logically lower than sched_ss_low_priority, then we do not want to
* change it.
*/
- if ( the_thread->current_priority < new_priority ) {
+ if ( the_thread->Priority_node.current_priority < new_priority ) {
_Thread_Change_priority( the_thread, new_priority, true );
#if 0
printk( "lower priority\n" );
@@ -181,7 +181,7 @@ bool _POSIX_Threads_Create_extension(
api->schedpolicy = _POSIX_Threads_Default_attributes.schedpolicy;
api->schedparam = _POSIX_Threads_Default_attributes.schedparam;
api->schedparam.sched_priority =
- _POSIX_Priority_From_core( created->current_priority );
+ _POSIX_Priority_From_core( created->Priority_node.current_priority );
/*
* POSIX 1003.1 1996, 18.2.2.2
diff --git a/cpukit/posix/src/pthreadgetschedparam.c b/cpukit/posix/src/pthreadgetschedparam.c
index b8e0a83153..4b72ada539 100644
--- a/cpukit/posix/src/pthreadgetschedparam.c
+++ b/cpukit/posix/src/pthreadgetschedparam.c
@@ -46,7 +46,7 @@ int pthread_getschedparam(
if ( param ) {
*param = api->schedparam;
param->sched_priority =
- _POSIX_Priority_From_core( the_thread->current_priority );
+ _POSIX_Priority_From_core( the_thread->Priority_node.current_priority );
}
_Thread_Enable_dispatch();
return 0;
diff --git a/cpukit/posix/src/pthreadsetschedparam.c b/cpukit/posix/src/pthreadsetschedparam.c
index 14edfa0218..36ce7bb633 100644
--- a/cpukit/posix/src/pthreadsetschedparam.c
+++ b/cpukit/posix/src/pthreadsetschedparam.c
@@ -76,12 +76,12 @@ int pthread_setschedparam(
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
- the_thread->real_priority =
+ the_thread->Priority_node.real_priority =
_POSIX_Priority_To_core( api->schedparam.sched_priority );
_Thread_Change_priority(
the_thread,
- the_thread->real_priority,
+ the_thread->Priority_node.real_priority,
true
);
break;