summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/heapgetinfo.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-09-06 15:24:08 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-09-06 15:24:08 +0000
commitdea3eccb38b556b04552219e00b7abd656587278 (patch)
tree6affcb3026172273e366ee15ed3e8ec70f023a20 /cpukit/score/src/heapgetinfo.c
parentRegenerate. (diff)
downloadrtems-dea3eccb38b556b04552219e00b7abd656587278.tar.bz2
2009-09-06 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
* libcsupport/src/free.c, libmisc/stackchk/check.c, rtems/include/rtems/rtems/region.h, rtems/src/regioncreate.c, rtems/src/regionextend.c, rtems/src/regiongetinfo.c, rtems/src/regiongetsegment.c, rtems/src/regiongetsegmentsize.c, rtems/src/regionresizesegment.c, score/src/pheapallocate.c, score/src/pheapallocatealigned.c, score/src/pheapextend.c, score/src/pheapfree.c, score/src/pheapgetblocksize.c, score/src/pheapgetfreeinfo.c, score/src/pheapgetinfo.c, score/src/pheapgetsize.c, score/src/pheapinit.c, score/src/pheapresizeblock.c, score/src/pheapwalk.c: Update for heap API changes. * score/include/rtems/score/apimutex.h, score/include/rtems/score/object.h: Documentation. * score/include/rtems/score/heap.h, score/include/rtems/score/protectedheap.h, score/inline/rtems/score/heap.inl, score/src/heap.c, score/src/heapallocate.c, score/src/heapallocatealigned.c, score/src/heapextend.c, score/src/heapfree.c, score/src/heapgetfreeinfo.c, score/src/heapgetinfo.c, score/src/heapresizeblock.c, score/src/heapsizeofuserarea.c, score/src/heapwalk.c: Overall cleanup. Added boundary constraint to allocation function. More changes follow.
Diffstat (limited to 'cpukit/score/src/heapgetinfo.c')
-rw-r--r--cpukit/score/src/heapgetinfo.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/cpukit/score/src/heapgetinfo.c b/cpukit/score/src/heapgetinfo.c
index 7f907170b9..bc3d4cc893 100644
--- a/cpukit/score/src/heapgetinfo.c
+++ b/cpukit/score/src/heapgetinfo.c
@@ -1,6 +1,12 @@
-/*
- * Heap Handler
+/**
+ * @file
+ *
+ * @ingroup ScoreHeap
*
+ * @brief Heap Handler implementation.
+ */
+
+/*
* COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
@@ -19,27 +25,13 @@
#include <rtems/score/sysstate.h>
#include <rtems/score/heap.h>
-/*
- * _Heap_Get_information
- *
- * This kernel routine walks the heap and tots up the free and allocated
- * sizes. Derived from _Heap_Walk.
- *
- * Input parameters:
- * the_heap - pointer to heap header
- * the_info - pointer for information to be returned
- *
- * Output parameters:
- * *the_info - contains information about heap
- * return 0=success, otherwise heap is corrupt.
- */
-Heap_Get_information_status _Heap_Get_information(
+void _Heap_Get_information(
Heap_Control *the_heap,
Heap_Information_block *the_info
)
{
- Heap_Block *the_block = the_heap->start;
- Heap_Block *const end = the_heap->final;
+ Heap_Block *the_block = the_heap->first_block;
+ Heap_Block *const end = the_heap->last_block;
_HAssert(the_block->prev_size == the_heap->page_size);
_HAssert(_Heap_Is_prev_used(the_block));
@@ -52,7 +44,7 @@ Heap_Get_information_status _Heap_Get_information(
the_info->Used.largest = 0;
while ( the_block != end ) {
- uint32_t const the_size = _Heap_Block_size(the_block);
+ uintptr_t const the_size = _Heap_Block_size(the_block);
Heap_Block *const next_block = _Heap_Block_at(the_block, the_size);
Heap_Information *info;
@@ -74,7 +66,5 @@ Heap_Get_information_status _Heap_Get_information(
* "used" as client never allocated it. Make 'Used.total' contain this
* blocks' overhead though.
*/
- the_info->Used.total += HEAP_LAST_BLOCK_OVERHEAD;
-
- return HEAP_GET_INFORMATION_SUCCESSFUL;
+ the_info->Used.total += HEAP_BLOCK_HEADER_SIZE;
}