[rtems commit] score: Move _Heap_Area_overhead() definition.

Sebastian Huber sebh at rtems.org
Wed Jul 24 13:27:52 UTC 2013


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

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

score: Move _Heap_Area_overhead() definition.

This function is used in bootcard.h.

---

 cpukit/score/include/rtems/score/heap.h     |   32 ++++++++++++++++++++++++++-
 cpukit/score/include/rtems/score/heapimpl.h |   30 -------------------------
 2 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/cpukit/score/include/rtems/score/heap.h b/cpukit/score/include/rtems/score/heap.h
index 5a6b3a1..80a041c 100644
--- a/cpukit/score/include/rtems/score/heap.h
+++ b/cpukit/score/include/rtems/score/heap.h
@@ -18,7 +18,7 @@
 #ifndef _RTEMS_SCORE_HEAP_H
 #define _RTEMS_SCORE_HEAP_H
 
-#include <rtems/score/basedefs.h>
+#include <rtems/score/cpu.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -434,6 +434,36 @@ uintptr_t _Heap_No_extend(
   uintptr_t unused_3
 );
 
+RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up(
+  uintptr_t value,
+  uintptr_t alignment
+)
+{
+  uintptr_t remainder = value % alignment;
+
+  if ( remainder != 0 ) {
+    return value - remainder + alignment;
+  } else {
+    return value;
+  }
+}
+
+/**
+ * @brief Returns the worst case overhead to manage a memory area.
+ */
+RTEMS_INLINE_ROUTINE uintptr_t _Heap_Area_overhead(
+  uintptr_t page_size
+)
+{
+  if ( page_size != 0 ) {
+    page_size = _Heap_Align_up( page_size, CPU_ALIGNMENT );
+  } else {
+    page_size = CPU_ALIGNMENT;
+  }
+
+  return 2 * (page_size - 1) + HEAP_BLOCK_HEADER_SIZE;
+}
+
 /** @} */
 
 #ifdef __cplusplus
diff --git a/cpukit/score/include/rtems/score/heapimpl.h b/cpukit/score/include/rtems/score/heapimpl.h
index 27c3a23..9c28ffe 100644
--- a/cpukit/score/include/rtems/score/heapimpl.h
+++ b/cpukit/score/include/rtems/score/heapimpl.h
@@ -284,36 +284,6 @@ Heap_Resize_status _Heap_Resize_block(
   uintptr_t *new_size
 );
 
-RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up(
-  uintptr_t value,
-  uintptr_t alignment
-)
-{
-  uintptr_t remainder = value % alignment;
-
-  if ( remainder != 0 ) {
-    return value - remainder + alignment;
-  } else {
-    return value;
-  }
-}
-
-/**
- * @brief Returns the worst case overhead to manage a memory area.
- */
-RTEMS_INLINE_ROUTINE uintptr_t _Heap_Area_overhead(
-  uintptr_t page_size
-)
-{
-  if ( page_size != 0 ) {
-    page_size = _Heap_Align_up( page_size, CPU_ALIGNMENT );
-  } else {
-    page_size = CPU_ALIGNMENT;
-  }
-
-  return 2 * (page_size - 1) + HEAP_BLOCK_HEADER_SIZE;
-}
-
 /**
  * @brief Allocates the memory area starting at @a alloc_begin of size
  * @a alloc_size bytes in the block @a block.




More information about the vc mailing list