summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/include/rtems
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/include/rtems
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/include/rtems')
-rw-r--r--cpukit/posix/include/rtems/posix/pthreadattrimpl.h18
-rw-r--r--cpukit/posix/include/rtems/posix/pthreadimpl.h4
-rw-r--r--cpukit/posix/include/rtems/posix/threadsup.h20
3 files changed, 37 insertions, 5 deletions
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 <rtems/score/basedefs.h>
#include <rtems/score/assert.h>
+#include <rtems/posix/priorityimpl.h>
+#include <rtems/posix/threadsup.h>
#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. */