[rtems commit] rtems: Create part implementation header

Sebastian Huber sebh at rtems.org
Tue Jul 23 13:09:30 UTC 2013


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Jul 23 14:19:58 2013 +0200

rtems: Create part implementation header

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

---

 cpukit/libcsupport/src/resource_snapshot.c         |    1 +
 cpukit/libmisc/monitor/mon-object.c                |    1 +
 cpukit/rtems/Makefile.am                           |    2 +-
 cpukit/rtems/include/rtems/rtems/part.h            |   43 ++-------------
 .../part.inl => include/rtems/rtems/partimpl.h}    |   58 ++++++++++++++++----
 cpukit/rtems/include/rtems/rtems/partmp.h          |    8 ++-
 cpukit/rtems/preinstall.am                         |    8 ++--
 cpukit/rtems/src/part.c                            |    2 +-
 cpukit/rtems/src/partcreate.c                      |    2 +-
 cpukit/rtems/src/partdata.c                        |    3 +-
 cpukit/rtems/src/partdelete.c                      |    2 +-
 cpukit/rtems/src/partgetbuffer.c                   |    2 +-
 cpukit/rtems/src/partident.c                       |    2 +-
 cpukit/rtems/src/partmp.c                          |    2 +-
 cpukit/rtems/src/partreturnbuffer.c                |    2 +-
 cpukit/sapi/src/rtemsapi.c                         |    2 +-
 testsuites/sptests/spsize/size.c                   |    4 +-
 17 files changed, 75 insertions(+), 69 deletions(-)

diff --git a/cpukit/libcsupport/src/resource_snapshot.c b/cpukit/libcsupport/src/resource_snapshot.c
index c04dcf6..0fd20ae 100644
--- a/cpukit/libcsupport/src/resource_snapshot.c
+++ b/cpukit/libcsupport/src/resource_snapshot.c
@@ -30,6 +30,7 @@
 #include <rtems/rtems/barrierimpl.h>
 #include <rtems/rtems/dpmemimpl.h>
 #include <rtems/rtems/messageimpl.h>
+#include <rtems/rtems/partimpl.h>
 #include <rtems/rtems/ratemonimpl.h>
 #include <rtems/rtems/semimpl.h>
 #include <rtems/rtems/timerimpl.h>
diff --git a/cpukit/libmisc/monitor/mon-object.c b/cpukit/libmisc/monitor/mon-object.c
index 3ef9276..cb0ffa1 100644
--- a/cpukit/libmisc/monitor/mon-object.c
+++ b/cpukit/libmisc/monitor/mon-object.c
@@ -22,6 +22,7 @@
 #include <rtems/monitor.h>
 #include <rtems/extensionimpl.h>
 #include <rtems/rtems/messageimpl.h>
+#include <rtems/rtems/partimpl.h>
 #include <rtems/rtems/semimpl.h>
 #if defined(RTEMS_POSIX_API)
   #include <rtems/posix/pthreadimpl.h>
diff --git a/cpukit/rtems/Makefile.am b/cpukit/rtems/Makefile.am
index 5b6d526..7e810af 100644
--- a/cpukit/rtems/Makefile.am
+++ b/cpukit/rtems/Makefile.am
@@ -36,6 +36,7 @@ include_rtems_rtems_HEADERS += include/rtems/rtems/object.h
 include_rtems_rtems_HEADERS += include/rtems/rtems/options.h
 include_rtems_rtems_HEADERS += include/rtems/rtems/optionsimpl.h
 include_rtems_rtems_HEADERS += include/rtems/rtems/part.h
+include_rtems_rtems_HEADERS += include/rtems/rtems/partimpl.h
 include_rtems_rtems_HEADERS += include/rtems/rtems/ratemon.h
 include_rtems_rtems_HEADERS += include/rtems/rtems/ratemonimpl.h
 include_rtems_rtems_HEADERS += include/rtems/rtems/region.h
@@ -68,7 +69,6 @@ include_rtems_rtems_HEADERS += include/rtems/rtems/signalmp.h
 include_rtems_rtems_HEADERS += include/rtems/rtems/taskmp.h
 endif
 
-include_rtems_rtems_HEADERS += inline/rtems/rtems/part.inl
 include_rtems_rtems_HEADERS += inline/rtems/rtems/region.inl
 include_rtems_rtems_HEADERS += inline/rtems/rtems/tasks.inl
 
