[rtems commit] score: Create schedulerpriority impl header

Sebastian Huber sebh at rtems.org
Fri Jul 26 09:51:53 UTC 2013


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Jul 24 12:03:31 2013 +0200

score: Create schedulerpriority impl header

Move implementation specific parts of schedulerpriority.h and
schedulerpriority.inl into new header file schedulerpriorityimpl.h.  The
schedulerpriority.h contains now only the application visible API.

Add missing includes.  Remove superfluous includes.

Move declaration of _Priority_Bit_map to prioritybitmap.inl since this
variable is used only here.

Remove second declaration of  _Priority_Major_bit_map.

---

 cpukit/score/Makefile.am                           |    2 +-
 .../score/include/rtems/score/schedulerpriority.h  |   18 ++----------------
 .../rtems/score/schedulerpriorityimpl.h}           |   18 +++++++++++-------
 .../include/rtems/score/schedulersimpleimpl.h      |    2 ++
 cpukit/score/inline/rtems/score/prioritybitmap.inl |    5 +++++
 cpukit/score/preinstall.am                         |    8 ++++----
 cpukit/score/src/schedulercbs.c                    |    6 ++----
 cpukit/score/src/schedulercbscleanup.c             |    4 +---
 cpukit/score/src/schedulercbscreateserver.c        |    4 +---
 cpukit/score/src/schedulercbsdestroyserver.c       |    4 +---
 cpukit/score/src/scheduleredfunblock.c             |    3 +--
 cpukit/score/src/schedulerpriority.c               |    6 +-----
 cpukit/score/src/schedulerpriorityblock.c          |   10 +---------
 cpukit/score/src/schedulerpriorityenqueue.c        |    5 +----
 cpukit/score/src/schedulerpriorityenqueuefirst.c   |    5 +----
 cpukit/score/src/schedulerpriorityextract.c        |    5 +----
 .../score/src/schedulerpriorityprioritycompare.c   |    5 +----
 cpukit/score/src/schedulerpriorityschedule.c       |    4 +---
 cpukit/score/src/schedulerpriorityunblock.c        |    4 +---
 cpukit/score/src/schedulerpriorityyield.c          |    5 +----
 cpukit/score/src/schedulersimple.c                 |    6 +-----
 cpukit/score/src/schedulersimpleextract.c          |    5 ++---
 cpukit/score/src/schedulersimpleschedule.c         |   10 +---------
 cpukit/score/src/schedulersimplesmp.c              |    1 +
 24 files changed, 45 insertions(+), 100 deletions(-)

diff --git a/cpukit/score/Makefile.am b/cpukit/score/Makefile.am
index f04a904..8c422a5 100644
--- a/cpukit/score/Makefile.am
+++ b/cpukit/score/Makefile.am
@@ -47,6 +47,7 @@ include_rtems_score_HEADERS += include/rtems/score/scheduler.h
 include_rtems_score_HEADERS += include/rtems/score/schedulercbs.h
 include_rtems_score_HEADERS += include/rtems/score/scheduleredf.h
 include_rtems_score_HEADERS += include/rtems/score/schedulerpriority.h
+include_rtems_score_HEADERS += include/rtems/score/schedulerpriorityimpl.h
 include_rtems_score_HEADERS += include/rtems/score/schedulersimple.h
 include_rtems_score_HEADERS += include/rtems/score/schedulersimpleimpl.h
 include_rtems_score_HEADERS += include/rtems/score/smp.h
@@ -99,7 +100,6 @@ endif
 include_rtems_score_HEADERS += inline/rtems/score/object.inl
 include_rtems_score_HEADERS += inline/rtems/score/prioritybitmap.inl
 include_rtems_score_HEADERS += inline/rtems/score/scheduler.inl
-include_rtems_score_HEADERS += inline/rtems/score/schedulerpriority.inl
 include_rtems_score_HEADERS += inline/rtems/score/states.inl
 include_rtems_score_HEADERS += inline/rtems/score/thread.inl
 include_rtems_score_HEADERS += inline/rtems/score/threadq.inl
