posix: _POSIX_Threads_Get_sched_param_sporadic()

Remove api parameter to simplify the calling functions.

Update #2514.
This commit is contained in:
Sebastian Huber
2017-11-21 06:19:25 +01:00
parent c597fb166e
commit c0d602ea69
3 changed files with 4 additions and 9 deletions

View File

@@ -68,11 +68,13 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Initialize_attributes(
#if defined(RTEMS_POSIX_API) #if defined(RTEMS_POSIX_API)
RTEMS_INLINE_ROUTINE void _POSIX_Threads_Get_sched_param_sporadic( RTEMS_INLINE_ROUTINE void _POSIX_Threads_Get_sched_param_sporadic(
const Thread_Control *the_thread, const Thread_Control *the_thread,
const POSIX_API_Control *api,
const Scheduler_Control *scheduler, const Scheduler_Control *scheduler,
struct sched_param *param 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( param->sched_ss_low_priority = _POSIX_Priority_From_core(
scheduler, scheduler,
api->Sporadic.Low_priority.priority api->Sporadic.Low_priority.priority

View File

@@ -36,7 +36,6 @@ int pthread_getattr_np(
{ {
Thread_Control *the_thread; Thread_Control *the_thread;
ISR_lock_Context lock_context; ISR_lock_Context lock_context;
const POSIX_API_Control *api;
Thread_CPU_budget_algorithms budget_algorithm; Thread_CPU_budget_algorithms budget_algorithm;
const Scheduler_Control *scheduler; const Scheduler_Control *scheduler;
bool ok; bool ok;
@@ -55,8 +54,6 @@ int pthread_getattr_np(
_Thread_State_acquire_critical( the_thread, &lock_context ); _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->stackaddr = the_thread->Start.Initial_stack.area;
attr->stacksize = the_thread->Start.Initial_stack.size; attr->stacksize = the_thread->Start.Initial_stack.size;
@@ -73,7 +70,6 @@ int pthread_getattr_np(
); );
_POSIX_Threads_Get_sched_param_sporadic( _POSIX_Threads_Get_sched_param_sporadic(
the_thread, the_thread,
api,
scheduler, scheduler,
&attr->schedparam &attr->schedparam
); );

View File

@@ -38,7 +38,6 @@ int pthread_getschedparam(
{ {
Thread_Control *the_thread; Thread_Control *the_thread;
Thread_queue_Context queue_context; Thread_queue_Context queue_context;
const POSIX_API_Control *api;
Thread_CPU_budget_algorithms budget_algorithm; Thread_CPU_budget_algorithms budget_algorithm;
const Scheduler_Control *scheduler; const Scheduler_Control *scheduler;
Priority_Control priority; Priority_Control priority;
@@ -54,12 +53,10 @@ int pthread_getschedparam(
return ESRCH; return ESRCH;
} }
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
_Thread_Wait_acquire_critical( the_thread, &queue_context ); _Thread_Wait_acquire_critical( the_thread, &queue_context );
scheduler = _Thread_Scheduler_get_home( the_thread ); 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; priority = the_thread->Real_priority.priority;
budget_algorithm = the_thread->budget_algorithm; budget_algorithm = the_thread->budget_algorithm;