[rtems commit] rtems: Move internal structures to partdata.h

Sebastian Huber sebh at rtems.org
Mon Nov 12 14:38:52 UTC 2018


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Nov  8 10:32:14 2018 +0100

rtems: Move internal structures to partdata.h

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(-)

diff --git a/cpukit/headers.am b/cpukit/headers.am
index cd0abfa..a274647 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 713064f..4eed0d2 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 769f3c6..7208f88 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" {
@@ -51,28 +36,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
  *
  *  Partition Manager
diff --git a/cpukit/include/rtems/rtems/partdata.h b/cpukit/include/rtems/rtems/partdata.h
new file mode 100644
index 0000000..4423de0
--- /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 02d3ff8..d795748 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 b428f9e..18034cd 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() */
 



More information about the vc mailing list