diff --git a/cpukit/score/include/rtems/score/schedulerpriority.h b/cpukit/score/include/rtems/score/schedulerpriority.h
index abd4819..862f9e1 100644
--- a/cpukit/score/include/rtems/score/schedulerpriority.h
+++ b/cpukit/score/include/rtems/score/schedulerpriority.h
@@ -20,7 +20,7 @@
 #define _RTEMS_SCORE_SCHEDULERPRIORITY_H
 
 #include <rtems/score/chain.h>
-#include <rtems/score/priority.h>
+#include <rtems/score/prioritybitmap.h>
 #include <rtems/score/scheduler.h>
 
 #ifdef __cplusplus
@@ -225,25 +225,11 @@ void _Scheduler_priority_Release_job (
   uint32_t         deadline
 );
 
-/**
- *  This is the major bit map.
- */
-extern volatile Priority_bit_map_Control _Priority_Major_bit_map;
-
-/**
- *  This is the minor bit map.
- */
-extern Priority_bit_map_Control _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;
-
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/score/schedulerpriority.inl>
-#endif
+/**@}*/
 
 #ifdef __cplusplus
 }
 #endif
 
-/**@}*/
-
 #endif
 /* end of include file */
diff --git a/cpukit/score/inline/rtems/score/schedulerpriority.inl b/cpukit/score/include/rtems/score/schedulerpriorityimpl.h
similarity index 95%
rename from cpukit/score/inline/rtems/score/schedulerpriority.inl
rename to cpukit/score/include/rtems/score/schedulerpriorityimpl.h
index 393ee09..03568ed 100644
--- a/cpukit/score/inline/rtems/score/schedulerpriority.inl
+++ b/cpukit/score/include/rtems/score/schedulerpriorityimpl.h
@@ -17,17 +17,17 @@
  *  http://www.rtems.com/license/LICENSE.
  */
 
-#ifndef _RTEMS_SCORE_SCHEDULERPRIORITY_H
-# error "Never use <rtems/score/schedulerpriority.inl> directly; include <rtems/score/schedulerpriority.h> instead."
-#endif
-
-#ifndef _RTEMS_SCORE_SCHEDULERPRIORITY_INL
-#define _RTEMS_SCORE_SCHEDULERPRIORITY_INL
+#ifndef _RTEMS_SCORE_SCHEDULERPRIORITYIMPL_H
+#define _RTEMS_SCORE_SCHEDULERPRIORITYIMPL_H
 
+#include <rtems/score/schedulerpriority.h>
 #include <rtems/score/chainimpl.h>
-#include <rtems/score/thread.h>
 #include <rtems/score/wkspace.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @addtogroup ScoreScheduler
  */
