summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/pthreadgetattrnp.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-17 09:20:20 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-17 11:10:00 +0200
commit3f3f42482daa45aff3647f34afb4e2c4eca242cd (patch)
treeff7e96eddeacf3ea09547d1f7b3b2fb83f9b4e7d /cpukit/posix/src/pthreadgetattrnp.c
parentposix: Move POSIX_API_Control::thread (diff)
downloadrtems-3f3f42482daa45aff3647f34afb4e2c4eca242cd.tar.bz2
posix: Remove POSIX_API_Control::schedparam
Move sporadic server scheduler parameters to POSIX_API_Control::Sporadic. Remove redundant scheduler priority parameter. Update #2514.
Diffstat (limited to 'cpukit/posix/src/pthreadgetattrnp.c')
-rw-r--r--cpukit/posix/src/pthreadgetattrnp.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/cpukit/posix/src/pthreadgetattrnp.c b/cpukit/posix/src/pthreadgetattrnp.c
index d815fc8c53..bebf35e4d6 100644
--- a/cpukit/posix/src/pthreadgetattrnp.c
+++ b/cpukit/posix/src/pthreadgetattrnp.c
@@ -24,6 +24,8 @@
#include <string.h>
#include <rtems/posix/pthreadimpl.h>
+#include <rtems/posix/pthreadattrimpl.h>
+#include <rtems/posix/priorityimpl.h>
#include <rtems/score/schedulerimpl.h>
#include <rtems/score/threadimpl.h>
@@ -32,10 +34,11 @@ int pthread_getattr_np(
pthread_attr_t *attr
)
{
- Thread_Control *the_thread;
- ISR_lock_Context lock_context;
- POSIX_API_Control *api;
- bool ok;
+ Thread_Control *the_thread;
+ ISR_lock_Context lock_context;
+ POSIX_API_Control *api;
+ const Scheduler_Control *scheduler;
+ bool ok;
if ( attr == NULL ) {
return EINVAL;
@@ -65,7 +68,18 @@ int pthread_getattr_np(
}
attr->schedpolicy = api->schedpolicy;
- attr->schedparam = api->schedparam;
+
+ scheduler = _Thread_Scheduler_get_home( the_thread );
+ attr->schedparam.sched_priority = _POSIX_Priority_From_core(
+ scheduler,
+ _Thread_Get_priority( the_thread )
+ );
+ _POSIX_Threads_Get_sched_param_sporadic(
+ the_thread,
+ api,
+ scheduler,
+ &attr->schedparam
+ );
attr->cputime_clock_allowed = 1;
if ( _Thread_Is_joinable( the_thread ) ) {