From 3f3f42482daa45aff3647f34afb4e2c4eca242cd Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 17 Oct 2017 09:20:20 +0200 Subject: posix: Remove POSIX_API_Control::schedparam Move sporadic server scheduler parameters to POSIX_API_Control::Sporadic. Remove redundant scheduler priority parameter. Update #2514. --- cpukit/posix/include/rtems/posix/pthreadattrimpl.h | 18 ++++++++++++++++++ cpukit/posix/include/rtems/posix/pthreadimpl.h | 4 ++-- cpukit/posix/include/rtems/posix/threadsup.h | 20 +++++++++++++++++--- 3 files changed, 37 insertions(+), 5 deletions(-) (limited to 'cpukit/posix/include/rtems/posix') diff --git a/cpukit/posix/include/rtems/posix/pthreadattrimpl.h b/cpukit/posix/include/rtems/posix/pthreadattrimpl.h index a52be931a1..1e5105deab 100644 --- a/cpukit/posix/include/rtems/posix/pthreadattrimpl.h +++ b/cpukit/posix/include/rtems/posix/pthreadattrimpl.h @@ -24,6 +24,8 @@ #include #include +#include +#include #ifdef __cplusplus extern "C" { @@ -61,6 +63,22 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Initialize_attributes( ); } +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 +) +{ + param->sched_ss_low_priority = _POSIX_Priority_From_core( + scheduler, + api->Sporadic.Low_priority.priority + ); + param->sched_ss_repl_period = api->Sporadic.sched_ss_repl_period; + param->sched_ss_init_budget = api->Sporadic.sched_ss_init_budget; + param->sched_ss_max_repl = api->Sporadic.sched_ss_max_repl; +} + /** @} */ #ifdef __cplusplus diff --git a/cpukit/posix/include/rtems/posix/pthreadimpl.h b/cpukit/posix/include/rtems/posix/pthreadimpl.h index bae9e344a0..82593d3097 100644 --- a/cpukit/posix/include/rtems/posix/pthreadimpl.h +++ b/cpukit/posix/include/rtems/posix/pthreadimpl.h @@ -54,12 +54,12 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Sporadic_timer_insert( ) { the_thread->cpu_time_budget = - _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); + _Timespec_To_ticks( &api->Sporadic.sched_ss_init_budget ); _Watchdog_Per_CPU_insert_ticks( &api->Sporadic.Timer, _Per_CPU_Get(), - _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ) + _Timespec_To_ticks( &api->Sporadic.sched_ss_repl_period ) ); } diff --git a/cpukit/posix/include/rtems/posix/threadsup.h b/cpukit/posix/include/rtems/posix/threadsup.h index 816ef566d8..b3b3910084 100644 --- a/cpukit/posix/include/rtems/posix/threadsup.h +++ b/cpukit/posix/include/rtems/posix/threadsup.h @@ -46,9 +46,6 @@ typedef struct { /** The scheduler policy. */ int schedpolicy; - /** The scheduler parameters */ - struct sched_param schedparam; - /** * @brief Control block for the sporadic server scheduling policy. */ @@ -67,6 +64,23 @@ typedef struct { * policy. */ Priority_Node Low_priority; + + /** + * @brief Replenishment period for sporadic server. + */ + struct timespec sched_ss_repl_period; + + /** + * @brief Initial budget for sporadic server. + */ + struct timespec sched_ss_init_budget; + + /** + * @brief Maximum pending replenishments. + * + * Only used by pthread_getschedparam() and pthread_getattr_np(). + */ + int sched_ss_max_repl; } Sporadic; /** This is the set of signals which are currently unblocked. */ -- cgit v1.2.3