summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/schedulerdefaultmappriority.c21
-rw-r--r--cpukit/score/src/scheduleredfchangepriority.c16
-rw-r--r--cpukit/score/src/threadcreateidle.c4
3 files changed, 40 insertions, 1 deletions
diff --git a/cpukit/score/src/schedulerdefaultmappriority.c b/cpukit/score/src/schedulerdefaultmappriority.c
new file mode 100644
index 0000000000..37a600011e
--- /dev/null
+++ b/cpukit/score/src/schedulerdefaultmappriority.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2016 embedded brains GmbH
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/score/scheduler.h>
+
+Priority_Control _Scheduler_default_Map_priority(
+ const Scheduler_Control *scheduler,
+ Priority_Control priority
+)
+{
+ return priority;
+}
diff --git a/cpukit/score/src/scheduleredfchangepriority.c b/cpukit/score/src/scheduleredfchangepriority.c
index 61e0481d03..6efbf87ad3 100644
--- a/cpukit/score/src/scheduleredfchangepriority.c
+++ b/cpukit/score/src/scheduleredfchangepriority.c
@@ -20,6 +20,22 @@
#include <rtems/score/scheduleredfimpl.h>
+Priority_Control _Scheduler_EDF_Map_priority(
+ const Scheduler_Control *scheduler,
+ Priority_Control priority
+)
+{
+ return SCHEDULER_EDF_PRIO_MSB | priority;
+}
+
+Priority_Control _Scheduler_EDF_Unmap_priority(
+ const Scheduler_Control *scheduler,
+ Priority_Control priority
+)
+{
+ return priority & ~SCHEDULER_EDF_PRIO_MSB;
+}
+
Scheduler_Void_or_thread _Scheduler_EDF_Change_priority(
const Scheduler_Control *scheduler,
Thread_Control *the_thread,
diff --git a/cpukit/score/src/threadcreateidle.c b/cpukit/score/src/threadcreateidle.c
index 0df53ecfab..89e5d60a18 100644
--- a/cpukit/score/src/threadcreateidle.c
+++ b/cpukit/score/src/threadcreateidle.c
@@ -19,6 +19,7 @@
#endif
#include <rtems/score/threadimpl.h>
+#include <rtems/score/assert.h>
#include <rtems/score/schedulerimpl.h>
#include <rtems/score/stackimpl.h>
#include <rtems/score/sysstate.h>
@@ -47,6 +48,7 @@ static void _Thread_Create_idle_for_CPU( Per_CPU_Control *cpu )
* _Workspace_Initialization.
*/
idle = _Thread_Internal_allocate();
+ _Assert( idle != NULL );
_Thread_Initialize(
&_Thread_Internal_information,
@@ -55,7 +57,7 @@ static void _Thread_Create_idle_for_CPU( Per_CPU_Control *cpu )
NULL, /* allocate the stack */
_Stack_Ensure_minimum( rtems_configuration_get_idle_task_stack_size() ),
CPU_IDLE_TASK_IS_FP,
- scheduler->maximum_priority,
+ _Scheduler_Map_priority( scheduler, scheduler->maximum_priority ),
true, /* preemptable */
THREAD_CPU_BUDGET_ALGORITHM_NONE,
NULL, /* no budget algorithm callout */