diff --git a/cpukit/rtems/include/rtems/rtems/part.h b/cpukit/rtems/include/rtems/rtems/part.h
index c864beb..e9d2dfc 100644
--- a/cpukit/rtems/include/rtems/rtems/part.h
+++ b/cpukit/rtems/include/rtems/rtems/part.h
@@ -31,29 +31,14 @@
 #ifndef _RTEMS_RTEMS_PART_H
 #define _RTEMS_RTEMS_PART_H
 
-/**
- * This constant is defined to extern most of the time when using
- * this header file. However by defining it to nothing, the data
- * declared in this header file can be instantiated. This is done
- * in a single per manager file.
- *
- * Partition Manager -- Instantiate Data
- */
-#ifndef RTEMS_PART_EXTERN
-#define RTEMS_PART_EXTERN extern
-#endif
+#include <rtems/rtems/attr.h>
+#include <rtems/rtems/status.h>
+#include <rtems/rtems/types.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include <rtems/score/address.h>
-#include <rtems/score/object.h>
-#include <rtems/rtems/attr.h>
-#include <rtems/rtems/status.h>
-#include <rtems/rtems/support.h>
-#include <rtems/rtems/types.h>
-
 /**
  *  @defgroup ClassicPart Partitions
  *
@@ -85,19 +70,6 @@ typedef struct {
 }   Partition_Control;
 
 /**
- *  The following defines the information control block used to
- *  manage this class of objects.
- */
-RTEMS_PART_EXTERN Objects_Information _Partition_Information;
-
-/**
- *  @brief Partition Manager Initialization
- *
- *  This routine performs the initialization necessary for this manager.
- */
-void _Partition_Manager_initialization(void);
-
-/**
  *  @brief RTEMS Partition Create
  *
  *  Partition Manager
@@ -189,18 +161,11 @@ rtems_status_code rtems_partition_return_buffer(
   void     *buffer
 );
 
-#ifndef __RTEMS_APPLICATION__
-#include <rtems/rtems/part.inl>
-#endif
-#if defined(RTEMS_MULTIPROCESSING)
-#include <rtems/rtems/partmp.h>
-#endif
+/**@}*/
 
 #ifdef __cplusplus
 }
 #endif
 
-/**@}*/
-
 #endif
 /* end of include file */
diff --git a/cpukit/rtems/inline/rtems/rtems/part.inl b/cpukit/rtems/include/rtems/rtems/partimpl.h
similarity index 79%
rename from cpukit/rtems/inline/rtems/rtems/part.inl
rename to cpukit/rtems/include/rtems/rtems/partimpl.h
index 0a9bead..2de8028 100644
--- a/cpukit/rtems/inline/rtems/rtems/part.inl
+++ b/cpukit/rtems/include/rtems/rtems/partimpl.h
@@ -1,8 +1,9 @@
 /**
- * @file rtems/rtems/part.inl
+ * @file
  *
- *  This file contains the macro implementation of all inlined routines
- *  in the Partition Manager.
+ * @ingroup ClassicPartImpl
+ *
+ * @brief Classic Partition Manager Implementation
  */
 
 /*  COPYRIGHT (c) 1989-2008.
@@ -13,19 +14,48 @@
  *  http://www.rtems.com/license/LICENSE.
  */
 
-#ifndef _RTEMS_RTEMS_PART_H
-# error "Never use <rtems/rtems/part.inl> directly; include <rtems/rtems/part.h> instead."
+#ifndef _RTEMS_RTEMS_PARTIMPL_H
+#define _RTEMS_RTEMS_PARTIMPL_H
+
+#include <rtems/rtems/part.h>
+#include <rtems/score/chainimpl.h>
+
+#ifdef __cplusplus
+extern "C" {
 #endif
 
-#ifndef _RTEMS_RTEMS_PART_INL
-#define _RTEMS_RTEMS_PART_INL
+/**
+ * @defgroup ClassicPartImpl Classic Partition Manager Implementation
+ *
+ * @ingroup ClassicPart
+ *
+ * @{
+ */
 
-#include <rtems/score/chainimpl.h>
+/**
+ * This constant is defined to extern most of the time when using
+ * this header file. However by defining it to nothing, the data
+ * declared in this header file can be instantiated. This is done
+ * in a single per manager file.
+ *
+ * Partition Manager -- Instantiate Data
+ */
+#ifndef RTEMS_PART_EXTERN
+#define RTEMS_PART_EXTERN extern
+#endif
+
+/**
+ *  The following defines the information control block used to
+ *  manage this class of objects.
+ */
+RTEMS_PART_EXTERN Objects_Information _Partition_Information;
 
 /**
- *  @addtogroup ClassicPart
- *  @{
+ *  @brief Partition Manager Initialization
+ *
+ *  This routine performs the initialization necessary for this manager.
  */
+void _Partition_Manager_initialization(void);
 
 /**
  *  @brief Allocate a buffer from the_partition.
@@ -173,5 +203,13 @@ RTEMS_INLINE_ROUTINE bool _Partition_Is_null (
 
 /**@}*/
 
+#ifdef __cplusplus
+}
+#endif
+
+#if defined(RTEMS_MULTIPROCESSING)
+#include <rtems/rtems/partmp.h>
+#endif
+
 #endif
 /* end of include file */
