[rtems commit] posix: _POSIX_Threads_Get_sched_param_sporadic()
Sebastian Huber
sebh at rtems.org
Tue Nov 21 07:09:07 UTC 2017
Module: rtems
Branch: master
Commit: c0d602ea6935bd784c2bb81b0c1efe94c6638faa
Changeset: http://git.rtems.org/rtems/commit/?id=c0d602ea6935bd784c2bb81b0c1efe94c6638faa
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Nov 21 06:19:25 2017 +0100
posix: _POSIX_Threads_Get_sched_param_sporadic()
Remove api parameter to simplify the calling functions.
Update #2514.
---
cpukit/posix/include/rtems/posix/pthreadattrimpl.h | 4 +++-
cpukit/posix/src/pthreadgetattrnp.c | 4 ----
cpukit/posix/src/pthreadgetschedparam.c | 5 +----
3 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/cpukit/posix/include/rtems/posix/pthreadattrimpl.h b/cpukit/posix/include/rtems/posix/pthreadattrimpl.h
index 4a565fb..12b8559 100644
--- a/cpukit/posix/include/rtems/posix/pthreadattrimpl.h
+++ b/cpukit/posix/include/rtems/posix/pthreadattrimpl.h
@@ -68,11 +68,13 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Initialize_attributes(
#if defined(RTEMS_POSIX_API)
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Get_sched_param_sporadic(
const Thread_Control *the_thread,
- const POSIX_API_Control *api,
const Scheduler_Control *scheduler,
struct sched_param *param
)
{
+ const POSIX_API_Control *api;
+
+ api = the_thread->API_Extensions[ THREAD_API_POSIX ];
param->sched_ss_low_priority = _POSIX_Priority_From_core(
scheduler,
api->Sporadic.Low_priority.priority
diff --git a/cpukit/posix/src/pthreadgetattrnp.c b/cpukit/posix/src/pthreadgetattrnp.c
index 6690bda..5cc47c6 100644
--- a/cpukit/posix/src/pthreadgetattrnp.c
+++ b/cpukit/posix/src/pthreadgetattrnp.c
@@ -36,7 +36,6 @@ int pthread_getattr_np(
{
Thread_Control *the_thread;
ISR_lock_Context lock_context;
- const POSIX_API_Control *api;
Thread_CPU_budget_algorithms budget_algorithm;
const Scheduler_Control *scheduler;
bool ok;
@@ -55,8 +54,6 @@ int pthread_getattr_np(
_Thread_State_acquire_critical( the_thread, &lock_context );
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
attr->stackaddr = the_thread->Start.Initial_stack.area;
attr->stacksize = the_thread->Start.Initial_stack.size;
@@ -73,7 +70,6 @@ int pthread_getattr_np(
);
_POSIX_Threads_Get_sched_param_sporadic(
the_thread,
- api,
scheduler,
&attr->schedparam
);
diff --git a/cpukit/posix/src/pthreadgetschedparam.c b/cpukit/posix/src/pthreadgetschedparam.c
index 25c6195..2a34e78 100644
--- a/cpukit/posix/src/pthreadgetschedparam.c
+++ b/cpukit/posix/src/pthreadgetschedparam.c
@@ -38,7 +38,6 @@ int pthread_getschedparam(
{
Thread_Control *the_thread;
Thread_queue_Context queue_context;
- const POSIX_API_Control *api;
Thread_CPU_budget_algorithms budget_algorithm;
const Scheduler_Control *scheduler;
Priority_Control priority;
@@ -54,12 +53,10 @@ int pthread_getschedparam(
return ESRCH;
}
- api = the_thread->API_Extensions[ THREAD_API_POSIX ];
-
_Thread_Wait_acquire_critical( the_thread, &queue_context );
scheduler = _Thread_Scheduler_get_home( the_thread );
- _POSIX_Threads_Get_sched_param_sporadic( the_thread, api, scheduler, param );
+ _POSIX_Threads_Get_sched_param_sporadic( the_thread, scheduler, param );
priority = the_thread->Real_priority.priority;
budget_algorithm = the_thread->budget_algorithm;
More information about the vc
mailing list