@@ -206,5 +206,9 @@ RTEMS_INLINE_ROUTINE int _Scheduler_priority_Priority_compare_body(
 
 /** @} */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 /* end of include file */
diff --git a/cpukit/score/include/rtems/score/schedulersimpleimpl.h b/cpukit/score/include/rtems/score/schedulersimpleimpl.h
index e8c4cc6..076d1a9 100644
--- a/cpukit/score/include/rtems/score/schedulersimpleimpl.h
+++ b/cpukit/score/include/rtems/score/schedulersimpleimpl.h
@@ -20,6 +20,8 @@
 #define _RTEMS_SCORE_SCHEDULERSIMPLEIMPL_H
 
 #include <rtems/score/schedulersimple.h>
+#include <rtems/score/chainimpl.h>
+#include <rtems/score/thread.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/cpukit/score/inline/rtems/score/prioritybitmap.inl b/cpukit/score/inline/rtems/score/prioritybitmap.inl
index 70844fa..19196ce 100644
--- a/cpukit/score/inline/rtems/score/prioritybitmap.inl
+++ b/cpukit/score/inline/rtems/score/prioritybitmap.inl
@@ -98,6 +98,11 @@ RTEMS_INLINE_ROUTINE uint32_t   _Priority_Bits_index (
  */
 
 /**
+ *  This is the minor bit map.
+ */
+extern Priority_bit_map_Control _Priority_Bit_map[16] CPU_STRUCTURE_ALIGNMENT;
+
+/**
  * This routine performs the initialization necessary for this handler.
  */
 
diff --git a/cpukit/score/preinstall.am b/cpukit/score/preinstall.am
index 35b57d0..d650a46 100644
--- a/cpukit/score/preinstall.am
+++ b/cpukit/score/preinstall.am
@@ -171,6 +171,10 @@ $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.h: include/rtems/score/schedule
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.h
 
+$(PROJECT_INCLUDE)/rtems/score/schedulerpriorityimpl.h: include/rtems/score/schedulerpriorityimpl.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulerpriorityimpl.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulerpriorityimpl.h
+
 $(PROJECT_INCLUDE)/rtems/score/schedulersimple.h: include/rtems/score/schedulersimple.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulersimple.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulersimple.h
@@ -327,10 +331,6 @@ $(PROJECT_INCLUDE)/rtems/score/scheduler.inl: inline/rtems/score/scheduler.inl $
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/scheduler.inl
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/scheduler.inl
 
-$(PROJECT_INCLUDE)/rtems/score/schedulerpriority.inl: inline/rtems/score/schedulerpriority.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
-	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.inl
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/schedulerpriority.inl
-
 $(PROJECT_INCLUDE)/rtems/score/states.inl: inline/rtems/score/states.inl $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/states.inl
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/states.inl
diff --git a/cpukit/score/src/schedulercbs.c b/cpukit/score/src/schedulercbs.c
index 7905387..f3aa2c0 100644
--- a/cpukit/score/src/schedulercbs.c
+++ b/cpukit/score/src/schedulercbs.c
@@ -18,11 +18,9 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/score/scheduler.h>
 #include <rtems/score/schedulercbs.h>
-#include <rtems/rtems/signal.h>
+#include <rtems/score/thread.h>
+#include <rtems/score/wkspace.h>
 
 Scheduler_CBS_Server **_Scheduler_CBS_Server_list;
 
diff --git a/cpukit/score/src/schedulercbscleanup.c b/cpukit/score/src/schedulercbscleanup.c
index abffeaf..c1aaa91 100644
--- a/cpukit/score/src/schedulercbscleanup.c
+++ b/cpukit/score/src/schedulercbscleanup.c
@@ -18,10 +18,8 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/score/scheduler.h>
 #include <rtems/score/schedulercbs.h>
+#include <rtems/score/wkspace.h>
 
 int _Scheduler_CBS_Cleanup (void)
 {
diff --git a/cpukit/score/src/schedulercbscreateserver.c b/cpukit/score/src/schedulercbscreateserver.c
index 9f69fba..e499b0f 100644
--- a/cpukit/score/src/schedulercbscreateserver.c
+++ b/cpukit/score/src/schedulercbscreateserver.c
@@ -18,10 +18,8 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/score/scheduler.h>
 #include <rtems/score/schedulercbs.h>
+#include <rtems/score/wkspace.h>
 
 int _Scheduler_CBS_Create_server (
   Scheduler_CBS_Parameters     *params,
diff --git a/cpukit/score/src/schedulercbsdestroyserver.c b/cpukit/score/src/schedulercbsdestroyserver.c
index 5030b6f..8fb1b7e 100644
--- a/cpukit/score/src/schedulercbsdestroyserver.c
+++ b/cpukit/score/src/schedulercbsdestroyserver.c
@@ -19,10 +19,8 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/score/scheduler.h>
 #include <rtems/score/schedulercbs.h>
+#include <rtems/score/wkspace.h>
 
 int _Scheduler_CBS_Destroy_server (
   Scheduler_CBS_Server_id server_id
diff --git a/cpukit/score/src/scheduleredfunblock.c b/cpukit/score/src/scheduleredfunblock.c
index 31ed640..0aeb7de 100644
--- a/cpukit/score/src/scheduleredfunblock.c
+++ b/cpukit/score/src/scheduleredfunblock.c
@@ -18,9 +18,8 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/score/scheduler.h>
 #include <rtems/score/scheduleredf.h>
+#include <rtems/score/thread.h>
 
 void _Scheduler_EDF_Unblock(
   Thread_Control    *the_thread
diff --git a/cpukit/score/src/schedulerpriority.c b/cpukit/score/src/schedulerpriority.c
index e6176e8..7314da4 100644
--- a/cpukit/score/src/schedulerpriority.c
+++ b/cpukit/score/src/schedulerpriority.c
@@ -18,11 +18,7 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/score/prioritybitmap.h>
-#include <rtems/score/scheduler.h>
-#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/schedulerpriorityimpl.h>
 
 /* Instantiate any global variables needed by the priority scheduler */
 volatile Priority_bit_map_Control _Priority_Major_bit_map;
diff --git a/cpukit/score/src/schedulerpriorityblock.c b/cpukit/score/src/schedulerpriorityblock.c
index d527907..d5f5840 100644
--- a/cpukit/score/src/schedulerpriorityblock.c
+++ b/cpukit/score/src/schedulerpriorityblock.c
@@ -20,15 +20,7 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/score/context.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/scheduler.h>
-#include <rtems/score/schedulerpriority.h>
-#include <rtems/score/thread.h>
+#include <rtems/score/schedulerpriorityimpl.h>
 
 void _Scheduler_priority_Block(
   Thread_Control   *the_thread
diff --git a/cpukit/score/src/schedulerpriorityenqueue.c b/cpukit/score/src/schedulerpriorityenqueue.c
index 89cf4a2..b1ecf34 100644
--- a/cpukit/score/src/schedulerpriorityenqueue.c
+++ b/cpukit/score/src/schedulerpriorityenqueue.c
@@ -18,10 +18,7 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/score/scheduler.h>
-#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/schedulerpriorityimpl.h>
 
 void _Scheduler_priority_Enqueue(
   Thread_Control      *the_thread
diff --git a/cpukit/score/src/schedulerpriorityenqueuefirst.c b/cpukit/score/src/schedulerpriorityenqueuefirst.c
index f5b4940..a18efba 100644
--- a/cpukit/score/src/schedulerpriorityenqueuefirst.c
+++ b/cpukit/score/src/schedulerpriorityenqueuefirst.c
@@ -18,10 +18,7 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/schedulerpriorityimpl.h>
 
 void _Scheduler_priority_Enqueue_first(
   Thread_Control      *the_thread
diff --git a/cpukit/score/src/schedulerpriorityextract.c b/cpukit/score/src/schedulerpriorityextract.c
index 02f6004..3000c80 100644
--- a/cpukit/score/src/schedulerpriorityextract.c
+++ b/cpukit/score/src/schedulerpriorityextract.c
@@ -19,10 +19,7 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/schedulerpriorityimpl.h>
 
 void _Scheduler_priority_Extract(
   Thread_Control      *the_thread
diff --git a/cpukit/score/src/schedulerpriorityprioritycompare.c b/cpukit/score/src/schedulerpriorityprioritycompare.c
index 7d37707..f8c13fe 100644
--- a/cpukit/score/src/schedulerpriorityprioritycompare.c
+++ b/cpukit/score/src/schedulerpriorityprioritycompare.c
@@ -18,10 +18,7 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/schedulerpriorityimpl.h>
 
 int _Scheduler_priority_Priority_compare(
   Priority_Control      p1,
diff --git a/cpukit/score/src/schedulerpriorityschedule.c b/cpukit/score/src/schedulerpriorityschedule.c
index 3757387..22ed5f4 100644
--- a/cpukit/score/src/schedulerpriorityschedule.c
+++ b/cpukit/score/src/schedulerpriorityschedule.c
@@ -18,9 +18,7 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/score/scheduler.h>
-#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/schedulerpriorityimpl.h>
 
 void _Scheduler_priority_Schedule(void)
 {
diff --git a/cpukit/score/src/schedulerpriorityunblock.c b/cpukit/score/src/schedulerpriorityunblock.c
index f1d52e3..8afa385 100644
--- a/cpukit/score/src/schedulerpriorityunblock.c
+++ b/cpukit/score/src/schedulerpriorityunblock.c
@@ -20,9 +20,7 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/score/scheduler.h>
-#include <rtems/score/schedulerpriority.h>
+#include <rtems/score/schedulerpriorityimpl.h>
 
 void _Scheduler_priority_Unblock (
   Thread_Control          *the_thread
diff --git a/cpukit/score/src/schedulerpriorityyield.c b/cpukit/score/src/schedulerpriorityyield.c
index 4c2b599..e65bdb8 100644
--- a/cpukit/score/src/schedulerpriorityyield.c
+++ b/cpukit/score/src/schedulerpriorityyield.c
@@ -18,11 +18,8 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
+#include <rtems/score/schedulerpriorityimpl.h>
 #include <rtems/score/isr.h>
-#include <rtems/score/scheduler.h>
-#include <rtems/score/schedulerpriority.h>
-#include <rtems/score/thread.h>
 
 void _Scheduler_priority_Yield( Thread_Control *thread )
 {
diff --git a/cpukit/score/src/schedulersimple.c b/cpukit/score/src/schedulersimple.c
index 6ba46a3..84ffb74 100644
--- a/cpukit/score/src/schedulersimple.c
+++ b/cpukit/score/src/schedulersimple.c
@@ -19,12 +19,8 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/config.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/scheduler.h>
 #include <rtems/score/schedulersimple.h>
-#include <rtems/score/thread.h>
+#include <rtems/score/chainimpl.h>
 #include <rtems/score/wkspace.h>
 
 void * _Scheduler_simple_Allocate(
diff --git a/cpukit/score/src/schedulersimpleextract.c b/cpukit/score/src/schedulersimpleextract.c
index e5d6e78..9cd0b02 100644
--- a/cpukit/score/src/schedulersimpleextract.c
+++ b/cpukit/score/src/schedulersimpleextract.c
@@ -19,10 +19,9 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/score/chain.h>
-#include <rtems/score/thread.h>
 #include <rtems/score/schedulersimple.h>
+#include <rtems/score/chainimpl.h>
+#include <rtems/score/thread.h>
 
 void _Scheduler_simple_Extract(
   Thread_Control    *the_thread
diff --git a/cpukit/score/src/schedulersimpleschedule.c b/cpukit/score/src/schedulersimpleschedule.c
index e41fa96..b60f096 100644
--- a/cpukit/score/src/schedulersimpleschedule.c
+++ b/cpukit/score/src/schedulersimpleschedule.c
@@ -18,16 +18,8 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/score/context.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/percpu.h>
-#include <rtems/score/scheduler.h>
-#include <rtems/score/thread.h>
 #include <rtems/score/schedulersimple.h>
+#include <rtems/score/chainimpl.h>
 
 void _Scheduler_simple_Schedule(void)
 {
diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c
index b197af5..55c40a6 100644
--- a/cpukit/score/src/schedulersimplesmp.c
+++ b/cpukit/score/src/schedulersimplesmp.c
@@ -20,6 +20,7 @@
 
 #include <rtems/score/schedulersimplesmp.h>
 #include <rtems/score/schedulersimpleimpl.h>
+#include <rtems/score/wkspace.h>
 
 static Scheduler_simple_smp_Control *_Scheduler_simple_smp_Instance( void )
 {




More information about the vc mailing list