[PATCH 08/21] rtems: Move internal structures to partdata.h

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Nov 8 12:52:01 UTC 2018


Update #3598.
---
 cpukit/headers.am                     |  1 +
 cpukit/include/rtems/confdefs.h       |  1 +
 cpukit/include/rtems/rtems/part.h     | 43 ++----------------------
 cpukit/include/rtems/rtems/partdata.h | 63 +++++++++++++++++++++++++++++++++++
 cpukit/include/rtems/rtems/partimpl.h |  2 +-
 cpukit/libmisc/monitor/mon-part.c     |  1 +
 6 files changed, 70 insertions(+), 41 deletions(-)
 create mode 100644 cpukit/include/rtems/rtems/partdata.h

diff --git a/cpukit/headers.am b/cpukit/headers.am
index cd0abfabec..a274647105 100644
--- a/cpukit/headers.am
+++ b/cpukit/headers.am
@@ -253,6 +253,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/partdata.h
 include_rtems_rtems_HEADERS += include/rtems/rtems/partimpl.h
 include_rtems_rtems_HEADERS += include/rtems/rtems/partmp.h
 include_rtems_rtems_HEADERS += include/rtems/rtems/ratemon.h
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index 713064f6af..4eed0d2cfc 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -35,6 +35,7 @@
 #include <rtems/rtems/barrierdata.h>
 #include <rtems/rtems/dpmemdata.h>
 #include <rtems/rtems/messagedata.h>
+#include <rtems/rtems/partdata.h>
 #include <rtems/rtems/ratemondata.h>
 #include <rtems/posix/key.h>
 #include <rtems/posix/mqueue.h>
diff --git a/cpukit/include/rtems/rtems/part.h b/cpukit/include/rtems/rtems/part.h
index 769f3c6904..7208f88e6b 100644
--- a/cpukit/include/rtems/rtems/part.h
+++ b/cpukit/include/rtems/rtems/part.h
@@ -1,23 +1,9 @@
 /**
- * @file rtems/rtems/part.h
+ * @file
  *
- * @defgroup ClassicPart Partitions
+ * @ingroup ClassicPart
  *
- * @ingroup ClassicRTEMS
- * @brief Partition Manager
- *
- * This include file contains all the constants and structures associated
- * with the Partition Manager. This manager provides facilities to
- * dynamically allocate memory in fixed-sized units which are returned
- * as buffers.
- *
- * Directives provided are:
- *
- * - create a partition
- * - get an ID of a partition
- * - delete a partition
- * - get a buffer from a partition
- * - return a buffer to a partition
+ * @brief Classic Partition Manager API
  */
 
 /* COPYRIGHT (c) 1989-2008.
@@ -34,7 +20,6 @@
 #include <rtems/rtems/attr.h>
 #include <rtems/rtems/status.h>
 #include <rtems/rtems/types.h>
-#include <rtems/score/isrlock.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -50,28 +35,6 @@ extern "C" {
  */
 /**@{*/
 
-/**
- *  The following defines the control block used to manage each partition.
- */
-typedef struct {
-  /** This field is the object management portion of a Partition instance. */
-  Objects_Control     Object;
-  /** This field is the lock of the Partition. */
-  ISR_LOCK_MEMBER(    Lock )
-  /** This field is the physical starting address of the Partition. */
-  void               *starting_address;
-  /** This field is the size of the Partition in bytes. */
-  uintptr_t           length;
-  /** This field is the size of each buffer in bytes */
-  size_t              buffer_size;
-  /** This field is the attribute set provided at create time. */
-  rtems_attribute     attribute_set;
-  /** This field is the of allocated buffers. */
-  uintptr_t           number_of_used_blocks;
-  /** This field is the chain used to manage unallocated buffers. */
-  Chain_Control       Memory;
-}   Partition_Control;
-
 /**
  *  @brief RTEMS Partition Create
  *
diff --git a/cpukit/include/rtems/rtems/partdata.h b/cpukit/include/rtems/rtems/partdata.h
new file mode 100644
index 0000000000..4423de09f7
--- /dev/null
+++ b/cpukit/include/rtems/rtems/partdata.h
@@ -0,0 +1,63 @@
+/**
+ * @file
+ *
+ * @ingroup ClassicPartImpl
+ *
+ * @brief Classic Partition Manager Data Structures
+ */
+
+/* COPYRIGHT (c) 1989-2008.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * 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.
+ */
+
+#ifndef _RTEMS_RTEMS_PARTDATA_H
+#define _RTEMS_RTEMS_PARTDATA_H
+
+#include <rtems/rtems/part.h>
+#include <rtems/score/isrlock.h>
+#include <rtems/score/object.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @addtogroup ClassicPartImpl
+ *
+ * @{
+ */
+
+/**
+ *  The following defines the control block used to manage each partition.
+ */
+typedef struct {
+  /** This field is the object management portion of a Partition instance. */
+  Objects_Control     Object;
+  /** This field is the lock of the Partition. */
+  ISR_LOCK_MEMBER(    Lock )
+  /** This field is the physical starting address of the Partition. */
+  void               *starting_address;
+  /** This field is the size of the Partition in bytes. */
+  uintptr_t           length;
+  /** This field is the size of each buffer in bytes */
+  size_t              buffer_size;
+  /** This field is the attribute set provided at create time. */
+  rtems_attribute     attribute_set;
+  /** This field is the of allocated buffers. */
+  uintptr_t           number_of_used_blocks;
+  /** This field is the chain used to manage unallocated buffers. */
+  Chain_Control       Memory;
+}   Partition_Control;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */
diff --git a/cpukit/include/rtems/rtems/partimpl.h b/cpukit/include/rtems/rtems/partimpl.h
index 02d3ff8b44..d795748723 100644
--- a/cpukit/include/rtems/rtems/partimpl.h
+++ b/cpukit/include/rtems/rtems/partimpl.h
@@ -17,7 +17,7 @@
 #ifndef _RTEMS_RTEMS_PARTIMPL_H
 #define _RTEMS_RTEMS_PARTIMPL_H
 
-#include <rtems/rtems/part.h>
+#include <rtems/rtems/partdata.h>
 #include <rtems/score/chainimpl.h>
 #include <rtems/score/objectimpl.h>
 
diff --git a/cpukit/libmisc/monitor/mon-part.c b/cpukit/libmisc/monitor/mon-part.c
index b428f9e868..18034cd58f 100644
--- a/cpukit/libmisc/monitor/mon-part.c
+++ b/cpukit/libmisc/monitor/mon-part.c
@@ -9,6 +9,7 @@
 #include <rtems.h>
 #include <rtems/monitor.h>
 #include <rtems/rtems/attrimpl.h>
+#include <rtems/rtems/partdata.h>
 #include <stdio.h>
 #include <string.h>    /* memcpy() */
 
-- 
2.16.4




More information about the devel mailing list