[rtems commit] rtems: Avoid include of <rtems/score/scheduler.h>

Sebastian Huber sebh at rtems.org
Mon Nov 12 14:40:39 UTC 2018


Module:    rtems
Branch:    master
Commit:    e897c7dd76401bf880c179c875c25dc8954a3688
Changeset: http://git.rtems.org/rtems/commit/?id=e897c7dd76401bf880c179c875c25dc8954a3688

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Nov  8 12:57:26 2018 +0100

rtems: Avoid include of <rtems/score/scheduler.h>

Update #3598.

---

 cpukit/Makefile.am                     |  1 +
 cpukit/include/rtems/rtems/tasks.h     | 11 ++++++-----
 cpukit/include/rtems/rtems/tasksdata.h |  1 +
 cpukit/include/rtems/rtems/types.h     |  1 +
 cpukit/rtems/src/rtemsmaxprio.c        | 31 +++++++++++++++++++++++++++++++
 5 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am
index d148038..ead5636 100644
--- a/cpukit/Makefile.am
+++ b/cpukit/Makefile.am
@@ -738,6 +738,7 @@ librtemscpu_a_SOURCES += rtems/src/regionresizesegment.c
 librtemscpu_a_SOURCES += rtems/src/regionreturnsegment.c
 librtemscpu_a_SOURCES += rtems/src/rtemsbuildid.c
 librtemscpu_a_SOURCES += rtems/src/rtemsbuildname.c
+librtemscpu_a_SOURCES += rtems/src/rtemsmaxprio.c
 librtemscpu_a_SOURCES += rtems/src/rtemsobjectapimaximumclass.c
 librtemscpu_a_SOURCES += rtems/src/rtemsobjectapiminimumclass.c
 librtemscpu_a_SOURCES += rtems/src/rtemsobjectgetapiclassname.c
diff --git a/cpukit/include/rtems/rtems/tasks.h b/cpukit/include/rtems/rtems/tasks.h
index 3d0b739..55863a9 100644
--- a/cpukit/include/rtems/rtems/tasks.h
+++ b/cpukit/include/rtems/rtems/tasks.h
@@ -18,7 +18,6 @@
 #ifndef _RTEMS_RTEMS_TASKS_H
 #define _RTEMS_RTEMS_TASKS_H
 
-#include <rtems/score/scheduler.h>
 #include <rtems/rtems/attr.h>
 #include <rtems/rtems/status.h>
 #include <rtems/rtems/types.h>
@@ -66,10 +65,12 @@ typedef uint32_t rtems_task_priority;
  *  This constant is the least valid value for a Classic API
  *  task priority.
  */
-#define RTEMS_MINIMUM_PRIORITY      (PRIORITY_MINIMUM + 1)
+#define RTEMS_MINIMUM_PRIORITY      1
+
+rtems_task_priority _RTEMS_Maximum_priority( void );
 
 /**
- *  This constant is the maximum valid value for a Classic API
+ *  This run-time constant is the maximum valid value for a Classic API
  *  task priority.
  *
  *  @note This is actually the priority of the IDLE thread so
@@ -78,13 +79,13 @@ typedef uint32_t rtems_task_priority;
  *        want to ensure that a task does not executes during
  *        certain operations such as a system mode change.
  */
-#define RTEMS_MAXIMUM_PRIORITY      ((rtems_task_priority) PRIORITY_MAXIMUM)
+#define RTEMS_MAXIMUM_PRIORITY      _RTEMS_Maximum_priority()
 
 /**
  *  The following constant is passed to rtems_task_set_priority when the
  *  caller wants to obtain the current priority.
  */
-#define RTEMS_CURRENT_PRIORITY      PRIORITY_MINIMUM
+#define RTEMS_CURRENT_PRIORITY      0
 
 struct _Thread_Control;
 
diff --git a/cpukit/include/rtems/rtems/tasksdata.h b/cpukit/include/rtems/rtems/tasksdata.h
index 22e524d..18562bf 100644
--- a/cpukit/include/rtems/rtems/tasksdata.h
+++ b/cpukit/include/rtems/rtems/tasksdata.h
@@ -21,6 +21,7 @@
 #include <rtems/rtems/tasks.h>
 #include <rtems/rtems/asrdata.h>
 #include <rtems/rtems/eventdata.h>
+#include <rtems/score/thread.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/cpukit/include/rtems/rtems/types.h b/cpukit/include/rtems/rtems/types.h
index 878340f..9222f25 100644
--- a/cpukit/include/rtems/rtems/types.h
+++ b/cpukit/include/rtems/rtems/types.h
@@ -22,6 +22,7 @@
  *  RTEMS basic type definitions
  */
 
+#include <sys/cpuset.h>
 #include <sys/_timespec.h>
 #include <sys/_timeval.h>
 #include <stdint.h>
diff --git a/cpukit/rtems/src/rtemsmaxprio.c b/cpukit/rtems/src/rtemsmaxprio.c
new file mode 100644
index 0000000..5a46c6b
--- /dev/null
+++ b/cpukit/rtems/src/rtemsmaxprio.c
@@ -0,0 +1,31 @@
+/**
+ * @file
+ *
+ * @ingroup ClassicTasksImpl
+ */
+
+/*
+ * Copyright (c) 2018 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/rtems/tasks.h>
+#include <rtems/score/scheduler.h>
+
+rtems_task_priority _RTEMS_Maximum_priority( void )
+{
+  return PRIORITY_MAXIMUM;
+}




More information about the vc mailing list