diff --git a/cpukit/rtems/include/rtems/rtems/partmp.h b/cpukit/rtems/include/rtems/rtems/partmp.h
index 3d3f47f..6eae109 100644
--- a/cpukit/rtems/include/rtems/rtems/partmp.h
+++ b/cpukit/rtems/include/rtems/rtems/partmp.h
@@ -18,8 +18,8 @@
 #ifndef _RTEMS_RTEMS_PARTMP_H
 #define _RTEMS_RTEMS_PARTMP_H
 
-#ifdef __cplusplus
-extern "C" {
+#ifndef _RTEMS_RTEMS_PARTIMPL_H
+# error "Never use <rtems/rtems/partmp.h> directly; include <rtems/rtems/partimpl.h> instead."
 #endif
 
 #include <rtems/score/mppkt.h>
@@ -27,7 +27,9 @@ extern "C" {
 #include <rtems/rtems/options.h>
 #include <rtems/score/thread.h>
 
-#include <rtems/rtems/part.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /**
  *  @defgroup ClassicPartMP Partition MP Support
diff --git a/cpukit/rtems/preinstall.am b/cpukit/rtems/preinstall.am
index 05dd0d2..f98fd14 100644
--- a/cpukit/rtems/preinstall.am
+++ b/cpukit/rtems/preinstall.am
@@ -115,6 +115,10 @@ $(PROJECT_INCLUDE)/rtems/rtems/part.h: include/rtems/rtems/part.h $(PROJECT_INCL
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/part.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/part.h
 
+$(PROJECT_INCLUDE)/rtems/rtems/partimpl.h: include/rtems/rtems/partimpl.h $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/partimpl.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/partimpl.h
+
 $(PROJECT_INCLUDE)/rtems/rtems/ratemon.h: include/rtems/rtems/ratemon.h $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/ratemon.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/ratemon.h
@@ -217,10 +221,6 @@ $(PROJECT_INCLUDE)/rtems/rtems/taskmp.h: include/rtems/rtems/taskmp.h $(PROJECT_
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/taskmp.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/taskmp.h
 endif
-$(PROJECT_INCLUDE)/rtems/rtems/part.inl: inline/rtems/rtems/part.inl $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp)
-	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/part.inl
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/part.inl
-
 $(PROJECT_INCLUDE)/rtems/rtems/region.inl: inline/rtems/rtems/region.inl $(PROJECT_INCLUDE)/rtems/rtems/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/rtems/region.inl
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/rtems/region.inl
diff --git a/cpukit/rtems/src/part.c b/cpukit/rtems/src/part.c
index 042cdaf..c669c96 100644
--- a/cpukit/rtems/src/part.c
+++ b/cpukit/rtems/src/part.c
@@ -24,7 +24,7 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/address.h>
 #include <rtems/score/object.h>
-#include <rtems/rtems/part.h>
+#include <rtems/rtems/partimpl.h>
 #include <rtems/score/thread.h>
 #include <rtems/score/sysstate.h>
 
diff --git a/cpukit/rtems/src/partcreate.c b/cpukit/rtems/src/partcreate.c
index 536f56e..edba8eb 100644
--- a/cpukit/rtems/src/partcreate.c
+++ b/cpukit/rtems/src/partcreate.c
@@ -23,7 +23,7 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/address.h>
 #include <rtems/score/object.h>
-#include <rtems/rtems/part.h>
+#include <rtems/rtems/partimpl.h>
 #include <rtems/score/thread.h>
 #include <rtems/score/sysstate.h>
 
diff --git a/cpukit/rtems/src/partdata.c b/cpukit/rtems/src/partdata.c
index b568c4d..3197c3d 100644
--- a/cpukit/rtems/src/partdata.c
+++ b/cpukit/rtems/src/partdata.c
@@ -21,5 +21,4 @@
 /* instantiate RTEMS partition data */
 #define RTEMS_PART_EXTERN
 
-#include <rtems/system.h>
-#include <rtems/rtems/part.h>
+#include <rtems/rtems/partimpl.h>
diff --git a/cpukit/rtems/src/partdelete.c b/cpukit/rtems/src/partdelete.c
index 2248adc..48a6768 100644
--- a/cpukit/rtems/src/partdelete.c
+++ b/cpukit/rtems/src/partdelete.c
@@ -23,7 +23,7 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/address.h>
 #include <rtems/score/object.h>
-#include <rtems/rtems/part.h>
+#include <rtems/rtems/partimpl.h>
 #include <rtems/score/thread.h>
 #include <rtems/score/sysstate.h>
 
diff --git a/cpukit/rtems/src/partgetbuffer.c b/cpukit/rtems/src/partgetbuffer.c
index 393cab6..0b8f20c 100644
--- a/cpukit/rtems/src/partgetbuffer.c
+++ b/cpukit/rtems/src/partgetbuffer.c
@@ -23,7 +23,7 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/address.h>
 #include <rtems/score/object.h>
-#include <rtems/rtems/part.h>
+#include <rtems/rtems/partimpl.h>
 #include <rtems/score/thread.h>
 #include <rtems/score/sysstate.h>
 
diff --git a/cpukit/rtems/src/partident.c b/cpukit/rtems/src/partident.c
index d13af32..b6ec38b 100644
--- a/cpukit/rtems/src/partident.c
+++ b/cpukit/rtems/src/partident.c
@@ -23,7 +23,7 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/address.h>
 #include <rtems/score/object.h>
-#include <rtems/rtems/part.h>
+#include <rtems/rtems/partimpl.h>
 #include <rtems/score/thread.h>
 #include <rtems/score/sysstate.h>
 
diff --git a/cpukit/rtems/src/partmp.c b/cpukit/rtems/src/partmp.c
index 2928238..d3b4f73 100644
--- a/cpukit/rtems/src/partmp.c
+++ b/cpukit/rtems/src/partmp.c
@@ -24,7 +24,7 @@
 #include <rtems/score/mppkt.h>
 #include <rtems/score/object.h>
 #include <rtems/rtems/options.h>
-#include <rtems/rtems/part.h>
+#include <rtems/rtems/partimpl.h>
 #include <rtems/score/thread.h>
 #include <rtems/rtems/support.h>
 
diff --git a/cpukit/rtems/src/partreturnbuffer.c b/cpukit/rtems/src/partreturnbuffer.c
index 378b755..c5f6c47 100644
--- a/cpukit/rtems/src/partreturnbuffer.c
+++ b/cpukit/rtems/src/partreturnbuffer.c
@@ -19,7 +19,7 @@
 #include <rtems/rtems/support.h>
 #include <rtems/score/address.h>
 #include <rtems/score/object.h>
-#include <rtems/rtems/part.h>
+#include <rtems/rtems/partimpl.h>
 #include <rtems/score/thread.h>
 #include <rtems/score/sysstate.h>
 
diff --git a/cpukit/sapi/src/rtemsapi.c b/cpukit/sapi/src/rtemsapi.c
index a83a19c..8814e87 100644
--- a/cpukit/sapi/src/rtemsapi.c
+++ b/cpukit/sapi/src/rtemsapi.c
@@ -35,7 +35,7 @@
 #if defined(RTEMS_MULTIPROCESSING)
 #include <rtems/rtems/mp.h>
 #endif
-#include <rtems/rtems/part.h>
+#include <rtems/rtems/partimpl.h>
 #include <rtems/rtems/ratemonimpl.h>
 #include <rtems/rtems/region.h>
 #include <rtems/rtems/semimpl.h>
diff --git a/testsuites/sptests/spsize/size.c b/testsuites/sptests/spsize/size.c
index 3e5ae9e..25df94f 100644
--- a/testsuites/sptests/spsize/size.c
+++ b/testsuites/sptests/spsize/size.c
@@ -33,7 +33,7 @@
 #include <rtems/rtems/mp.h>
 #include <rtems/score/mpci.h>
 #endif
-#include <rtems/rtems/part.h>
+#include <rtems/rtems/partimpl.h>
 #include <rtems/score/priority.h>
 #include <rtems/rtems/ratemonimpl.h>
 #include <rtems/rtems/region.h>
@@ -334,7 +334,7 @@ uninitialized =
 
 /*options.h*/   0                                         +
 
-/*part.h*/      (sizeof _Partition_Information)           +
+/*partimpl.h*/  (sizeof _Partition_Information)           +
 
 #if defined(RTEMS_MULTIPROCESSING)
 /*partmp.h*/    0                                         +




More information about the vc mailing list