summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--c/src/exec/score/headers/heap.h10
-rw-r--r--c/src/exec/score/include/rtems/score/heap.h10
-rw-r--r--c/src/exec/score/inline/heap.inl16
-rw-r--r--c/src/exec/score/inline/rtems/score/heap.inl16
-rw-r--r--c/src/exec/score/macros/heap.inl12
-rw-r--r--c/src/exec/score/macros/rtems/score/heap.inl12
-rw-r--r--cpukit/score/include/rtems/score/heap.h10
-rw-r--r--cpukit/score/inline/rtems/score/heap.inl16
-rw-r--r--cpukit/score/macros/rtems/score/heap.inl12
9 files changed, 114 insertions, 0 deletions
diff --git a/c/src/exec/score/headers/heap.h b/c/src/exec/score/headers/heap.h
index bf4a8dde6e..b0a2d57f39 100644
--- a/c/src/exec/score/headers/heap.h
+++ b/c/src/exec/score/headers/heap.h
@@ -278,6 +278,16 @@ STATIC INLINE Heap_Block *_Heap_Block_at(
unsigned32 offset
);
+/*PAGE
+ *
+ * _Heap_User_Block_at
+ *
+ */
+
+STATIC INLINE Heap_Block *_Heap_User_Block_at(
+ void *base
+);
+
/*
* _Heap_Is_previous_block_free
*
diff --git a/c/src/exec/score/include/rtems/score/heap.h b/c/src/exec/score/include/rtems/score/heap.h
index bf4a8dde6e..b0a2d57f39 100644
--- a/c/src/exec/score/include/rtems/score/heap.h
+++ b/c/src/exec/score/include/rtems/score/heap.h
@@ -278,6 +278,16 @@ STATIC INLINE Heap_Block *_Heap_Block_at(
unsigned32 offset
);
+/*PAGE
+ *
+ * _Heap_User_Block_at
+ *
+ */
+
+STATIC INLINE Heap_Block *_Heap_User_Block_at(
+ void *base
+);
+
/*
* _Heap_Is_previous_block_free
*
diff --git a/c/src/exec/score/inline/heap.inl b/c/src/exec/score/inline/heap.inl
index c28f1a6067..b3e04a1deb 100644
--- a/c/src/exec/score/inline/heap.inl
+++ b/c/src/exec/score/inline/heap.inl
@@ -94,6 +94,22 @@ STATIC INLINE Heap_Block *_Heap_Block_at(
/*PAGE
*
+ * _Heap_User_Block_at
+ *
+ */
+
+STATIC INLINE Heap_Block *_Heap_User_Block_at(
+ void *base
+)
+{
+ unsigned32 offset;
+
+ offset = *(((unsigned32 *) base) - 1);
+ return _Heap_Block_at( base, -offset + -HEAP_BLOCK_USED_OVERHEAD);
+}
+
+/*PAGE
+ *
* _Heap_Is_previous_block_free
*
*/
diff --git a/c/src/exec/score/inline/rtems/score/heap.inl b/c/src/exec/score/inline/rtems/score/heap.inl
index c28f1a6067..b3e04a1deb 100644
--- a/c/src/exec/score/inline/rtems/score/heap.inl
+++ b/c/src/exec/score/inline/rtems/score/heap.inl
@@ -94,6 +94,22 @@ STATIC INLINE Heap_Block *_Heap_Block_at(
/*PAGE
*
+ * _Heap_User_Block_at
+ *
+ */
+
+STATIC INLINE Heap_Block *_Heap_User_Block_at(
+ void *base
+)
+{
+ unsigned32 offset;
+
+ offset = *(((unsigned32 *) base) - 1);
+ return _Heap_Block_at( base, -offset + -HEAP_BLOCK_USED_OVERHEAD);
+}
+
+/*PAGE
+ *
* _Heap_Is_previous_block_free
*
*/
diff --git a/c/src/exec/score/macros/heap.inl b/c/src/exec/score/macros/heap.inl
index 1023a77fc5..f04d69cdb6 100644
--- a/c/src/exec/score/macros/heap.inl
+++ b/c/src/exec/score/macros/heap.inl
@@ -70,6 +70,18 @@
/*PAGE
*
+ * _Heap_User_Block_at
+ *
+ */
+
+#define _Heap_User_Block_at( _base ) \
+ _Heap_Block_at( \
+ (_base), \
+ -*(((unsigned32 *) (_base)) - 1) + -HEAP_BLOCK_USED_OVERHEAD \
+ )
+
+/*PAGE
+ *
* _Heap_Is_previous_block_free
*/
diff --git a/c/src/exec/score/macros/rtems/score/heap.inl b/c/src/exec/score/macros/rtems/score/heap.inl
index 1023a77fc5..f04d69cdb6 100644
--- a/c/src/exec/score/macros/rtems/score/heap.inl
+++ b/c/src/exec/score/macros/rtems/score/heap.inl
@@ -70,6 +70,18 @@
/*PAGE
*
+ * _Heap_User_Block_at
+ *
+ */
+
+#define _Heap_User_Block_at( _base ) \
+ _Heap_Block_at( \
+ (_base), \
+ -*(((unsigned32 *) (_base)) - 1) + -HEAP_BLOCK_USED_OVERHEAD \
+ )
+
+/*PAGE
+ *
* _Heap_Is_previous_block_free
*/
diff --git a/cpukit/score/include/rtems/score/heap.h b/cpukit/score/include/rtems/score/heap.h
index bf4a8dde6e..b0a2d57f39 100644
--- a/cpukit/score/include/rtems/score/heap.h
+++ b/cpukit/score/include/rtems/score/heap.h
@@ -278,6 +278,16 @@ STATIC INLINE Heap_Block *_Heap_Block_at(
unsigned32 offset
);
+/*PAGE
+ *
+ * _Heap_User_Block_at
+ *
+ */
+
+STATIC INLINE Heap_Block *_Heap_User_Block_at(
+ void *base
+);
+
/*
* _Heap_Is_previous_block_free
*
diff --git a/cpukit/score/inline/rtems/score/heap.inl b/cpukit/score/inline/rtems/score/heap.inl
index c28f1a6067..b3e04a1deb 100644
--- a/cpukit/score/inline/rtems/score/heap.inl
+++ b/cpukit/score/inline/rtems/score/heap.inl
@@ -94,6 +94,22 @@ STATIC INLINE Heap_Block *_Heap_Block_at(
/*PAGE
*
+ * _Heap_User_Block_at
+ *
+ */
+
+STATIC INLINE Heap_Block *_Heap_User_Block_at(
+ void *base
+)
+{
+ unsigned32 offset;
+
+ offset = *(((unsigned32 *) base) - 1);
+ return _Heap_Block_at( base, -offset + -HEAP_BLOCK_USED_OVERHEAD);
+}
+
+/*PAGE
+ *
* _Heap_Is_previous_block_free
*
*/
diff --git a/cpukit/score/macros/rtems/score/heap.inl b/cpukit/score/macros/rtems/score/heap.inl
index 1023a77fc5..f04d69cdb6 100644
--- a/cpukit/score/macros/rtems/score/heap.inl
+++ b/cpukit/score/macros/rtems/score/heap.inl
@@ -70,6 +70,18 @@
/*PAGE
*
+ * _Heap_User_Block_at
+ *
+ */
+
+#define _Heap_User_Block_at( _base ) \
+ _Heap_Block_at( \
+ (_base), \
+ -*(((unsigned32 *) (_base)) - 1) + -HEAP_BLOCK_USED_OVERHEAD \
+ )
+
+/*PAGE
+ *
* _Heap_Is_previous_block_free
*/